diff --git a/CHANGELOG.md b/CHANGELOG.md index 3695c608a1..e009a16f24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.42.0 - 2023-06-27 +### Added +- Support for calling Oracle Cloud Infrastructure services in the eu-frankfurt-2 region +- Support for the OS Management Hub service +- Support for changing the key store type, and rotating keys, on Exadata Cloud at Customer in the Database service +- Support for launching VM database systems using Ampere A1 shapes in the Database service +- Support for additional currencies and countries on paid listings in the Marketplace service +- Support for ECPU integration in the License Manager service +- Support for freeform and defined tags on resources in the Generic Artifacts service +- Support for SQL endpoints in the Data Flow service +- Support for setting replication delays on channels in the MySQL Database service +- Support for setting how channels handle replicated tables with no primary key in the MySQL Database service +- Support for SQL Plan Management (SPM) in Database Management service + + +### Breaking Changes +- Support for retries by default on operations of the Generic Artifacts service + + ## 65.41.1 - 2023-06-20 ### Added - Support for serial console access in the Database service diff --git a/Makefile b/Makefile index dd42f89ba0..cbd65fa062 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 ##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 ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/artifacts/artifacts_client.go b/artifacts/artifacts_client.go index 15946f7b73..5dc1b41169 100644 --- a/artifacts/artifacts_client.go +++ b/artifacts/artifacts_client.go @@ -96,9 +96,10 @@ func (client *ArtifactsClient) ConfigurationProvider() *common.ConfigurationProv // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeContainerRepositoryCompartment.go.html to see an example of how to use ChangeContainerRepositoryCompartment API. +// A default retry strategy applies to this operation ChangeContainerRepositoryCompartment() func (client ArtifactsClient) ChangeContainerRepositoryCompartment(ctx context.Context, request ChangeContainerRepositoryCompartmentRequest) (response ChangeContainerRepositoryCompartmentResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -160,9 +161,10 @@ func (client ArtifactsClient) changeContainerRepositoryCompartment(ctx context.C // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeRepositoryCompartment.go.html to see an example of how to use ChangeRepositoryCompartment API. +// A default retry strategy applies to this operation ChangeRepositoryCompartment() func (client ArtifactsClient) ChangeRepositoryCompartment(ctx context.Context, request ChangeRepositoryCompartmentRequest) (response ChangeRepositoryCompartmentResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -222,9 +224,10 @@ func (client ArtifactsClient) changeRepositoryCompartment(ctx context.Context, r // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerImageSignature.go.html to see an example of how to use CreateContainerImageSignature API. +// A default retry strategy applies to this operation CreateContainerImageSignature() func (client ArtifactsClient) CreateContainerImageSignature(ctx context.Context, request CreateContainerImageSignatureRequest) (response CreateContainerImageSignatureResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -284,9 +287,10 @@ func (client ArtifactsClient) createContainerImageSignature(ctx context.Context, // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerRepository.go.html to see an example of how to use CreateContainerRepository API. +// A default retry strategy applies to this operation CreateContainerRepository() func (client ArtifactsClient) CreateContainerRepository(ctx context.Context, request CreateContainerRepositoryRequest) (response CreateContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -408,9 +412,10 @@ func (client ArtifactsClient) createRepository(ctx context.Context, request comm // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImage.go.html to see an example of how to use DeleteContainerImage API. +// A default retry strategy applies to this operation DeleteContainerImage() func (client ArtifactsClient) DeleteContainerImage(ctx context.Context, request DeleteContainerImageRequest) (response DeleteContainerImageResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -465,9 +470,10 @@ func (client ArtifactsClient) deleteContainerImage(ctx context.Context, request // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImageSignature.go.html to see an example of how to use DeleteContainerImageSignature API. +// A default retry strategy applies to this operation DeleteContainerImageSignature() func (client ArtifactsClient) DeleteContainerImageSignature(ctx context.Context, request DeleteContainerImageSignatureRequest) (response DeleteContainerImageSignatureResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -522,9 +528,10 @@ func (client ArtifactsClient) deleteContainerImageSignature(ctx context.Context, // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerRepository.go.html to see an example of how to use DeleteContainerRepository API. +// A default retry strategy applies to this operation DeleteContainerRepository() func (client ArtifactsClient) DeleteContainerRepository(ctx context.Context, request DeleteContainerRepositoryRequest) (response DeleteContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -579,9 +586,10 @@ func (client ArtifactsClient) deleteContainerRepository(ctx context.Context, req // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifact.go.html to see an example of how to use DeleteGenericArtifact API. +// A default retry strategy applies to this operation DeleteGenericArtifact() func (client ArtifactsClient) DeleteGenericArtifact(ctx context.Context, request DeleteGenericArtifactRequest) (response DeleteGenericArtifactResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -636,9 +644,10 @@ func (client ArtifactsClient) deleteGenericArtifact(ctx context.Context, request // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifactByPath.go.html to see an example of how to use DeleteGenericArtifactByPath API. +// A default retry strategy applies to this operation DeleteGenericArtifactByPath() func (client ArtifactsClient) DeleteGenericArtifactByPath(ctx context.Context, request DeleteGenericArtifactByPathRequest) (response DeleteGenericArtifactByPathResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -693,9 +702,10 @@ func (client ArtifactsClient) deleteGenericArtifactByPath(ctx context.Context, r // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteRepository.go.html to see an example of how to use DeleteRepository API. +// A default retry strategy applies to this operation DeleteRepository() func (client ArtifactsClient) DeleteRepository(ctx context.Context, request DeleteRepositoryRequest) (response DeleteRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -750,9 +760,10 @@ func (client ArtifactsClient) deleteRepository(ctx context.Context, request comm // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerConfiguration.go.html to see an example of how to use GetContainerConfiguration API. +// A default retry strategy applies to this operation GetContainerConfiguration() func (client ArtifactsClient) GetContainerConfiguration(ctx context.Context, request GetContainerConfigurationRequest) (response GetContainerConfigurationResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -807,9 +818,10 @@ func (client ArtifactsClient) getContainerConfiguration(ctx context.Context, req // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImage.go.html to see an example of how to use GetContainerImage API. +// A default retry strategy applies to this operation GetContainerImage() func (client ArtifactsClient) GetContainerImage(ctx context.Context, request GetContainerImageRequest) (response GetContainerImageResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -864,9 +876,10 @@ func (client ArtifactsClient) getContainerImage(ctx context.Context, request com // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImageSignature.go.html to see an example of how to use GetContainerImageSignature API. +// A default retry strategy applies to this operation GetContainerImageSignature() func (client ArtifactsClient) GetContainerImageSignature(ctx context.Context, request GetContainerImageSignatureRequest) (response GetContainerImageSignatureResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -921,9 +934,10 @@ func (client ArtifactsClient) getContainerImageSignature(ctx context.Context, re // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerRepository.go.html to see an example of how to use GetContainerRepository API. +// A default retry strategy applies to this operation GetContainerRepository() func (client ArtifactsClient) GetContainerRepository(ctx context.Context, request GetContainerRepositoryRequest) (response GetContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -978,9 +992,10 @@ func (client ArtifactsClient) getContainerRepository(ctx context.Context, reques // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifact.go.html to see an example of how to use GetGenericArtifact API. +// A default retry strategy applies to this operation GetGenericArtifact() func (client ArtifactsClient) GetGenericArtifact(ctx context.Context, request GetGenericArtifactRequest) (response GetGenericArtifactResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1035,9 +1050,10 @@ func (client ArtifactsClient) getGenericArtifact(ctx context.Context, request co // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifactByPath.go.html to see an example of how to use GetGenericArtifactByPath API. +// A default retry strategy applies to this operation GetGenericArtifactByPath() func (client ArtifactsClient) GetGenericArtifactByPath(ctx context.Context, request GetGenericArtifactByPathRequest) (response GetGenericArtifactByPathResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1092,9 +1108,10 @@ func (client ArtifactsClient) getGenericArtifactByPath(ctx context.Context, requ // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetRepository.go.html to see an example of how to use GetRepository API. +// A default retry strategy applies to this operation GetRepository() func (client ArtifactsClient) GetRepository(ctx context.Context, request GetRepositoryRequest) (response GetRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1149,9 +1166,10 @@ func (client ArtifactsClient) getRepository(ctx context.Context, request common. // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImageSignatures.go.html to see an example of how to use ListContainerImageSignatures API. +// A default retry strategy applies to this operation ListContainerImageSignatures() func (client ArtifactsClient) ListContainerImageSignatures(ctx context.Context, request ListContainerImageSignaturesRequest) (response ListContainerImageSignaturesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1206,9 +1224,10 @@ func (client ArtifactsClient) listContainerImageSignatures(ctx context.Context, // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImages.go.html to see an example of how to use ListContainerImages API. +// A default retry strategy applies to this operation ListContainerImages() func (client ArtifactsClient) ListContainerImages(ctx context.Context, request ListContainerImagesRequest) (response ListContainerImagesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1263,9 +1282,10 @@ func (client ArtifactsClient) listContainerImages(ctx context.Context, request c // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerRepositories.go.html to see an example of how to use ListContainerRepositories API. +// A default retry strategy applies to this operation ListContainerRepositories() func (client ArtifactsClient) ListContainerRepositories(ctx context.Context, request ListContainerRepositoriesRequest) (response ListContainerRepositoriesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1320,9 +1340,10 @@ func (client ArtifactsClient) listContainerRepositories(ctx context.Context, req // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListGenericArtifacts.go.html to see an example of how to use ListGenericArtifacts API. +// A default retry strategy applies to this operation ListGenericArtifacts() func (client ArtifactsClient) ListGenericArtifacts(ctx context.Context, request ListGenericArtifactsRequest) (response ListGenericArtifactsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1377,9 +1398,10 @@ func (client ArtifactsClient) listGenericArtifacts(ctx context.Context, request // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListRepositories.go.html to see an example of how to use ListRepositories API. +// A default retry strategy applies to this operation ListRepositories() func (client ArtifactsClient) ListRepositories(ctx context.Context, request ListRepositoriesRequest) (response ListRepositoriesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1434,9 +1456,10 @@ func (client ArtifactsClient) listRepositories(ctx context.Context, request comm // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RemoveContainerVersion.go.html to see an example of how to use RemoveContainerVersion API. +// A default retry strategy applies to this operation RemoveContainerVersion() func (client ArtifactsClient) RemoveContainerVersion(ctx context.Context, request RemoveContainerVersionRequest) (response RemoveContainerVersionResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1496,9 +1519,10 @@ func (client ArtifactsClient) removeContainerVersion(ctx context.Context, reques // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RestoreContainerImage.go.html to see an example of how to use RestoreContainerImage API. +// A default retry strategy applies to this operation RestoreContainerImage() func (client ArtifactsClient) RestoreContainerImage(ctx context.Context, request RestoreContainerImageRequest) (response RestoreContainerImageResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1558,9 +1582,10 @@ func (client ArtifactsClient) restoreContainerImage(ctx context.Context, request // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerConfiguration.go.html to see an example of how to use UpdateContainerConfiguration API. +// A default retry strategy applies to this operation UpdateContainerConfiguration() func (client ArtifactsClient) UpdateContainerConfiguration(ctx context.Context, request UpdateContainerConfigurationRequest) (response UpdateContainerConfigurationResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1610,14 +1635,131 @@ func (client ArtifactsClient) updateContainerConfiguration(ctx context.Context, return response, err } +// UpdateContainerImage Modify the properties of a container image. Avoid entering confidential information. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImage.go.html to see an example of how to use UpdateContainerImage API. +// A default retry strategy applies to this operation UpdateContainerImage() +func (client ArtifactsClient) UpdateContainerImage(ctx context.Context, request UpdateContainerImageRequest) (response UpdateContainerImageResponse, 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.updateContainerImage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateContainerImageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateContainerImageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateContainerImageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateContainerImageResponse") + } + return +} + +// updateContainerImage implements the OCIOperation interface (enables retrying operations) +func (client ArtifactsClient) updateContainerImage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/container/images/{imageId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateContainerImageResponse + 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/registry/20160918/ContainerImage/UpdateContainerImage" + err = common.PostProcessServiceError(err, "Artifacts", "UpdateContainerImage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateContainerImageSignature Modify the properties of a container image signature. Avoid entering confidential information. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImageSignature.go.html to see an example of how to use UpdateContainerImageSignature API. +// A default retry strategy applies to this operation UpdateContainerImageSignature() +func (client ArtifactsClient) UpdateContainerImageSignature(ctx context.Context, request UpdateContainerImageSignatureRequest) (response UpdateContainerImageSignatureResponse, 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.updateContainerImageSignature, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateContainerImageSignatureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateContainerImageSignatureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateContainerImageSignatureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateContainerImageSignatureResponse") + } + return +} + +// updateContainerImageSignature implements the OCIOperation interface (enables retrying operations) +func (client ArtifactsClient) updateContainerImageSignature(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/container/imageSignatures/{imageSignatureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateContainerImageSignatureResponse + 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/registry/20160918/ContainerImageSignature/UpdateContainerImageSignature" + err = common.PostProcessServiceError(err, "Artifacts", "UpdateContainerImageSignature", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateContainerRepository Modify the properties of a container repository. Avoid entering confidential information. // // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerRepository.go.html to see an example of how to use UpdateContainerRepository API. +// A default retry strategy applies to this operation UpdateContainerRepository() func (client ArtifactsClient) UpdateContainerRepository(ctx context.Context, request UpdateContainerRepositoryRequest) (response UpdateContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1672,9 +1814,10 @@ func (client ArtifactsClient) updateContainerRepository(ctx context.Context, req // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifact.go.html to see an example of how to use UpdateGenericArtifact API. +// A default retry strategy applies to this operation UpdateGenericArtifact() func (client ArtifactsClient) UpdateGenericArtifact(ctx context.Context, request UpdateGenericArtifactRequest) (response UpdateGenericArtifactResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1729,9 +1872,10 @@ func (client ArtifactsClient) updateGenericArtifact(ctx context.Context, request // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifactByPath.go.html to see an example of how to use UpdateGenericArtifactByPath API. +// A default retry strategy applies to this operation UpdateGenericArtifactByPath() func (client ArtifactsClient) UpdateGenericArtifactByPath(ctx context.Context, request UpdateGenericArtifactByPathRequest) (response UpdateGenericArtifactByPathResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1786,9 +1930,10 @@ func (client ArtifactsClient) updateGenericArtifactByPath(ctx context.Context, r // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateRepository.go.html to see an example of how to use UpdateRepository API. +// A default retry strategy applies to this operation UpdateRepository() func (client ArtifactsClient) UpdateRepository(ctx context.Context, request UpdateRepositoryRequest) (response UpdateRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } diff --git a/artifacts/container_image.go b/artifacts/container_image.go index 93b9962211..4c71e5a5d0 100644 --- a/artifacts/container_image.go +++ b/artifacts/container_image.go @@ -65,6 +65,20 @@ type ContainerImage struct { // The versions associated with this image. Versions []ContainerVersion `mandatory:"true" json:"versions"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The 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:"true" json:"systemTags"` + // An RFC 3339 timestamp indicating when the image was last pulled. TimeLastPulled *common.SDKTime `mandatory:"false" json:"timeLastPulled"` diff --git a/artifacts/container_image_signature.go b/artifacts/container_image_signature.go index a1c34235bf..131f951f34 100644 --- a/artifacts/container_image_signature.go +++ b/artifacts/container_image_signature.go @@ -56,6 +56,23 @@ type ContainerImageSignature struct { // An RFC 3339 timestamp indicating when the image was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the container image signature. + LifecycleState ContainerImageSignatureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The 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:"true" json:"systemTags"` } func (m ContainerImageSignature) String() string { @@ -70,6 +87,9 @@ func (m ContainerImageSignature) ValidateEnumValue() (bool, error) { if _, ok := GetMappingContainerImageSignatureSigningAlgorithmEnum(string(m.SigningAlgorithm)); !ok && m.SigningAlgorithm != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SigningAlgorithm: %s. Supported values are: %s.", m.SigningAlgorithm, strings.Join(GetContainerImageSignatureSigningAlgorithmEnumStringValues(), ","))) } + if _, ok := GetMappingContainerImageSignatureLifecycleStateEnum(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(GetContainerImageSignatureLifecycleStateEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -126,3 +146,49 @@ func GetMappingContainerImageSignatureSigningAlgorithmEnum(val string) (Containe enum, ok := mappingContainerImageSignatureSigningAlgorithmEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// ContainerImageSignatureLifecycleStateEnum Enum with underlying type: string +type ContainerImageSignatureLifecycleStateEnum string + +// Set of constants representing the allowable values for ContainerImageSignatureLifecycleStateEnum +const ( + ContainerImageSignatureLifecycleStateAvailable ContainerImageSignatureLifecycleStateEnum = "AVAILABLE" + ContainerImageSignatureLifecycleStateDeleting ContainerImageSignatureLifecycleStateEnum = "DELETING" + ContainerImageSignatureLifecycleStateDeleted ContainerImageSignatureLifecycleStateEnum = "DELETED" +) + +var mappingContainerImageSignatureLifecycleStateEnum = map[string]ContainerImageSignatureLifecycleStateEnum{ + "AVAILABLE": ContainerImageSignatureLifecycleStateAvailable, + "DELETING": ContainerImageSignatureLifecycleStateDeleting, + "DELETED": ContainerImageSignatureLifecycleStateDeleted, +} + +var mappingContainerImageSignatureLifecycleStateEnumLowerCase = map[string]ContainerImageSignatureLifecycleStateEnum{ + "available": ContainerImageSignatureLifecycleStateAvailable, + "deleting": ContainerImageSignatureLifecycleStateDeleting, + "deleted": ContainerImageSignatureLifecycleStateDeleted, +} + +// GetContainerImageSignatureLifecycleStateEnumValues Enumerates the set of values for ContainerImageSignatureLifecycleStateEnum +func GetContainerImageSignatureLifecycleStateEnumValues() []ContainerImageSignatureLifecycleStateEnum { + values := make([]ContainerImageSignatureLifecycleStateEnum, 0) + for _, v := range mappingContainerImageSignatureLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetContainerImageSignatureLifecycleStateEnumStringValues Enumerates the set of values in String for ContainerImageSignatureLifecycleStateEnum +func GetContainerImageSignatureLifecycleStateEnumStringValues() []string { + return []string{ + "AVAILABLE", + "DELETING", + "DELETED", + } +} + +// GetMappingContainerImageSignatureLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerImageSignatureLifecycleStateEnum(val string) (ContainerImageSignatureLifecycleStateEnum, bool) { + enum, ok := mappingContainerImageSignatureLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/artifacts/container_image_signature_summary.go b/artifacts/container_image_signature_summary.go index 38c9c1695b..5edc325c38 100644 --- a/artifacts/container_image_signature_summary.go +++ b/artifacts/container_image_signature_summary.go @@ -53,6 +53,23 @@ type ContainerImageSignatureSummary struct { // An RFC 3339 timestamp indicating when the image was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the container image signature. + LifecycleState ContainerImageSignatureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The 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:"true" json:"systemTags"` } func (m ContainerImageSignatureSummary) String() string { @@ -67,6 +84,9 @@ func (m ContainerImageSignatureSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingContainerImageSignatureSummarySigningAlgorithmEnum(string(m.SigningAlgorithm)); !ok && m.SigningAlgorithm != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SigningAlgorithm: %s. Supported values are: %s.", m.SigningAlgorithm, strings.Join(GetContainerImageSignatureSummarySigningAlgorithmEnumStringValues(), ","))) } + if _, ok := GetMappingContainerImageSignatureLifecycleStateEnum(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(GetContainerImageSignatureLifecycleStateEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/artifacts/container_image_summary.go b/artifacts/container_image_summary.go index 7cf3c7b93c..441308c106 100644 --- a/artifacts/container_image_summary.go +++ b/artifacts/container_image_summary.go @@ -47,6 +47,20 @@ type ContainerImageSummary struct { // An RFC 3339 timestamp indicating when the image was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The 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:"true" json:"systemTags"` + // The most recent version associated with this image. Version *string `mandatory:"false" json:"version"` } diff --git a/artifacts/container_repository.go b/artifacts/container_repository.go index 69ced711e9..f8599024d7 100644 --- a/artifacts/container_repository.go +++ b/artifacts/container_repository.go @@ -56,6 +56,23 @@ type ContainerRepository struct { // Total storage size in GBs that will be charged. BillableSizeInGBs *int64 `mandatory:"true" json:"billableSizeInGBs"` + // The tenancy namespace used in the container repository path. + Namespace *string `mandatory:"true" json:"namespace"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The 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:"true" json:"systemTags"` + Readme *ContainerRepositoryReadme `mandatory:"false" json:"readme"` // An RFC 3339 timestamp indicating when an image was last pushed to the repository. diff --git a/artifacts/container_repository_summary.go b/artifacts/container_repository_summary.go index 8169cdc32e..6e71a3164e 100644 --- a/artifacts/container_repository_summary.go +++ b/artifacts/container_repository_summary.go @@ -49,6 +49,23 @@ type ContainerRepositorySummary struct { // Total storage size in GBs that will be charged. BillableSizeInGBs *int64 `mandatory:"true" json:"billableSizeInGBs"` + + // The tenancy namespace used in the container repository path. + Namespace *string `mandatory:"true" json:"namespace"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The 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:"true" json:"systemTags"` } func (m ContainerRepositorySummary) String() string { diff --git a/artifacts/create_container_image_signature_details.go b/artifacts/create_container_image_signature_details.go index f727585be8..c5dcdde78b 100644 --- a/artifacts/create_container_image_signature_details.go +++ b/artifacts/create_container_image_signature_details.go @@ -42,6 +42,16 @@ type CreateContainerImageSignatureDetails struct { // The algorithm to be used for signing. These are the only supported signing algorithms for container images. SigningAlgorithm CreateContainerImageSignatureDetailsSigningAlgorithmEnum `mandatory:"true" json:"signingAlgorithm"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateContainerImageSignatureDetails) String() string { diff --git a/artifacts/create_container_repository_details.go b/artifacts/create_container_repository_details.go index ec49fbca22..c16ba02c72 100644 --- a/artifacts/create_container_repository_details.go +++ b/artifacts/create_container_repository_details.go @@ -32,6 +32,16 @@ type CreateContainerRepositoryDetails struct { IsPublic *bool `mandatory:"false" json:"isPublic"` Readme *ContainerRepositoryReadme `mandatory:"false" json:"readme"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateContainerRepositoryDetails) String() string { diff --git a/artifacts/update_container_image_details.go b/artifacts/update_container_image_details.go new file mode 100644 index 0000000000..8c0a97de88 --- /dev/null +++ b/artifacts/update_container_image_details.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Artifacts and Container Images API +// +// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. +// Use this API to manage resources such as generic artifacts and container images. +// + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerImageDetails Details for updating a container image. +type UpdateContainerImageDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateContainerImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/artifacts/update_container_image_request_response.go b/artifacts/update_container_image_request_response.go new file mode 100644 index 0000000000..353c775b68 --- /dev/null +++ b/artifacts/update_container_image_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateContainerImageRequest wrapper for the UpdateContainerImage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImage.go.html to see an example of how to use UpdateContainerImageRequest. +type UpdateContainerImageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. + // Example: `ocid1.containerimage.oc1..exampleuniqueID` + ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` + + // Update container image details. + UpdateContainerImageDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateContainerImageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateContainerImageRequest) 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 UpdateContainerImageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateContainerImageRequest) 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 UpdateContainerImageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateContainerImageResponse wrapper for the UpdateContainerImage operation +type UpdateContainerImageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ContainerImage instance + ContainerImage `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 UpdateContainerImageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateContainerImageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/artifacts/update_container_image_signature_details.go b/artifacts/update_container_image_signature_details.go new file mode 100644 index 0000000000..64189f15d4 --- /dev/null +++ b/artifacts/update_container_image_signature_details.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Artifacts and Container Images API +// +// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. +// Use this API to manage resources such as generic artifacts and container images. +// + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerImageSignatureDetails Details for updating a container image signature. +type UpdateContainerImageSignatureDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateContainerImageSignatureDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerImageSignatureDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/artifacts/update_container_image_signature_request_response.go b/artifacts/update_container_image_signature_request_response.go new file mode 100644 index 0000000000..998378e70c --- /dev/null +++ b/artifacts/update_container_image_signature_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateContainerImageSignatureRequest wrapper for the UpdateContainerImageSignature operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImageSignature.go.html to see an example of how to use UpdateContainerImageSignatureRequest. +type UpdateContainerImageSignatureRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. + // Example: `ocid1.containersignature.oc1..exampleuniqueID` + ImageSignatureId *string `mandatory:"true" contributesTo:"path" name:"imageSignatureId"` + + // Update container image signature details. + UpdateContainerImageSignatureDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateContainerImageSignatureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateContainerImageSignatureRequest) 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 UpdateContainerImageSignatureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateContainerImageSignatureRequest) 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 UpdateContainerImageSignatureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateContainerImageSignatureResponse wrapper for the UpdateContainerImageSignature operation +type UpdateContainerImageSignatureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ContainerImageSignature instance + ContainerImageSignature `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 UpdateContainerImageSignatureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateContainerImageSignatureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/artifacts/update_container_repository_details.go b/artifacts/update_container_repository_details.go index 5e9cc6ea56..53a74969bf 100644 --- a/artifacts/update_container_repository_details.go +++ b/artifacts/update_container_repository_details.go @@ -26,6 +26,16 @@ type UpdateContainerRepositoryDetails struct { IsPublic *bool `mandatory:"false" json:"isPublic"` Readme *ContainerRepositoryReadme `mandatory:"false" json:"readme"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateContainerRepositoryDetails) String() string { diff --git a/common/auth/federation_client_oke_workload_identity.go b/common/auth/federation_client_oke_workload_identity.go index e63d5b4f6f..0349b22458 100644 --- a/common/auth/federation_client_oke_workload_identity.go +++ b/common/auth/federation_client_oke_workload_identity.go @@ -26,22 +26,22 @@ const ( // Workload RPST Issuance Service (WRIS) // x509FederationClientForOkeWorkloadIdentity retrieves a security token from Auth service. type x509FederationClientForOkeWorkloadIdentity struct { - tenancyID string - sessionKeySupplier sessionKeySupplier - securityToken securityToken - authClient *common.BaseClient - mux sync.Mutex - proxymuxEndpoint string - kubernetesServiceAccountToken string // jwt - kubernetesServiceAccountCert *x509.CertPool + tenancyID string + sessionKeySupplier sessionKeySupplier + securityToken securityToken + authClient *common.BaseClient + mux sync.Mutex + proxymuxEndpoint string + saTokenProvider ServiceAccountTokenProvider + kubernetesServiceAccountCert *x509.CertPool } -func newX509FederationClientForOkeWorkloadIdentity(endpoint string, kubernetesServiceAccountToken string, +func newX509FederationClientForOkeWorkloadIdentity(endpoint string, saTokenProvider ServiceAccountTokenProvider, kubernetesServiceAccountCert *x509.CertPool) (federationClient, error) { client := &x509FederationClientForOkeWorkloadIdentity{ - proxymuxEndpoint: endpoint, - kubernetesServiceAccountToken: kubernetesServiceAccountToken, - kubernetesServiceAccountCert: kubernetesServiceAccountCert, + proxymuxEndpoint: endpoint, + saTokenProvider: saTokenProvider, + kubernetesServiceAccountCert: kubernetesServiceAccountCert, } client.sessionKeySupplier = newSessionKeySupplier() @@ -64,7 +64,7 @@ func (c *x509FederationClientForOkeWorkloadIdentity) renewSecurityToken() (err e } type workloadIdentityRequestPayload struct { - Podkey string `json:"podKey"` + podkey string `json:"podKey"` } type token struct { Token string @@ -82,7 +82,7 @@ func (c *x509FederationClientForOkeWorkloadIdentity) getSecurityToken() (securit } publicKey := string(c.sessionKeySupplier.PublicKeyPemRaw()) - rawPayload := workloadIdentityRequestPayload{Podkey: publicKey} + rawPayload := workloadIdentityRequestPayload{podkey: publicKey} payload, err := json.Marshal(rawPayload) if err != nil { return nil, fmt.Errorf("error getting security token%s", err) @@ -94,7 +94,14 @@ func (c *x509FederationClientForOkeWorkloadIdentity) getSecurityToken() (securit common.Logf("error %s", err) return nil, fmt.Errorf("error getting security token %s", err) } - request.Header.Add("Authorization", "Bearer "+c.kubernetesServiceAccountToken) + + kubernetesServiceAccountToken, err := c.saTokenProvider.ServiceAccountToken() + if err != nil { + common.Logf("error %s", err) + return nil, fmt.Errorf("error getting service account token %s", err) + } + + request.Header.Add("Authorization", "Bearer "+kubernetesServiceAccountToken) request.Header.Set("Content-Type", "application/json") opcRequestID := utils.GenerateOpcRequestID() request.Header.Set("opc-request-id", opcRequestID) diff --git a/common/auth/resouce_principal_key_provider.go b/common/auth/resouce_principal_key_provider.go index a2d4e1ba4d..f65d4ecdca 100644 --- a/common/auth/resouce_principal_key_provider.go +++ b/common/auth/resouce_principal_key_provider.go @@ -37,8 +37,10 @@ const ( ResourcePrincipalTokenEndpoint = "OCI_RESOURCE_PRINCIPAL_RPT_ENDPOINT" // KubernetesServiceAccountTokenPath that contains cluster information KubernetesServiceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token" - // KubernetesServiceAccountCertPath that contains cluster information - KubernetesServiceAccountCertPath = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + // DefaultKubernetesServiceAccountCertPath that contains cluster information + DefaultKubernetesServiceAccountCertPath = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + // OciKubernetesServiceAccountCertPath Environment variable for Kubernetes Service Account Cert Path + OciKubernetesServiceAccountCertPath = "OCI_KUBERNETES_SERVICE_ACCOUNT_CERT_PATH" // KubernetesServiceHostEnvVar environment var holding the kubernetes host KubernetesServiceHostEnvVar = "KUBERNETES_SERVICE_HOST" // KubernetesProxymuxServicePort environment var holding the kubernetes port @@ -96,6 +98,12 @@ func ResourcePrincipalConfigurationProvider() (ConfigurationProviderWithClaimAcc // OkeWorkloadIdentityConfigurationProvider returns a resource principal configuration provider by OKE Workload Identity func OkeWorkloadIdentityConfigurationProvider() (ConfigurationProviderWithClaimAccess, error) { + return OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider(NewDefaultServiceAccountTokenProvider()) +} + +// OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider returns a resource principal configuration provider by OKE Workload Identity +// with service account token provider +func OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider(saTokenProvider ServiceAccountTokenProvider) (ConfigurationProviderWithClaimAccess, error) { var version string var ok bool if version, ok = os.LookupEnv(ResourcePrincipalVersionEnvVar); !ok { @@ -104,17 +112,17 @@ func OkeWorkloadIdentityConfigurationProvider() (ConfigurationProviderWithClaimA } if version == ResourcePrincipalVersion1_1 || version == ResourcePrincipalVersion2_2 { - kubernetesServiceAccountToken, err := ioutil.ReadFile(KubernetesServiceAccountTokenPath) - if err != nil { - err = fmt.Errorf("can not create resource principal, error getting Kubernetes Service Account Token at %s", - KubernetesServiceAccountTokenPath) - return nil, resourcePrincipalError{err: err} + + saCertPath := requireEnv(OciKubernetesServiceAccountCertPath) + + if saCertPath == nil { + tmp := DefaultKubernetesServiceAccountCertPath + saCertPath = &tmp } - kubernetesServiceAccountCertRaw, err := ioutil.ReadFile(KubernetesServiceAccountCertPath) + kubernetesServiceAccountCertRaw, err := ioutil.ReadFile(*saCertPath) if err != nil { - err = fmt.Errorf("can not create resource principal, error getting Kubernetes Service Account Token at %s", - KubernetesServiceAccountCertPath) + err = fmt.Errorf("can not create resource principal, error getting Kubernetes Service Account Token at %s", *saCertPath) return nil, resourcePrincipalError{err: err} } @@ -136,8 +144,7 @@ func OkeWorkloadIdentityConfigurationProvider() (ConfigurationProviderWithClaimA } proxymuxEndpoint := fmt.Sprintf("https://%s:%s/resourcePrincipalSessionTokens", *k8sServiceHost, KubernetesProxymuxServicePort) - return newOkeWorkloadIdentityProvider(proxymuxEndpoint, string(kubernetesServiceAccountToken), - kubernetesServiceAccountCert, *region) + return newOkeWorkloadIdentityProvider(proxymuxEndpoint, saTokenProvider, kubernetesServiceAccountCert, *region) } err := fmt.Errorf("can not create resource principal, environment variable: %s, must be valid", ResourcePrincipalVersionEnvVar) @@ -288,11 +295,11 @@ func newResourcePrincipalKeyProvider22(sessionTokenLocation, privatePemLocation return &rs, nil } -func newOkeWorkloadIdentityProvider(proxymuxEndpoint string, kubernetesServiceAccountToken string, +func newOkeWorkloadIdentityProvider(proxymuxEndpoint string, saTokenProvider ServiceAccountTokenProvider, kubernetesServiceAccountCert *x509.CertPool, region string) (*resourcePrincipalKeyProvider, error) { var err error var fd federationClient - fd, err = newX509FederationClientForOkeWorkloadIdentity(proxymuxEndpoint, kubernetesServiceAccountToken, kubernetesServiceAccountCert) + fd, err = newX509FederationClientForOkeWorkloadIdentity(proxymuxEndpoint, saTokenProvider, kubernetesServiceAccountCert) if err != nil { err := fmt.Errorf("can not create resource principal, due to: %s ", err.Error()) diff --git a/common/auth/resource_principal_token_path_provider.go b/common/auth/resource_principal_token_path_provider.go index 599b5ca4da..5fb0897795 100644 --- a/common/auth/resource_principal_token_path_provider.go +++ b/common/auth/resource_principal_token_path_provider.go @@ -5,8 +5,10 @@ package auth import ( "fmt" + "github.com/oracle/oci-go-sdk/v65/common" "io/ioutil" "net/http" + "time" ) const ( @@ -136,3 +138,83 @@ func getInstanceIDFromMetadata() (instanceID string, err error) { bodyString := string(bodyBytes) return bodyString, nil } + +// ServiceAccountTokenProvider comment +type ServiceAccountTokenProvider interface { + ServiceAccountToken() (string, error) +} + +// DefaultServiceAccountTokenProvider is supplied by user when instantiating +// OkeWorkloadIdentityConfigurationProvider +type DefaultServiceAccountTokenProvider struct { + tokenPath string `mandatory:"false"` +} + +// NewDefaultServiceAccountTokenProvider returns a new instance of defaultServiceAccountTokenProvider +func NewDefaultServiceAccountTokenProvider() DefaultServiceAccountTokenProvider { + return DefaultServiceAccountTokenProvider{ + tokenPath: KubernetesServiceAccountTokenPath, + } +} + +// WithSaTokenPath Builder method to override the to SA ken path +func (d DefaultServiceAccountTokenProvider) WithSaTokenPath(tokenPath string) DefaultServiceAccountTokenProvider { + d.tokenPath = tokenPath + return d +} + +// ServiceAccountToken returns a service account token +func (d DefaultServiceAccountTokenProvider) ServiceAccountToken() (string, error) { + saTokenString, err := ioutil.ReadFile(d.tokenPath) + if err != nil { + common.Logf("error %s", err) + return "", fmt.Errorf("error reading service account token: %s", err) + } + isSaTokenValid, err := isValidSaToken(string(saTokenString)) + if !isSaTokenValid { + common.Logf("error %s", err) + return "", fmt.Errorf("error validating service account token: %s", err) + } + return string(saTokenString), err +} + +// SuppliedServiceAccountTokenProvider is supplied by user when instantiating +// OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider +type SuppliedServiceAccountTokenProvider struct { + tokenString string `mandatory:"false"` +} + +// NewSuppliedServiceAccountTokenProvider returns a new instance of defaultServiceAccountTokenProvider +func NewSuppliedServiceAccountTokenProvider(tokenString string) SuppliedServiceAccountTokenProvider { + return SuppliedServiceAccountTokenProvider{tokenString: tokenString} +} + +// ServiceAccountToken returns a service account token +func (d SuppliedServiceAccountTokenProvider) ServiceAccountToken() (string, error) { + isSaTokenValid, err := isValidSaToken(d.tokenString) + if !isSaTokenValid { + common.Logf("error %s", err) + return "", fmt.Errorf("error validating service account token %s", err) + } + return d.tokenString, nil +} + +// isValidSaToken returns true is a saTokenString provides a valid service account token +func isValidSaToken(saTokenString string) (bool, error) { + var jwtToken *jwtToken + var err error + if jwtToken, err = parseJwt(saTokenString); err != nil { + return false, fmt.Errorf("failed to parse the default service token string \"%s\": %s", saTokenString, err.Error()) + } + now := time.Now().Unix() + int64(bufferTimeBeforeTokenExpiration.Seconds()) + if jwtToken.payload["exp"] == nil { + return false, fmt.Errorf("service token doesn't have an `exp` field") + } + expiredAt := int64(jwtToken.payload["exp"].(float64)) + expired := expiredAt <= now + if expired { + return false, fmt.Errorf("service token expired at: %v", time.Unix(expiredAt, 0).Format("15:04:05.000")) + } + + return true, nil +} diff --git a/common/auth/resource_principal_token_path_provider_test.go b/common/auth/resource_principal_token_path_provider_test.go new file mode 100644 index 0000000000..f89d9b1e3b --- /dev/null +++ b/common/auth/resource_principal_token_path_provider_test.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package auth + +import ( + "fmt" + "github.com/stretchr/testify/assert" + "log" + "os" + "strconv" + "testing" + "time" +) + +const testTokenPathPrefix = "/tmp/temp-test-golang-sdk-kubernetesio-sa-token-" + +func TestDefaultServiceAccountTokenProviderCanReadByPath(t *testing.T) { + var tokenPath = testTokenPathPrefix + uuid() + tokenString := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJrdWJlcm5ldGVzLmRlZmF1bHQiLCJleHAiOjQ4NDEwMTAwNTQsImlhdCI6MTY4NzQxMDA1NCwiaXNzIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Om15LW5hbWVzcGFjZTpteS1zYSIsInN1YiI6dHJ1ZX0.lOCsshvqcfX6I-FQcxAigrD7-KGhsKXuk97mmak5FFQ" + createSaToken(tokenPath, tokenString) + provider := NewDefaultServiceAccountTokenProvider().WithSaTokenPath(tokenPath) + fmt.Println(provider.tokenPath) + assert.NotNil(t, provider) + + _, err := provider.ServiceAccountToken() + assert.NoError(t, err) + deleteSaToken(tokenPath) +} + +func TestDefaultServiceAccountTokenProviderCanDetectWrongPath(t *testing.T) { + provider := NewDefaultServiceAccountTokenProvider().WithSaTokenPath("/wrong_path") + fmt.Println(provider.tokenPath) + assert.NotNil(t, provider) + + _, err := provider.ServiceAccountToken() + assert.Error(t, err) +} + +func TestDefaultServiceAccountTokenProviderCanDetectMalformedSaToken(t *testing.T) { + var tokenPath = testTokenPathPrefix + uuid() + createSaToken(tokenPath, "malformed string") + provider := NewDefaultServiceAccountTokenProvider().WithSaTokenPath(tokenPath) + fmt.Println(provider.tokenPath) + assert.NotNil(t, provider) + + _, err := provider.ServiceAccountToken() + assert.Error(t, err) + deleteSaToken(tokenPath) +} + +func TestDefaultServiceAccountTokenProviderCanDetectExpiredSaToken(t *testing.T) { + var tokenPath = testTokenPathPrefix + uuid() + tokenString := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJrdWJlcm5ldGVzLmRlZmF1bHQiLCJleHAiOjE2ODc0MDAwNTQsImlhdCI6MTY4NzQxMDA1NCwiaXNzIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Om15LW5hbWVzcGFjZTpteS1zYSIsInN1YiI6dHJ1ZX0.UpnEGk95K9TQaem9u-uz8-uMl3lF1Yd0rgHwT6p0A6w" + createSaToken(tokenPath, tokenString) + provider := NewDefaultServiceAccountTokenProvider().WithSaTokenPath(tokenPath) + fmt.Println(provider.tokenPath) + assert.NotNil(t, provider) + + _, err := provider.ServiceAccountToken() + assert.Error(t, err) + deleteSaToken(tokenPath) +} + +func TestSuppliedServiceAccountTokenProviderCanDetectExpiredSaToken(t *testing.T) { + tokenString := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJrdWJlcm5ldGVzLmRlZmF1bHQiLCJleHAiOjE2ODc0MDAwNTQsImlhdCI6MTY4NzQxMDA1NCwiaXNzIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Om15LW5hbWVzcGFjZTpteS1zYSIsInN1YiI6dHJ1ZX0.UpnEGk95K9TQaem9u-uz8-uMl3lF1Yd0rgHwT6p0A6w" + provider := NewSuppliedServiceAccountTokenProvider(tokenString) + assert.NotNil(t, provider) + _, err := provider.ServiceAccountToken() + assert.Error(t, err) +} + +func TestSuppliedServiceAccountTokenProviderCanDetectMalformedSaToken(t *testing.T) { + provider := NewSuppliedServiceAccountTokenProvider("malformed string") + assert.NotNil(t, provider) + _, err := provider.ServiceAccountToken() + assert.Error(t, err) +} + +func createSaToken(filePath string, content string) { + f, err := os.Create(filePath) + + if err != nil { + log.Fatal(err) + } + + defer f.Close() + + _, err2 := f.WriteString(content) + + if err2 != nil { + log.Fatal(err2) + } + + fmt.Println("SA Token created at " + filePath + "\n") +} + +func deleteSaToken(filePath string) { + e := os.Remove(filePath) + if e != nil { + log.Fatal(e) + } +} +func uuid() string { + ts := time.Now().Unix() + return strconv.FormatInt(ts, 10) +} diff --git a/common/regions.go b/common/regions.go index 49ab7ee9b0..9e2e86d3e4 100644 --- a/common/regions.go +++ b/common/regions.go @@ -108,6 +108,8 @@ const ( RegionEUDccDublin1 Region = "eu-dcc-dublin-1" //RegionEUMadrid2 region Madrid RegionEUMadrid2 Region = "eu-madrid-2" + //RegionEUFrankfurt2 region Frankfurt + RegionEUFrankfurt2 Region = "eu-frankfurt-2" //RegionEUJovanovac1 region Jovanovac RegionEUJovanovac1 Region = "eu-jovanovac-1" ) @@ -165,6 +167,7 @@ var shortNameRegion = map[string]Region{ "dus": RegionEUDccRating1, "ork": RegionEUDccDublin1, "vll": RegionEUMadrid2, + "str": RegionEUFrankfurt2, "beg": RegionEUJovanovac1, } @@ -241,7 +244,8 @@ var regionRealm = map[Region]string{ RegionEUDccRating1: "oc14", RegionEUDccDublin1: "oc14", - RegionEUMadrid2: "oc19", + RegionEUMadrid2: "oc19", + RegionEUFrankfurt2: "oc19", RegionEUJovanovac1: "oc20", } diff --git a/common/regions.json b/common/regions.json index c9549a0979..2f71c731b1 100644 --- a/common/regions.json +++ b/common/regions.json @@ -316,5 +316,11 @@ "realmKey": "oc19", "regionIdentifier": "eu-madrid-2", "realmDomainComponent": "oraclecloud.eu" + }, + { + "regionKey": "str", + "realmKey": "oc19", + "regionIdentifier": "eu-frankfurt-2", + "realmDomainComponent": "oraclecloud.eu" } ] \ No newline at end of file diff --git a/common/version.go b/common/version.go index f03d285788..7f48cda478 100644 --- a/common/version.go +++ b/common/version.go @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "41" - patch = "1" + minor = "42" + patch = "0" tag = "" ) diff --git a/database/backup.go b/database/backup.go index 9a691b5269..bd7ee4fc71 100644 --- a/database/backup.go +++ b/database/backup.go @@ -68,6 +68,12 @@ type Backup struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure vault (https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm#concepts). VaultId *string `mandatory:"false" json:"vaultId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the key store. + KeyStoreId *string `mandatory:"false" json:"keyStoreId"` + + // The wallet name for Oracle Key Vault. + KeyStoreWalletName *string `mandatory:"false" json:"keyStoreWalletName"` } func (m Backup) String() string { diff --git a/database/backup_summary.go b/database/backup_summary.go index 12937d8753..bc2410251a 100644 --- a/database/backup_summary.go +++ b/database/backup_summary.go @@ -70,6 +70,12 @@ type BackupSummary struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure vault (https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm#concepts). VaultId *string `mandatory:"false" json:"vaultId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the key store. + KeyStoreId *string `mandatory:"false" json:"keyStoreId"` + + // The wallet name for Oracle Key Vault. + KeyStoreWalletName *string `mandatory:"false" json:"keyStoreWalletName"` } func (m BackupSummary) String() string { diff --git a/database/change_key_store_type_details.go b/database/change_key_store_type_details.go new file mode 100644 index 0000000000..7d12824477 --- /dev/null +++ b/database/change_key_store_type_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeKeyStoreTypeDetails Request details to change the source of the encryption key for the database. +type ChangeKeyStoreTypeDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the key store. + KeyStoreId *string `mandatory:"true" json:"keyStoreId"` +} + +func (m ChangeKeyStoreTypeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeKeyStoreTypeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/change_key_store_type_request_response.go b/database/change_key_store_type_request_response.go new file mode 100644 index 0000000000..35e3957bfc --- /dev/null +++ b/database/change_key_store_type_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeKeyStoreTypeRequest wrapper for the ChangeKeyStoreType operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ChangeKeyStoreType.go.html to see an example of how to use ChangeKeyStoreTypeRequest. +type ChangeKeyStoreTypeRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` + + // Request to change the source of the encryption key for the database. + ChangeKeyStoreTypeDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeKeyStoreTypeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeKeyStoreTypeRequest) 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 ChangeKeyStoreTypeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeKeyStoreTypeRequest) 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 ChangeKeyStoreTypeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeKeyStoreTypeResponse wrapper for the ChangeKeyStoreType operation +type ChangeKeyStoreTypeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeKeyStoreTypeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeKeyStoreTypeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/database.go b/database/database.go index 77dab82504..6ccfec201b 100644 --- a/database/database.go +++ b/database/database.go @@ -107,6 +107,12 @@ type Database struct { // Specifies a prefix for the `Oracle SID` of the database to be created. SidPrefix *string `mandatory:"false" json:"sidPrefix"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the key store. + KeyStoreId *string `mandatory:"false" json:"keyStoreId"` + + // The wallet name for Oracle Key Vault. + KeyStoreWalletName *string `mandatory:"false" json:"keyStoreWalletName"` } func (m Database) String() string { diff --git a/database/database_client.go b/database/database_client.go index 42a9ab769a..7d7041bd31 100644 --- a/database/database_client.go +++ b/database/database_client.go @@ -1596,6 +1596,68 @@ func (client DatabaseClient) changeKeyStoreCompartment(ctx context.Context, requ return response, err } +// ChangeKeyStoreType Changes encryption key management type +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ChangeKeyStoreType.go.html to see an example of how to use ChangeKeyStoreType API. +func (client DatabaseClient) ChangeKeyStoreType(ctx context.Context, request ChangeKeyStoreTypeRequest) (response ChangeKeyStoreTypeResponse, 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.changeKeyStoreType, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeKeyStoreTypeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeKeyStoreTypeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeKeyStoreTypeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeKeyStoreTypeResponse") + } + return +} + +// changeKeyStoreType implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) changeKeyStoreType(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/actions/changeKeyStoreType", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeKeyStoreTypeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/Database/ChangeKeyStoreType" + err = common.PostProcessServiceError(err, "Database", "ChangeKeyStoreType", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeOneoffPatchCompartment Move the one-off patch to the specified compartment. // // See also @@ -15351,6 +15413,68 @@ func (client DatabaseClient) rotateOrdsCerts(ctx context.Context, request common return response, err } +// RotatePluggableDatabaseEncryptionKey Create a new version of the existing encryption key. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/RotatePluggableDatabaseEncryptionKey.go.html to see an example of how to use RotatePluggableDatabaseEncryptionKey API. +func (client DatabaseClient) RotatePluggableDatabaseEncryptionKey(ctx context.Context, request RotatePluggableDatabaseEncryptionKeyRequest) (response RotatePluggableDatabaseEncryptionKeyResponse, 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.rotatePluggableDatabaseEncryptionKey, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RotatePluggableDatabaseEncryptionKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RotatePluggableDatabaseEncryptionKeyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RotatePluggableDatabaseEncryptionKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RotatePluggableDatabaseEncryptionKeyResponse") + } + return +} + +// rotatePluggableDatabaseEncryptionKey implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) rotatePluggableDatabaseEncryptionKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/pluggableDatabases/{pluggableDatabaseId}/actions/rotateKey", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RotatePluggableDatabaseEncryptionKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/PluggableDatabase/RotatePluggableDatabaseEncryptionKey" + err = common.PostProcessServiceError(err, "Database", "RotatePluggableDatabaseEncryptionKey", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // RotateSslCerts **Deprecated.** Use the RotateCloudAutonomousVmClusterSslCerts to rotate SSL certs for an Autonomous Exadata VM cluster instead. // // See also diff --git a/database/database_summary.go b/database/database_summary.go index c7a3d43130..0fc8a5fcdc 100644 --- a/database/database_summary.go +++ b/database/database_summary.go @@ -109,6 +109,12 @@ type DatabaseSummary struct { // Specifies a prefix for the `Oracle SID` of the database to be created. SidPrefix *string `mandatory:"false" json:"sidPrefix"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the key store. + KeyStoreId *string `mandatory:"false" json:"keyStoreId"` + + // The wallet name for Oracle Key Vault. + KeyStoreWalletName *string `mandatory:"false" json:"keyStoreWalletName"` } func (m DatabaseSummary) String() string { diff --git a/database/db_system_shape_summary.go b/database/db_system_shape_summary.go index 6b69ecd811..58f8f78a98 100644 --- a/database/db_system_shape_summary.go +++ b/database/db_system_shape_summary.go @@ -30,7 +30,7 @@ type DbSystemShapeSummary struct { // The family of the shape used for the DB system. ShapeFamily *string `mandatory:"false" json:"shapeFamily"` - // The shape type for the virtual machine DB system. Shape type is determined by CPU hardware. Valid values are `AMD` , `INTEL` or `INTEL_FLEX_X9`. + // The shape type for the virtual machine DB system. Shape type is determined by CPU hardware. Valid values are `AMD` , `INTEL`, `INTEL_FLEX_X9` or `AMPERE_FLEX_A1`. ShapeType DbSystemShapeSummaryShapeTypeEnum `mandatory:"false" json:"shapeType,omitempty"` // Deprecated. Use `name` instead of `shape`. @@ -112,21 +112,24 @@ type DbSystemShapeSummaryShapeTypeEnum string // Set of constants representing the allowable values for DbSystemShapeSummaryShapeTypeEnum const ( - DbSystemShapeSummaryShapeTypeAmd DbSystemShapeSummaryShapeTypeEnum = "AMD" - DbSystemShapeSummaryShapeTypeIntel DbSystemShapeSummaryShapeTypeEnum = "INTEL" - DbSystemShapeSummaryShapeTypeIntelFlexX9 DbSystemShapeSummaryShapeTypeEnum = "INTEL_FLEX_X9" + DbSystemShapeSummaryShapeTypeAmd DbSystemShapeSummaryShapeTypeEnum = "AMD" + DbSystemShapeSummaryShapeTypeIntel DbSystemShapeSummaryShapeTypeEnum = "INTEL" + DbSystemShapeSummaryShapeTypeIntelFlexX9 DbSystemShapeSummaryShapeTypeEnum = "INTEL_FLEX_X9" + DbSystemShapeSummaryShapeTypeAmpereFlexA1 DbSystemShapeSummaryShapeTypeEnum = "AMPERE_FLEX_A1" ) var mappingDbSystemShapeSummaryShapeTypeEnum = map[string]DbSystemShapeSummaryShapeTypeEnum{ - "AMD": DbSystemShapeSummaryShapeTypeAmd, - "INTEL": DbSystemShapeSummaryShapeTypeIntel, - "INTEL_FLEX_X9": DbSystemShapeSummaryShapeTypeIntelFlexX9, + "AMD": DbSystemShapeSummaryShapeTypeAmd, + "INTEL": DbSystemShapeSummaryShapeTypeIntel, + "INTEL_FLEX_X9": DbSystemShapeSummaryShapeTypeIntelFlexX9, + "AMPERE_FLEX_A1": DbSystemShapeSummaryShapeTypeAmpereFlexA1, } var mappingDbSystemShapeSummaryShapeTypeEnumLowerCase = map[string]DbSystemShapeSummaryShapeTypeEnum{ - "amd": DbSystemShapeSummaryShapeTypeAmd, - "intel": DbSystemShapeSummaryShapeTypeIntel, - "intel_flex_x9": DbSystemShapeSummaryShapeTypeIntelFlexX9, + "amd": DbSystemShapeSummaryShapeTypeAmd, + "intel": DbSystemShapeSummaryShapeTypeIntel, + "intel_flex_x9": DbSystemShapeSummaryShapeTypeIntelFlexX9, + "ampere_flex_a1": DbSystemShapeSummaryShapeTypeAmpereFlexA1, } // GetDbSystemShapeSummaryShapeTypeEnumValues Enumerates the set of values for DbSystemShapeSummaryShapeTypeEnum @@ -144,6 +147,7 @@ func GetDbSystemShapeSummaryShapeTypeEnumStringValues() []string { "AMD", "INTEL", "INTEL_FLEX_X9", + "AMPERE_FLEX_A1", } } diff --git a/database/db_system_storage_performance_summary.go b/database/db_system_storage_performance_summary.go index 2601a4f58a..b9bb5f50fb 100644 --- a/database/db_system_storage_performance_summary.go +++ b/database/db_system_storage_performance_summary.go @@ -18,7 +18,7 @@ import ( // DbSystemStoragePerformanceSummary Representation of storage performance summary per shapeType . type DbSystemStoragePerformanceSummary struct { - // ShapeType of the DbSystems INTEL , AMD or INTEL_FLEX_X9 + // ShapeType of the DbSystems INTEL , AMD, INTEL_FLEX_X9 or AMPERE_FLEX_A1 ShapeType DbSystemStoragePerformanceSummaryShapeTypeEnum `mandatory:"true" json:"shapeType"` // List of storage performance for the DATA disks @@ -52,21 +52,24 @@ type DbSystemStoragePerformanceSummaryShapeTypeEnum string // Set of constants representing the allowable values for DbSystemStoragePerformanceSummaryShapeTypeEnum const ( - DbSystemStoragePerformanceSummaryShapeTypeAmd DbSystemStoragePerformanceSummaryShapeTypeEnum = "AMD" - DbSystemStoragePerformanceSummaryShapeTypeIntel DbSystemStoragePerformanceSummaryShapeTypeEnum = "INTEL" - DbSystemStoragePerformanceSummaryShapeTypeIntelFlexX9 DbSystemStoragePerformanceSummaryShapeTypeEnum = "INTEL_FLEX_X9" + DbSystemStoragePerformanceSummaryShapeTypeAmd DbSystemStoragePerformanceSummaryShapeTypeEnum = "AMD" + DbSystemStoragePerformanceSummaryShapeTypeIntel DbSystemStoragePerformanceSummaryShapeTypeEnum = "INTEL" + DbSystemStoragePerformanceSummaryShapeTypeIntelFlexX9 DbSystemStoragePerformanceSummaryShapeTypeEnum = "INTEL_FLEX_X9" + DbSystemStoragePerformanceSummaryShapeTypeAmpereFlexA1 DbSystemStoragePerformanceSummaryShapeTypeEnum = "AMPERE_FLEX_A1" ) var mappingDbSystemStoragePerformanceSummaryShapeTypeEnum = map[string]DbSystemStoragePerformanceSummaryShapeTypeEnum{ - "AMD": DbSystemStoragePerformanceSummaryShapeTypeAmd, - "INTEL": DbSystemStoragePerformanceSummaryShapeTypeIntel, - "INTEL_FLEX_X9": DbSystemStoragePerformanceSummaryShapeTypeIntelFlexX9, + "AMD": DbSystemStoragePerformanceSummaryShapeTypeAmd, + "INTEL": DbSystemStoragePerformanceSummaryShapeTypeIntel, + "INTEL_FLEX_X9": DbSystemStoragePerformanceSummaryShapeTypeIntelFlexX9, + "AMPERE_FLEX_A1": DbSystemStoragePerformanceSummaryShapeTypeAmpereFlexA1, } var mappingDbSystemStoragePerformanceSummaryShapeTypeEnumLowerCase = map[string]DbSystemStoragePerformanceSummaryShapeTypeEnum{ - "amd": DbSystemStoragePerformanceSummaryShapeTypeAmd, - "intel": DbSystemStoragePerformanceSummaryShapeTypeIntel, - "intel_flex_x9": DbSystemStoragePerformanceSummaryShapeTypeIntelFlexX9, + "amd": DbSystemStoragePerformanceSummaryShapeTypeAmd, + "intel": DbSystemStoragePerformanceSummaryShapeTypeIntel, + "intel_flex_x9": DbSystemStoragePerformanceSummaryShapeTypeIntelFlexX9, + "ampere_flex_a1": DbSystemStoragePerformanceSummaryShapeTypeAmpereFlexA1, } // GetDbSystemStoragePerformanceSummaryShapeTypeEnumValues Enumerates the set of values for DbSystemStoragePerformanceSummaryShapeTypeEnum @@ -84,6 +87,7 @@ func GetDbSystemStoragePerformanceSummaryShapeTypeEnumStringValues() []string { "AMD", "INTEL", "INTEL_FLEX_X9", + "AMPERE_FLEX_A1", } } diff --git a/database/rotate_pluggable_database_encryption_key_request_response.go b/database/rotate_pluggable_database_encryption_key_request_response.go new file mode 100644 index 0000000000..98fd560b05 --- /dev/null +++ b/database/rotate_pluggable_database_encryption_key_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RotatePluggableDatabaseEncryptionKeyRequest wrapper for the RotatePluggableDatabaseEncryptionKey operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/RotatePluggableDatabaseEncryptionKey.go.html to see an example of how to use RotatePluggableDatabaseEncryptionKeyRequest. +type RotatePluggableDatabaseEncryptionKeyRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + PluggableDatabaseId *string `mandatory:"true" contributesTo:"path" name:"pluggableDatabaseId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RotatePluggableDatabaseEncryptionKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RotatePluggableDatabaseEncryptionKeyRequest) 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 RotatePluggableDatabaseEncryptionKeyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RotatePluggableDatabaseEncryptionKeyRequest) 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 RotatePluggableDatabaseEncryptionKeyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RotatePluggableDatabaseEncryptionKeyResponse wrapper for the RotatePluggableDatabaseEncryptionKey operation +type RotatePluggableDatabaseEncryptionKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RotatePluggableDatabaseEncryptionKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RotatePluggableDatabaseEncryptionKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/associated_service_details.go b/databasemanagement/associated_service_details.go new file mode 100644 index 0000000000..86859828c0 --- /dev/null +++ b/databasemanagement/associated_service_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AssociatedServiceDetails The details of the associated service that will be enabled or disabled for an external DB System. +type AssociatedServiceDetails struct { + + // The status of the associated service. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The associated service-specific inputs in JSON string format, which Database Management can identify. + Metadata *string `mandatory:"false" json:"metadata"` +} + +func (m AssociatedServiceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AssociatedServiceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/automatic_capture_filter.go b/databasemanagement/automatic_capture_filter.go new file mode 100644 index 0000000000..7296f1e602 --- /dev/null +++ b/databasemanagement/automatic_capture_filter.go @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutomaticCaptureFilter An automatic capture filter that enables you to capture only those SQL statements +// that you want, and exclude noncritical statements. +type AutomaticCaptureFilter struct { + + // The name of the automatic capture filter. + // - AUTO_CAPTURE_SQL_TEXT: Search pattern to apply to SQL text. + // - AUTO_CAPTURE_PARSING_SCHEMA_NAME: Parsing schema to include or exclude for SQL plan management auto capture. + // - AUTO_CAPTURE_MODULE: Module to include or exclude for SQL plan management auto capture. + // - AUTO_CAPTURE_ACTION: Action to include or exclude for SQL plan management automatic capture. + Name AutomaticCaptureFilterNameEnum `mandatory:"false" json:"name,omitempty"` + + // A list of filter values to include. + ValuesToInclude []string `mandatory:"false" json:"valuesToInclude"` + + // A list of filter values to exclude. + ValuesToExclude []string `mandatory:"false" json:"valuesToExclude"` + + // The time the filter value was last updated. + TimeLastModified *common.SDKTime `mandatory:"false" json:"timeLastModified"` + + // The database user who last updated the filter value. + ModifiedBy *string `mandatory:"false" json:"modifiedBy"` +} + +func (m AutomaticCaptureFilter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AutomaticCaptureFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAutomaticCaptureFilterNameEnum(string(m.Name)); !ok && m.Name != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Name: %s. Supported values are: %s.", m.Name, strings.Join(GetAutomaticCaptureFilterNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AutomaticCaptureFilterNameEnum Enum with underlying type: string +type AutomaticCaptureFilterNameEnum string + +// Set of constants representing the allowable values for AutomaticCaptureFilterNameEnum +const ( + AutomaticCaptureFilterNameSqlText AutomaticCaptureFilterNameEnum = "AUTO_CAPTURE_SQL_TEXT" + AutomaticCaptureFilterNameParsingSchemaName AutomaticCaptureFilterNameEnum = "AUTO_CAPTURE_PARSING_SCHEMA_NAME" + AutomaticCaptureFilterNameModule AutomaticCaptureFilterNameEnum = "AUTO_CAPTURE_MODULE" + AutomaticCaptureFilterNameAction AutomaticCaptureFilterNameEnum = "AUTO_CAPTURE_ACTION" +) + +var mappingAutomaticCaptureFilterNameEnum = map[string]AutomaticCaptureFilterNameEnum{ + "AUTO_CAPTURE_SQL_TEXT": AutomaticCaptureFilterNameSqlText, + "AUTO_CAPTURE_PARSING_SCHEMA_NAME": AutomaticCaptureFilterNameParsingSchemaName, + "AUTO_CAPTURE_MODULE": AutomaticCaptureFilterNameModule, + "AUTO_CAPTURE_ACTION": AutomaticCaptureFilterNameAction, +} + +var mappingAutomaticCaptureFilterNameEnumLowerCase = map[string]AutomaticCaptureFilterNameEnum{ + "auto_capture_sql_text": AutomaticCaptureFilterNameSqlText, + "auto_capture_parsing_schema_name": AutomaticCaptureFilterNameParsingSchemaName, + "auto_capture_module": AutomaticCaptureFilterNameModule, + "auto_capture_action": AutomaticCaptureFilterNameAction, +} + +// GetAutomaticCaptureFilterNameEnumValues Enumerates the set of values for AutomaticCaptureFilterNameEnum +func GetAutomaticCaptureFilterNameEnumValues() []AutomaticCaptureFilterNameEnum { + values := make([]AutomaticCaptureFilterNameEnum, 0) + for _, v := range mappingAutomaticCaptureFilterNameEnum { + values = append(values, v) + } + return values +} + +// GetAutomaticCaptureFilterNameEnumStringValues Enumerates the set of values in String for AutomaticCaptureFilterNameEnum +func GetAutomaticCaptureFilterNameEnumStringValues() []string { + return []string{ + "AUTO_CAPTURE_SQL_TEXT", + "AUTO_CAPTURE_PARSING_SCHEMA_NAME", + "AUTO_CAPTURE_MODULE", + "AUTO_CAPTURE_ACTION", + } +} + +// GetMappingAutomaticCaptureFilterNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAutomaticCaptureFilterNameEnum(val string) (AutomaticCaptureFilterNameEnum, bool) { + enum, ok := mappingAutomaticCaptureFilterNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/automatic_capture_filter_details.go b/databasemanagement/automatic_capture_filter_details.go new file mode 100644 index 0000000000..6ad4cbb77b --- /dev/null +++ b/databasemanagement/automatic_capture_filter_details.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutomaticCaptureFilterDetails The details of a capture filter used to include or exclude SQL statements +// in the initial automatic plan capture. +type AutomaticCaptureFilterDetails struct { + + // The name of the automatic capture filter. + // - AUTO_CAPTURE_SQL_TEXT: Search pattern to apply to SQL text. + // - AUTO_CAPTURE_PARSING_SCHEMA_NAME: Parsing schema to include or exclude for SQL plan management auto capture. + // - AUTO_CAPTURE_MODULE: Module to include or exclude for SQL plan management auto capture. + // - AUTO_CAPTURE_ACTION: Action to include or exclude for SQL plan management automatic capture. + Name AutomaticCaptureFilterDetailsNameEnum `mandatory:"true" json:"name"` + + // A list of filter values to include. + ValuesToInclude []string `mandatory:"false" json:"valuesToInclude"` + + // A list of filter values to exclude. + ValuesToExclude []string `mandatory:"false" json:"valuesToExclude"` +} + +func (m AutomaticCaptureFilterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AutomaticCaptureFilterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAutomaticCaptureFilterDetailsNameEnum(string(m.Name)); !ok && m.Name != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Name: %s. Supported values are: %s.", m.Name, strings.Join(GetAutomaticCaptureFilterDetailsNameEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AutomaticCaptureFilterDetailsNameEnum Enum with underlying type: string +type AutomaticCaptureFilterDetailsNameEnum string + +// Set of constants representing the allowable values for AutomaticCaptureFilterDetailsNameEnum +const ( + AutomaticCaptureFilterDetailsNameSqlText AutomaticCaptureFilterDetailsNameEnum = "AUTO_CAPTURE_SQL_TEXT" + AutomaticCaptureFilterDetailsNameParsingSchemaName AutomaticCaptureFilterDetailsNameEnum = "AUTO_CAPTURE_PARSING_SCHEMA_NAME" + AutomaticCaptureFilterDetailsNameModule AutomaticCaptureFilterDetailsNameEnum = "AUTO_CAPTURE_MODULE" + AutomaticCaptureFilterDetailsNameAction AutomaticCaptureFilterDetailsNameEnum = "AUTO_CAPTURE_ACTION" +) + +var mappingAutomaticCaptureFilterDetailsNameEnum = map[string]AutomaticCaptureFilterDetailsNameEnum{ + "AUTO_CAPTURE_SQL_TEXT": AutomaticCaptureFilterDetailsNameSqlText, + "AUTO_CAPTURE_PARSING_SCHEMA_NAME": AutomaticCaptureFilterDetailsNameParsingSchemaName, + "AUTO_CAPTURE_MODULE": AutomaticCaptureFilterDetailsNameModule, + "AUTO_CAPTURE_ACTION": AutomaticCaptureFilterDetailsNameAction, +} + +var mappingAutomaticCaptureFilterDetailsNameEnumLowerCase = map[string]AutomaticCaptureFilterDetailsNameEnum{ + "auto_capture_sql_text": AutomaticCaptureFilterDetailsNameSqlText, + "auto_capture_parsing_schema_name": AutomaticCaptureFilterDetailsNameParsingSchemaName, + "auto_capture_module": AutomaticCaptureFilterDetailsNameModule, + "auto_capture_action": AutomaticCaptureFilterDetailsNameAction, +} + +// GetAutomaticCaptureFilterDetailsNameEnumValues Enumerates the set of values for AutomaticCaptureFilterDetailsNameEnum +func GetAutomaticCaptureFilterDetailsNameEnumValues() []AutomaticCaptureFilterDetailsNameEnum { + values := make([]AutomaticCaptureFilterDetailsNameEnum, 0) + for _, v := range mappingAutomaticCaptureFilterDetailsNameEnum { + values = append(values, v) + } + return values +} + +// GetAutomaticCaptureFilterDetailsNameEnumStringValues Enumerates the set of values in String for AutomaticCaptureFilterDetailsNameEnum +func GetAutomaticCaptureFilterDetailsNameEnumStringValues() []string { + return []string{ + "AUTO_CAPTURE_SQL_TEXT", + "AUTO_CAPTURE_PARSING_SCHEMA_NAME", + "AUTO_CAPTURE_MODULE", + "AUTO_CAPTURE_ACTION", + } +} + +// GetMappingAutomaticCaptureFilterDetailsNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAutomaticCaptureFilterDetailsNameEnum(val string) (AutomaticCaptureFilterDetailsNameEnum, bool) { + enum, ok := mappingAutomaticCaptureFilterDetailsNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/change_external_exadata_infrastructure_compartment_details.go b/databasemanagement/change_external_exadata_infrastructure_compartment_details.go index 136ae68829..2be1555dd2 100644 --- a/databasemanagement/change_external_exadata_infrastructure_compartment_details.go +++ b/databasemanagement/change_external_exadata_infrastructure_compartment_details.go @@ -17,7 +17,7 @@ import ( "strings" ) -// ChangeExternalExadataInfrastructureCompartmentDetails The details required to change the compartment of an Exadata infrastructure. +// ChangeExternalExadataInfrastructureCompartmentDetails The details required to change the compartment of the Exadata infrastructure. type ChangeExternalExadataInfrastructureCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the diff --git a/databasemanagement/change_external_exadata_infrastructure_compartment_request_response.go b/databasemanagement/change_external_exadata_infrastructure_compartment_request_response.go index 7cbdcdd64a..904ef0a7f7 100644 --- a/databasemanagement/change_external_exadata_infrastructure_compartment_request_response.go +++ b/databasemanagement/change_external_exadata_infrastructure_compartment_request_response.go @@ -21,7 +21,7 @@ type ChangeExternalExadataInfrastructureCompartmentRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. ExternalExadataInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"externalExadataInfrastructureId"` - // The details required to change the compartment for the Exadata infrastructure. + // The details required to move the Exadata infrastructure from one compartment to another. ChangeExternalExadataInfrastructureCompartmentDetails `contributesTo:"body"` // The client request ID for tracing. diff --git a/databasemanagement/change_plan_retention_details.go b/databasemanagement/change_plan_retention_details.go new file mode 100644 index 0000000000..a3ee997834 --- /dev/null +++ b/databasemanagement/change_plan_retention_details.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangePlanRetentionDetails The details required to change the plan retention period. +type ChangePlanRetentionDetails struct { + + // The retention period in weeks. It can range between 5 and 523 weeks. + RetentionWeeks *int `mandatory:"true" json:"retentionWeeks"` + + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m ChangePlanRetentionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangePlanRetentionDetails) 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 *ChangePlanRetentionDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + RetentionWeeks *int `json:"retentionWeeks"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.RetentionWeeks = model.RetentionWeeks + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/change_plan_retention_request_response.go b/databasemanagement/change_plan_retention_request_response.go new file mode 100644 index 0000000000..c8c5af6100 --- /dev/null +++ b/databasemanagement/change_plan_retention_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangePlanRetentionRequest wrapper for the ChangePlanRetention operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ChangePlanRetention.go.html to see an example of how to use ChangePlanRetentionRequest. +type ChangePlanRetentionRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to change the plan retention period. + ChangePlanRetentionDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangePlanRetentionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangePlanRetentionRequest) 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 ChangePlanRetentionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangePlanRetentionRequest) 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 ChangePlanRetentionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangePlanRetentionResponse wrapper for the ChangePlanRetention operation +type ChangePlanRetentionResponse 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 ChangePlanRetentionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangePlanRetentionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/change_space_budget_details.go b/databasemanagement/change_space_budget_details.go new file mode 100644 index 0000000000..3d073d2431 --- /dev/null +++ b/databasemanagement/change_space_budget_details.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeSpaceBudgetDetails The details required to change the disk space limit for the SQL Management Base. +type ChangeSpaceBudgetDetails struct { + + // The maximum percent of `SYSAUX` space that the SQL Management Base can use. + SpaceBudgetPercent *float64 `mandatory:"true" json:"spaceBudgetPercent"` + + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m ChangeSpaceBudgetDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeSpaceBudgetDetails) 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 *ChangeSpaceBudgetDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + SpaceBudgetPercent *float64 `json:"spaceBudgetPercent"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.SpaceBudgetPercent = model.SpaceBudgetPercent + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/change_space_budget_request_response.go b/databasemanagement/change_space_budget_request_response.go new file mode 100644 index 0000000000..1999ccdb77 --- /dev/null +++ b/databasemanagement/change_space_budget_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeSpaceBudgetRequest wrapper for the ChangeSpaceBudget operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ChangeSpaceBudget.go.html to see an example of how to use ChangeSpaceBudgetRequest. +type ChangeSpaceBudgetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to change the disk space limit for the SQL Management Base. + ChangeSpaceBudgetDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeSpaceBudgetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeSpaceBudgetRequest) 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 ChangeSpaceBudgetRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeSpaceBudgetRequest) 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 ChangeSpaceBudgetRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeSpaceBudgetResponse wrapper for the ChangeSpaceBudget operation +type ChangeSpaceBudgetResponse 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 ChangeSpaceBudgetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeSpaceBudgetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/change_sql_plan_baselines_attributes_details.go b/databasemanagement/change_sql_plan_baselines_attributes_details.go new file mode 100644 index 0000000000..3390880fc5 --- /dev/null +++ b/databasemanagement/change_sql_plan_baselines_attributes_details.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeSqlPlanBaselinesAttributesDetails The details required to change SQL plan baseline attributes. +type ChangeSqlPlanBaselinesAttributesDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` + + // The SQL statement handle. It identifies plans associated with a SQL statement + // for attribute changes. If `null` then `planName` must be specified. + SqlHandle *string `mandatory:"false" json:"sqlHandle"` + + // Then plan name. It identifies a specific plan. If `null' then all plans associated + // with a SQL statement identified by `sqlHandle' are considered for attribute changes. + PlanName *string `mandatory:"false" json:"planName"` + + // Indicates whether the plan is available for use by the optimizer. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Indicates whether the plan baseline is fixed. A fixed plan takes precedence over a non-fixed plan. + IsFixed *bool `mandatory:"false" json:"isFixed"` + + // Indicates whether the plan is purged if it is not used for a time period. + IsAutoPurged *bool `mandatory:"false" json:"isAutoPurged"` +} + +func (m ChangeSqlPlanBaselinesAttributesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeSqlPlanBaselinesAttributesDetails) 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 *ChangeSqlPlanBaselinesAttributesDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + SqlHandle *string `json:"sqlHandle"` + PlanName *string `json:"planName"` + IsEnabled *bool `json:"isEnabled"` + IsFixed *bool `json:"isFixed"` + IsAutoPurged *bool `json:"isAutoPurged"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.SqlHandle = model.SqlHandle + + m.PlanName = model.PlanName + + m.IsEnabled = model.IsEnabled + + m.IsFixed = model.IsFixed + + m.IsAutoPurged = model.IsAutoPurged + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/change_sql_plan_baselines_attributes_request_response.go b/databasemanagement/change_sql_plan_baselines_attributes_request_response.go new file mode 100644 index 0000000000..6cd80859fb --- /dev/null +++ b/databasemanagement/change_sql_plan_baselines_attributes_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeSqlPlanBaselinesAttributesRequest wrapper for the ChangeSqlPlanBaselinesAttributes operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ChangeSqlPlanBaselinesAttributes.go.html to see an example of how to use ChangeSqlPlanBaselinesAttributesRequest. +type ChangeSqlPlanBaselinesAttributesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to change SQL plan baseline attributes. + ChangeSqlPlanBaselinesAttributesDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeSqlPlanBaselinesAttributesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeSqlPlanBaselinesAttributesRequest) 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 ChangeSqlPlanBaselinesAttributesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeSqlPlanBaselinesAttributesRequest) 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 ChangeSqlPlanBaselinesAttributesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeSqlPlanBaselinesAttributesResponse wrapper for the ChangeSqlPlanBaselinesAttributes operation +type ChangeSqlPlanBaselinesAttributesResponse 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 ChangeSqlPlanBaselinesAttributesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeSqlPlanBaselinesAttributesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/configure_automatic_capture_filters_details.go b/databasemanagement/configure_automatic_capture_filters_details.go new file mode 100644 index 0000000000..adbbd0aa0b --- /dev/null +++ b/databasemanagement/configure_automatic_capture_filters_details.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConfigureAutomaticCaptureFiltersDetails The details required to configure automatic capture filters. +type ConfigureAutomaticCaptureFiltersDetails struct { + + // The filters used in automatic initial plan capture. + AutoCaptureFilters []AutomaticCaptureFilterDetails `mandatory:"true" json:"autoCaptureFilters"` + + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m ConfigureAutomaticCaptureFiltersDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ConfigureAutomaticCaptureFiltersDetails) 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 *ConfigureAutomaticCaptureFiltersDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + AutoCaptureFilters []AutomaticCaptureFilterDetails `json:"autoCaptureFilters"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.AutoCaptureFilters = make([]AutomaticCaptureFilterDetails, len(model.AutoCaptureFilters)) + for i, n := range model.AutoCaptureFilters { + m.AutoCaptureFilters[i] = n + } + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/configure_automatic_capture_filters_request_response.go b/databasemanagement/configure_automatic_capture_filters_request_response.go new file mode 100644 index 0000000000..db5fb416c7 --- /dev/null +++ b/databasemanagement/configure_automatic_capture_filters_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ConfigureAutomaticCaptureFiltersRequest wrapper for the ConfigureAutomaticCaptureFilters operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ConfigureAutomaticCaptureFilters.go.html to see an example of how to use ConfigureAutomaticCaptureFiltersRequest. +type ConfigureAutomaticCaptureFiltersRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to configure automatic capture filters. + ConfigureAutomaticCaptureFiltersDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ConfigureAutomaticCaptureFiltersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ConfigureAutomaticCaptureFiltersRequest) 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 ConfigureAutomaticCaptureFiltersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConfigureAutomaticCaptureFiltersRequest) 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 ConfigureAutomaticCaptureFiltersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConfigureAutomaticCaptureFiltersResponse wrapper for the ConfigureAutomaticCaptureFilters operation +type ConfigureAutomaticCaptureFiltersResponse 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 ConfigureAutomaticCaptureFiltersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ConfigureAutomaticCaptureFiltersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/configure_automatic_spm_evolve_advisor_task_details.go b/databasemanagement/configure_automatic_spm_evolve_advisor_task_details.go new file mode 100644 index 0000000000..6bb9331351 --- /dev/null +++ b/databasemanagement/configure_automatic_spm_evolve_advisor_task_details.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConfigureAutomaticSpmEvolveAdvisorTaskDetails The configuration details of the Automatic SPM Evolve Advisor task. +type ConfigureAutomaticSpmEvolveAdvisorTaskDetails struct { + TaskParameters *SpmEvolveTaskParameters `mandatory:"true" json:"taskParameters"` + + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m ConfigureAutomaticSpmEvolveAdvisorTaskDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ConfigureAutomaticSpmEvolveAdvisorTaskDetails) 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 *ConfigureAutomaticSpmEvolveAdvisorTaskDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + TaskParameters *SpmEvolveTaskParameters `json:"taskParameters"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.TaskParameters = model.TaskParameters + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/configure_automatic_spm_evolve_advisor_task_request_response.go b/databasemanagement/configure_automatic_spm_evolve_advisor_task_request_response.go new file mode 100644 index 0000000000..2860177234 --- /dev/null +++ b/databasemanagement/configure_automatic_spm_evolve_advisor_task_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ConfigureAutomaticSpmEvolveAdvisorTaskRequest wrapper for the ConfigureAutomaticSpmEvolveAdvisorTask operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ConfigureAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use ConfigureAutomaticSpmEvolveAdvisorTaskRequest. +type ConfigureAutomaticSpmEvolveAdvisorTaskRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The configuration details of the Automatic SPM Evolve Advisor task. + ConfigureAutomaticSpmEvolveAdvisorTaskDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ConfigureAutomaticSpmEvolveAdvisorTaskRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ConfigureAutomaticSpmEvolveAdvisorTaskRequest) 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 ConfigureAutomaticSpmEvolveAdvisorTaskRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConfigureAutomaticSpmEvolveAdvisorTaskRequest) 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 ConfigureAutomaticSpmEvolveAdvisorTaskRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConfigureAutomaticSpmEvolveAdvisorTaskResponse wrapper for the ConfigureAutomaticSpmEvolveAdvisorTask operation +type ConfigureAutomaticSpmEvolveAdvisorTaskResponse 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 ConfigureAutomaticSpmEvolveAdvisorTaskResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ConfigureAutomaticSpmEvolveAdvisorTaskResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/create_external_db_system_details.go b/databasemanagement/create_external_db_system_details.go index 58724c1799..bdedb3c17d 100644 --- a/databasemanagement/create_external_db_system_details.go +++ b/databasemanagement/create_external_db_system_details.go @@ -30,6 +30,8 @@ type CreateExternalDbSystemDetails struct { DisplayName *string `mandatory:"false" json:"displayName"` DatabaseManagementConfig *ExternalDbSystemDatabaseManagementConfigDetails `mandatory:"false" json:"databaseManagementConfig"` + + StackMonitoringConfig *AssociatedServiceDetails `mandatory:"false" json:"stackMonitoringConfig"` } func (m CreateExternalDbSystemDetails) String() string { diff --git a/databasemanagement/create_external_exadata_infrastructure_details.go b/databasemanagement/create_external_exadata_infrastructure_details.go index efed3e4bb1..c1fd032d2c 100644 --- a/databasemanagement/create_external_exadata_infrastructure_details.go +++ b/databasemanagement/create_external_exadata_infrastructure_details.go @@ -17,16 +17,16 @@ import ( "strings" ) -// CreateExternalExadataInfrastructureDetails The details of creating external Exadata infrastructure. +// CreateExternalExadataInfrastructureDetails The details required to create the external Exadata infrastructure. type CreateExternalExadataInfrastructureDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The name of the Exadata infrastructure. DisplayName *string `mandatory:"true" json:"displayName"` - // The list of all the rac database system OCIDs. + // The list of DB systems in the Exadata infrastructure. DbSystemIds []string `mandatory:"true" json:"dbSystemIds"` // The unique key of the discovery request. @@ -35,7 +35,7 @@ type CreateExternalExadataInfrastructureDetails struct { // The Oracle license model that applies to the database management resources. LicenseModel CreateExternalExadataInfrastructureDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` - // The list of all the storage server names to be included for monitoering purpose. If not specified, all the storage servers associated with the database systems are included. + // The list of all the Exadata storage server names to be included for monitoring purposes. If not specified, all the Exadata storage servers associated with the DB systems are included. StorageServerNames []string `mandatory:"false" json:"storageServerNames"` } diff --git a/databasemanagement/create_external_exadata_storage_connector_details.go b/databasemanagement/create_external_exadata_storage_connector_details.go index a4fab030bd..c9ff20864d 100644 --- a/databasemanagement/create_external_exadata_storage_connector_details.go +++ b/databasemanagement/create_external_exadata_storage_connector_details.go @@ -17,7 +17,7 @@ import ( "strings" ) -// CreateExternalExadataStorageConnectorDetails The details of creating the connector to the Exadata storage server. +// CreateExternalExadataStorageConnectorDetails The details required to create the connector to the Exadata storage server. type CreateExternalExadataStorageConnectorDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata storage server. @@ -26,10 +26,10 @@ type CreateExternalExadataStorageConnectorDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent for the Exadata storage server. AgentId *string `mandatory:"true" json:"agentId"` - // The connector name if OCI connector is created. + // The name of the Exadata storage server connector. ConnectorName *string `mandatory:"true" json:"connectorName"` - // The unique connection string of the connection. For example, "https://slcm21celadm02.us.oracle.com:443/MS/RESTService/". + // The unique string of the connection. For example, "https:///MS/RESTService/". ConnectionUri *string `mandatory:"true" json:"connectionUri"` CredentialInfo *RestCredential `mandatory:"true" json:"credentialInfo"` diff --git a/databasemanagement/create_external_exadata_storage_connector_request_response.go b/databasemanagement/create_external_exadata_storage_connector_request_response.go index 3dfddedffb..463fb3d892 100644 --- a/databasemanagement/create_external_exadata_storage_connector_request_response.go +++ b/databasemanagement/create_external_exadata_storage_connector_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/CreateExternalExadataStorageConnector.go.html to see an example of how to use CreateExternalExadataStorageConnectorRequest. type CreateExternalExadataStorageConnectorRequest struct { - // The details required to add connections to the storage servers. + // The details required to add connections to the Exadata storage servers. CreateExternalExadataStorageConnectorDetails `contributesTo:"body"` // The client request ID for tracing. diff --git a/databasemanagement/create_sql_job_details.go b/databasemanagement/create_sql_job_details.go index 3f35ec261b..66c66042bc 100644 --- a/databasemanagement/create_sql_job_details.go +++ b/databasemanagement/create_sql_job_details.go @@ -48,6 +48,10 @@ type CreateSqlJobDetails struct { // The SQL text to be executed as part of the job. SqlText *string `mandatory:"false" json:"sqlText"` + InBinds *JobInBindsDetails `mandatory:"false" json:"inBinds"` + + OutBinds *JobOutBindsDetails `mandatory:"false" json:"outBinds"` + // The database user name used to execute the SQL job. If the job is being executed on a // Managed Database Group, then the user name should exist on all the databases in the // group with the same password. @@ -180,6 +184,8 @@ func (m *CreateSqlJobDetails) UnmarshalJSON(data []byte) (e error) { ResultLocation jobexecutionresultlocation `json:"resultLocation"` ScheduleDetails *JobScheduleDetails `json:"scheduleDetails"` SqlText *string `json:"sqlText"` + InBinds *JobInBindsDetails `json:"inBinds"` + OutBinds *JobOutBindsDetails `json:"outBinds"` SqlType SqlJobSqlTypeEnum `json:"sqlType"` UserName *string `json:"userName"` Password *string `json:"password"` @@ -220,6 +226,10 @@ func (m *CreateSqlJobDetails) UnmarshalJSON(data []byte) (e error) { m.SqlText = model.SqlText + m.InBinds = model.InBinds + + m.OutBinds = model.OutBinds + m.SqlType = model.SqlType m.UserName = model.UserName diff --git a/databasemanagement/cursor_cache_statement_collection.go b/databasemanagement/cursor_cache_statement_collection.go new file mode 100644 index 0000000000..1c2611b9fe --- /dev/null +++ b/databasemanagement/cursor_cache_statement_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CursorCacheStatementCollection The list of SQL statements in the cursor cache. +type CursorCacheStatementCollection struct { + + // A list of SQL statements in the cursor cache. + Items []CursorCacheStatementSummary `mandatory:"true" json:"items"` +} + +func (m CursorCacheStatementCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CursorCacheStatementCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/cursor_cache_statement_summary.go b/databasemanagement/cursor_cache_statement_summary.go new file mode 100644 index 0000000000..7d68ec8504 --- /dev/null +++ b/databasemanagement/cursor_cache_statement_summary.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CursorCacheStatementSummary The summary of a SQL statement in the cursor cache. +type CursorCacheStatementSummary struct { + + // The SQL statement identifier. Identifies a SQL statement in the cursor cache. + SqlId *string `mandatory:"true" json:"sqlId"` + + // The name of the parsing schema. + Schema *string `mandatory:"true" json:"schema"` + + // The first thousand characters of the SQL text. + SqlText *string `mandatory:"true" json:"sqlText"` +} + +func (m CursorCacheStatementSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CursorCacheStatementSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/database_plan_directive.go b/databasemanagement/database_plan_directive.go index 05f63da5b7..6456dea722 100644 --- a/databasemanagement/database_plan_directive.go +++ b/databasemanagement/database_plan_directive.go @@ -17,13 +17,13 @@ import ( "strings" ) -// DatabasePlanDirective Manage resource allocations among databases. Besides name, need to have at least one other property. +// DatabasePlanDirective Manages resource allocation among databases. Besides the name, at least one other property must be available. type DatabasePlanDirective struct { // The name of a database or a profile. Name *string `mandatory:"true" json:"name"` - // The relative priority a database in the database plan. A higher share value implies + // The relative priority of a database in the database plan. A higher share value implies // higher priority and more access to the I/O resources. // Use either share or (level, allocation). All plan directives in a database plan // should use the same setting. @@ -111,17 +111,16 @@ type DatabasePlanDirective struct { // distinguish between databases with the same name running in different Oracle ASM clusters. AsmCluster *string `mandatory:"false" json:"asmCluster"` - // Enables you to create a profile, or template, to ease management and configuration of resource plans + // Enables you to create a profile or template, to ease management and configuration of resource plans // in environments with many databases. - // type=database: Specifies a directive that applies to a specific database. + // - type=database: Specifies a directive that applies to a specific database. // If type in not specified, then the directive defaults to the database type. - // type=profile: Specifies a directive that applies to a profile rather than a specific database. + // - type=profile: Specifies a directive that applies to a profile rather than a specific database. // To associate a database with an IORM profile, you must set the database initialization - // parameter db_performance_profile to the value of the profile name. Databases that map to a profile i - // nherit the settings specified in the profile. + // parameter db_performance_profile to the value of the profile name. Databases that map to a profile inherit the settings specified in the profile. Type DatabasePlanTypeEnumEnum `mandatory:"false" json:"type,omitempty"` - // Enables you specify different plan directives based on the Oracle Data Guard database role. + // Enables you to specify different plan directives based on the Oracle Data Guard database role. Role DatabasePlanRoleEnumEnum `mandatory:"false" json:"role,omitempty"` } diff --git a/databasemanagement/databasemanagement_dbmanagement_client.go b/databasemanagement/databasemanagement_dbmanagement_client.go index 1859ad373c..33b0d140bd 100644 --- a/databasemanagement/databasemanagement_dbmanagement_client.go +++ b/databasemanagement/databasemanagement_dbmanagement_client.go @@ -471,7 +471,7 @@ func (client DbManagementClient) changeExternalDbSystemCompartment(ctx context.C return response, err } -// ChangeExternalExadataInfrastructureCompartment Moves the Exadata infrastructure and its related resources (storage server, storage server connectors and storage server grid) to the specified compartment. +// ChangeExternalExadataInfrastructureCompartment Moves the Exadata infrastructure and its related resources (Exadata storage server, Exadata storage server connectors and Exadata storage server grid) to the specified compartment. // // See also // @@ -660,6 +660,181 @@ func (client DbManagementClient) changeManagedDatabaseGroupCompartment(ctx conte return response, err } +// ChangePlanRetention Changes the retention period of unused plans. The period can range +// between 5 and 523 weeks. +// The database purges plans that have not been used for longer than +// the plan retention period. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ChangePlanRetention.go.html to see an example of how to use ChangePlanRetention API. +func (client DbManagementClient) ChangePlanRetention(ctx context.Context, request ChangePlanRetentionRequest) (response ChangePlanRetentionResponse, 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.changePlanRetention, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangePlanRetentionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangePlanRetentionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangePlanRetentionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangePlanRetentionResponse") + } + return +} + +// changePlanRetention implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) changePlanRetention(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/changePlanRetention", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangePlanRetentionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ChangePlanRetention" + err = common.PostProcessServiceError(err, "DbManagement", "ChangePlanRetention", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeSpaceBudget Changes the disk space limit for the SQL Management Base. The allowable +// range for this limit is between 1% and 50%. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ChangeSpaceBudget.go.html to see an example of how to use ChangeSpaceBudget API. +func (client DbManagementClient) ChangeSpaceBudget(ctx context.Context, request ChangeSpaceBudgetRequest) (response ChangeSpaceBudgetResponse, 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.changeSpaceBudget, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeSpaceBudgetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeSpaceBudgetResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeSpaceBudgetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeSpaceBudgetResponse") + } + return +} + +// changeSpaceBudget implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) changeSpaceBudget(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/changeSpaceBudget", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeSpaceBudgetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ChangeSpaceBudget" + err = common.PostProcessServiceError(err, "DbManagement", "ChangeSpaceBudget", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeSqlPlanBaselinesAttributes Changes one or more attributes of a single plan or all plans associated with a SQL statement. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ChangeSqlPlanBaselinesAttributes.go.html to see an example of how to use ChangeSqlPlanBaselinesAttributes API. +func (client DbManagementClient) ChangeSqlPlanBaselinesAttributes(ctx context.Context, request ChangeSqlPlanBaselinesAttributesRequest) (response ChangeSqlPlanBaselinesAttributesResponse, 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.changeSqlPlanBaselinesAttributes, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeSqlPlanBaselinesAttributesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeSqlPlanBaselinesAttributesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeSqlPlanBaselinesAttributesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeSqlPlanBaselinesAttributesResponse") + } + return +} + +// changeSqlPlanBaselinesAttributes implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) changeSqlPlanBaselinesAttributes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/changeSqlPlanBaselinesAttributes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeSqlPlanBaselinesAttributesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ChangeSqlPlanBaselinesAttributes" + err = common.PostProcessServiceError(err, "DbManagement", "ChangeSqlPlanBaselinesAttributes", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CheckExternalDbSystemConnectorConnectionStatus Checks the status of the external DB system component connection specified in this connector. // This operation will refresh the connectionStatus and timeConnectionStatusLastUpdated fields. // @@ -724,7 +899,7 @@ func (client DbManagementClient) checkExternalDbSystemConnectorConnectionStatus( return response, err } -// CheckExternalExadataStorageConnector Check the status of the Exadata storage server connection specified by exadataStorageConnectorId. +// CheckExternalExadataStorageConnector Checks the status of the Exadata storage server connection specified by exadataStorageConnectorId. // // See also // @@ -787,6 +962,123 @@ func (client DbManagementClient) checkExternalExadataStorageConnector(ctx contex return response, err } +// ConfigureAutomaticCaptureFilters Configures automatic capture filters to capture only those statements +// that match the filter criteria. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ConfigureAutomaticCaptureFilters.go.html to see an example of how to use ConfigureAutomaticCaptureFilters API. +func (client DbManagementClient) ConfigureAutomaticCaptureFilters(ctx context.Context, request ConfigureAutomaticCaptureFiltersRequest) (response ConfigureAutomaticCaptureFiltersResponse, 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.configureAutomaticCaptureFilters, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ConfigureAutomaticCaptureFiltersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ConfigureAutomaticCaptureFiltersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ConfigureAutomaticCaptureFiltersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConfigureAutomaticCaptureFiltersResponse") + } + return +} + +// configureAutomaticCaptureFilters implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) configureAutomaticCaptureFilters(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/configureAutomaticCaptureFilters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ConfigureAutomaticCaptureFiltersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ConfigureAutomaticCaptureFilters" + err = common.PostProcessServiceError(err, "DbManagement", "ConfigureAutomaticCaptureFilters", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ConfigureAutomaticSpmEvolveAdvisorTask Configures the Automatic SPM Evolve Advisor task `SYS_AUTO_SPM_EVOLVE_TASK` +// by specifying task parameters. As the task is owned by `SYS`, only `SYS` can +// set task parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ConfigureAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use ConfigureAutomaticSpmEvolveAdvisorTask API. +func (client DbManagementClient) ConfigureAutomaticSpmEvolveAdvisorTask(ctx context.Context, request ConfigureAutomaticSpmEvolveAdvisorTaskRequest) (response ConfigureAutomaticSpmEvolveAdvisorTaskResponse, 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.configureAutomaticSpmEvolveAdvisorTask, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ConfigureAutomaticSpmEvolveAdvisorTaskResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ConfigureAutomaticSpmEvolveAdvisorTaskResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ConfigureAutomaticSpmEvolveAdvisorTaskResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConfigureAutomaticSpmEvolveAdvisorTaskResponse") + } + return +} + +// configureAutomaticSpmEvolveAdvisorTask implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) configureAutomaticSpmEvolveAdvisorTask(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/configureAutomaticSpmEvolveAdvisorTask", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ConfigureAutomaticSpmEvolveAdvisorTaskResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ConfigureAutomaticSpmEvolveAdvisorTask" + err = common.PostProcessServiceError(err, "DbManagement", "ConfigureAutomaticSpmEvolveAdvisorTask", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateDbManagementPrivateEndpoint Creates a new Database Management private endpoint. // // See also @@ -1038,7 +1330,7 @@ func (client DbManagementClient) createExternalDbSystemDiscovery(ctx context.Con return response, err } -// CreateExternalExadataInfrastructure Creates an OCI resource for the Exadata infrastructure and enable monitoring service on the exadata infrastructure. +// CreateExternalExadataInfrastructure Creates an OCI resource for the Exadata infrastructure and enables the Monitoring service for the Exadata infrastructure. // The following resource/subresources are created: // Infrastructure // Storage server connectors @@ -1106,9 +1398,7 @@ func (client DbManagementClient) createExternalExadataInfrastructure(ctx context return response, err } -// CreateExternalExadataStorageConnector Create the storage server connector after validating the connection information. -// Or only validates the connection information for creating the connection to the storage server. -// The connector for one storage server is associated with the Exadata infrastructure discovery or existing Exadata infrastructure. +// CreateExternalExadataStorageConnector Creates the Exadata storage server connector after validating the connection information. // // See also // @@ -1588,7 +1878,7 @@ func (client DbManagementClient) deleteExternalDbSystemDiscovery(ctx context.Con return response, err } -// DeleteExternalExadataInfrastructure Deletes the the Exadata infrastructure specified by externalExadataInfrastructureId. +// DeleteExternalExadataInfrastructure Deletes the Exadata infrastructure specified by externalExadataInfrastructureId. // // See also // @@ -1645,7 +1935,7 @@ func (client DbManagementClient) deleteExternalExadataInfrastructure(ctx context return response, err } -// DeleteExternalExadataStorageConnector Deletes the storage server connector specified by exadataStorageConnectorId. +// DeleteExternalExadataStorageConnector Deletes the Exadata storage server connector specified by exadataStorageConnectorId. // // See also // @@ -1874,63 +2164,56 @@ func (client DbManagementClient) deletePreferredCredential(ctx context.Context, return response, err } -// DisableExternalDbSystemDatabaseManagement Disables Database Management service for all the components of the specified -// external DB system (except databases). +// DisableAutomaticInitialPlanCapture Disables automatic initial plan capture. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableExternalDbSystemDatabaseManagement.go.html to see an example of how to use DisableExternalDbSystemDatabaseManagement API. -// A default retry strategy applies to this operation DisableExternalDbSystemDatabaseManagement() -func (client DbManagementClient) DisableExternalDbSystemDatabaseManagement(ctx context.Context, request DisableExternalDbSystemDatabaseManagementRequest) (response DisableExternalDbSystemDatabaseManagementResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableAutomaticInitialPlanCapture.go.html to see an example of how to use DisableAutomaticInitialPlanCapture API. +func (client DbManagementClient) DisableAutomaticInitialPlanCapture(ctx context.Context, request DisableAutomaticInitialPlanCaptureRequest) (response DisableAutomaticInitialPlanCaptureResponse, err error) { var ociResponse common.OCIResponse - policy := common.DefaultRetryPolicy() + 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.disableExternalDbSystemDatabaseManagement, policy) + ociResponse, err = common.Retry(ctx, request, client.disableAutomaticInitialPlanCapture, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DisableExternalDbSystemDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DisableAutomaticInitialPlanCaptureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DisableExternalDbSystemDatabaseManagementResponse{} + response = DisableAutomaticInitialPlanCaptureResponse{} } } return } - if convertedResponse, ok := ociResponse.(DisableExternalDbSystemDatabaseManagementResponse); ok { + if convertedResponse, ok := ociResponse.(DisableAutomaticInitialPlanCaptureResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DisableExternalDbSystemDatabaseManagementResponse") + err = fmt.Errorf("failed to convert OCIResponse into DisableAutomaticInitialPlanCaptureResponse") } return } -// disableExternalDbSystemDatabaseManagement implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) disableExternalDbSystemDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// disableAutomaticInitialPlanCapture implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableAutomaticInitialPlanCapture(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalDbSystems/{externalDbSystemId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/disableAutomaticInitialPlanCapture", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DisableExternalDbSystemDatabaseManagementResponse + var response DisableAutomaticInitialPlanCaptureResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalDbSystem/DisableExternalDbSystemDatabaseManagement" - err = common.PostProcessServiceError(err, "DbManagement", "DisableExternalDbSystemDatabaseManagement", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/DisableAutomaticInitialPlanCapture" + err = common.PostProcessServiceError(err, "DbManagement", "DisableAutomaticInitialPlanCapture", apiReferenceLink) return response, err } @@ -1938,55 +2221,242 @@ func (client DbManagementClient) disableExternalDbSystemDatabaseManagement(ctx c return response, err } -// DisableExternalExadataInfrastructureManagement Disables Database Management service for the Exadata infrastructure specified by externalExadataInfrastructureId. -// It covers the following components -// Exadata infrastructure -// Exadata storage grid -// Exadata storage server -// Database systems within the Exdata infrastructure will not be impacted and should be disabled explicitly if needed. +// DisableAutomaticSpmEvolveAdvisorTask Disables the Automatic SPM Evolve Advisor task. +// One client controls both Automatic SQL Tuning Advisor and Automatic SPM Evolve Advisor. +// Thus, the same task enables or disables both. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableExternalExadataInfrastructureManagement.go.html to see an example of how to use DisableExternalExadataInfrastructureManagement API. -// A default retry strategy applies to this operation DisableExternalExadataInfrastructureManagement() -func (client DbManagementClient) DisableExternalExadataInfrastructureManagement(ctx context.Context, request DisableExternalExadataInfrastructureManagementRequest) (response DisableExternalExadataInfrastructureManagementResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use DisableAutomaticSpmEvolveAdvisorTask API. +func (client DbManagementClient) DisableAutomaticSpmEvolveAdvisorTask(ctx context.Context, request DisableAutomaticSpmEvolveAdvisorTaskRequest) (response DisableAutomaticSpmEvolveAdvisorTaskResponse, err error) { var ociResponse common.OCIResponse - policy := common.DefaultRetryPolicy() + 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.disableExternalExadataInfrastructureManagement, policy) + ociResponse, err = common.Retry(ctx, request, client.disableAutomaticSpmEvolveAdvisorTask, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DisableExternalExadataInfrastructureManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DisableAutomaticSpmEvolveAdvisorTaskResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DisableExternalExadataInfrastructureManagementResponse{} + response = DisableAutomaticSpmEvolveAdvisorTaskResponse{} } } return } - if convertedResponse, ok := ociResponse.(DisableExternalExadataInfrastructureManagementResponse); ok { + if convertedResponse, ok := ociResponse.(DisableAutomaticSpmEvolveAdvisorTaskResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DisableExternalExadataInfrastructureManagementResponse") + err = fmt.Errorf("failed to convert OCIResponse into DisableAutomaticSpmEvolveAdvisorTaskResponse") } return } -// disableExternalExadataInfrastructureManagement implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) disableExternalExadataInfrastructureManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// disableAutomaticSpmEvolveAdvisorTask implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableAutomaticSpmEvolveAdvisorTask(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalExadataInfrastructures/{externalExadataInfrastructureId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/disableAutomaticSpmEvolveAdvisorTask", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableAutomaticSpmEvolveAdvisorTaskResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/DisableAutomaticSpmEvolveAdvisorTask" + err = common.PostProcessServiceError(err, "DbManagement", "DisableAutomaticSpmEvolveAdvisorTask", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableExternalDbSystemDatabaseManagement Disables Database Management service for all the components of the specified +// external DB system (except databases). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableExternalDbSystemDatabaseManagement.go.html to see an example of how to use DisableExternalDbSystemDatabaseManagement API. +// A default retry strategy applies to this operation DisableExternalDbSystemDatabaseManagement() +func (client DbManagementClient) DisableExternalDbSystemDatabaseManagement(ctx context.Context, request DisableExternalDbSystemDatabaseManagementRequest) (response DisableExternalDbSystemDatabaseManagementResponse, 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.disableExternalDbSystemDatabaseManagement, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableExternalDbSystemDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableExternalDbSystemDatabaseManagementResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableExternalDbSystemDatabaseManagementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableExternalDbSystemDatabaseManagementResponse") + } + return +} + +// disableExternalDbSystemDatabaseManagement implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableExternalDbSystemDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalDbSystems/{externalDbSystemId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableExternalDbSystemDatabaseManagementResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalDbSystem/DisableExternalDbSystemDatabaseManagement" + err = common.PostProcessServiceError(err, "DbManagement", "DisableExternalDbSystemDatabaseManagement", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableExternalDbSystemStackMonitoring Disables Stack Monitoring for all the components of the specified +// external DB system (except databases). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableExternalDbSystemStackMonitoring.go.html to see an example of how to use DisableExternalDbSystemStackMonitoring API. +// A default retry strategy applies to this operation DisableExternalDbSystemStackMonitoring() +func (client DbManagementClient) DisableExternalDbSystemStackMonitoring(ctx context.Context, request DisableExternalDbSystemStackMonitoringRequest) (response DisableExternalDbSystemStackMonitoringResponse, 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.disableExternalDbSystemStackMonitoring, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableExternalDbSystemStackMonitoringResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableExternalDbSystemStackMonitoringResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableExternalDbSystemStackMonitoringResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableExternalDbSystemStackMonitoringResponse") + } + return +} + +// disableExternalDbSystemStackMonitoring implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableExternalDbSystemStackMonitoring(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalDbSystems/{externalDbSystemId}/actions/disableStackMonitoring", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableExternalDbSystemStackMonitoringResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalDbSystem/DisableExternalDbSystemStackMonitoring" + err = common.PostProcessServiceError(err, "DbManagement", "DisableExternalDbSystemStackMonitoring", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableExternalExadataInfrastructureManagement Disables Database Management for the Exadata infrastructure specified by externalExadataInfrastructureId. +// It covers the following components: +// - Exadata infrastructure +// - Exadata storage grid +// - Exadata storage server +// Note that Database Management will not be disabled for the DB systems within the Exadata infrastructure and should be disabled explicitly, if required. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableExternalExadataInfrastructureManagement.go.html to see an example of how to use DisableExternalExadataInfrastructureManagement API. +// A default retry strategy applies to this operation DisableExternalExadataInfrastructureManagement() +func (client DbManagementClient) DisableExternalExadataInfrastructureManagement(ctx context.Context, request DisableExternalExadataInfrastructureManagementRequest) (response DisableExternalExadataInfrastructureManagementResponse, 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.disableExternalExadataInfrastructureManagement, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableExternalExadataInfrastructureManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableExternalExadataInfrastructureManagementResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableExternalExadataInfrastructureManagementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableExternalExadataInfrastructureManagementResponse") + } + return +} + +// disableExternalExadataInfrastructureManagement implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableExternalExadataInfrastructureManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalExadataInfrastructures/{externalExadataInfrastructureId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) if err != nil { return nil, err } @@ -2006,74 +2476,250 @@ func (client DbManagementClient) disableExternalExadataInfrastructureManagement( return response, err } -// DiscoverExternalExadataInfrastructure Completes the Exadata system prechecking on the following: -// Verifies if the database systems are valid RAC database systems. Otherwise, return 400 status code with NON_RAC_DATABASE_SYSTEM error code. -// Verifies if the ASM connectors defined for each database system. Otherwise, return 400 status code with CONNECTOR_NOT_DEFINED error code. -// Verifies if the agents associated with ASM are valid and could be used for the storage servers. Otherwise, return 400 status code with INVALID_AGENT error code. -// Verifies if it is an Exadata system. Otherwise, return 400 status code with INVALID_EXADATA_SYSTEM error code. -// Starts the discovery process for the Exadata system infrastructure.The following resources/components could be discovered -// storage servers from each database systems -// storage grid for all storage server -// exadata infrastructure -// The same API covers both new discovery and re-discovery cases. -// For the new discovery case, new managed resources/sub-resources are created or override the existing one. -// For re-discovery case, the existing managed resources/sub-resources are checked to find out which ones should be added or which one should be -// removed based on the unique key defined for each resource/sub-resource. +// DisableHighFrequencyAutomaticSpmEvolveAdvisorTask Disables the high-frequency Automatic SPM Evolve Advisor task. +// It is available only on Oracle Exadata Database Machine, Oracle Database Exadata +// Cloud Service (ExaCS) and Oracle Database Exadata Cloud@Customer (ExaCC). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableHighFrequencyAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use DisableHighFrequencyAutomaticSpmEvolveAdvisorTask API. +func (client DbManagementClient) DisableHighFrequencyAutomaticSpmEvolveAdvisorTask(ctx context.Context, request DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) (response DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse, 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.disableHighFrequencyAutomaticSpmEvolveAdvisorTask, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse") + } + return +} + +// disableHighFrequencyAutomaticSpmEvolveAdvisorTask implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableHighFrequencyAutomaticSpmEvolveAdvisorTask(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/disableHighFrequencyAutomaticSpmEvolveAdvisorTask", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/DisableHighFrequencyAutomaticSpmEvolveAdvisorTask" + err = common.PostProcessServiceError(err, "DbManagement", "DisableHighFrequencyAutomaticSpmEvolveAdvisorTask", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableSqlPlanBaselinesUsage Disables the use of SQL plan baselines stored in SQL Management Base. +// When disabled, the optimizer does not use any SQL plan baselines. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableSqlPlanBaselinesUsage.go.html to see an example of how to use DisableSqlPlanBaselinesUsage API. +func (client DbManagementClient) DisableSqlPlanBaselinesUsage(ctx context.Context, request DisableSqlPlanBaselinesUsageRequest) (response DisableSqlPlanBaselinesUsageResponse, 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.disableSqlPlanBaselinesUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableSqlPlanBaselinesUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableSqlPlanBaselinesUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableSqlPlanBaselinesUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableSqlPlanBaselinesUsageResponse") + } + return +} + +// disableSqlPlanBaselinesUsage implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableSqlPlanBaselinesUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/disableSqlPlanBaselinesUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableSqlPlanBaselinesUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/DisableSqlPlanBaselinesUsage" + err = common.PostProcessServiceError(err, "DbManagement", "DisableSqlPlanBaselinesUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DiscoverExternalExadataInfrastructure Completes the Exadata system prechecking on the following: +// - Verifies if the DB systems are valid RAC DB systems or return 400 status code with NON_RAC_DATABASE_SYSTEM error code. +// - Verifies if the ASM connector defined for each DB system or return 400 status code with CONNECTOR_NOT_DEFINED error code. +// - Verifies if the agents associated with ASM are valid and could be used for the Exadata storage servers or return 400 status code with +// INVALID_AGENT error code. +// - Verifies if it is an Exadata system or return 400 status code with INVALID_EXADATA_SYSTEM error code. +// Starts the discovery process for the Exadata system infrastructure. The following resources/components are discovered +// - Exadata storage servers from each DB systems +// - Exadata storage grid for all Exadata storage servers +// - Exadata infrastructure +// The same API covers both new discovery and rediscovery cases. +// For the new discovery case, new managed resources/sub-resources are created or the existing ones are overridden. +// For rediscovery case, the existing managed resources/sub-resources are checked to find out which ones should be added or which ones +// should be +// removed based on the unique key defined for each resource/sub-resource. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DiscoverExternalExadataInfrastructure.go.html to see an example of how to use DiscoverExternalExadataInfrastructure API. +// A default retry strategy applies to this operation DiscoverExternalExadataInfrastructure() +func (client DbManagementClient) DiscoverExternalExadataInfrastructure(ctx context.Context, request DiscoverExternalExadataInfrastructureRequest) (response DiscoverExternalExadataInfrastructureResponse, 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.discoverExternalExadataInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DiscoverExternalExadataInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DiscoverExternalExadataInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DiscoverExternalExadataInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DiscoverExternalExadataInfrastructureResponse") + } + return +} + +// discoverExternalExadataInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) discoverExternalExadataInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalExadataInfrastructures/actions/discoverExadataInfrastructure", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DiscoverExternalExadataInfrastructureResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalExadataInfrastructure/DiscoverExternalExadataInfrastructure" + err = common.PostProcessServiceError(err, "DbManagement", "DiscoverExternalExadataInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DropSqlPlanBaselines Drops a single plan or all plans associated with a SQL statement. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DiscoverExternalExadataInfrastructure.go.html to see an example of how to use DiscoverExternalExadataInfrastructure API. -// A default retry strategy applies to this operation DiscoverExternalExadataInfrastructure() -func (client DbManagementClient) DiscoverExternalExadataInfrastructure(ctx context.Context, request DiscoverExternalExadataInfrastructureRequest) (response DiscoverExternalExadataInfrastructureResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DropSqlPlanBaselines.go.html to see an example of how to use DropSqlPlanBaselines API. +func (client DbManagementClient) DropSqlPlanBaselines(ctx context.Context, request DropSqlPlanBaselinesRequest) (response DropSqlPlanBaselinesResponse, err error) { var ociResponse common.OCIResponse - policy := common.DefaultRetryPolicy() + 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.discoverExternalExadataInfrastructure, policy) + ociResponse, err = common.Retry(ctx, request, client.dropSqlPlanBaselines, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DiscoverExternalExadataInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DropSqlPlanBaselinesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DiscoverExternalExadataInfrastructureResponse{} + response = DropSqlPlanBaselinesResponse{} } } return } - if convertedResponse, ok := ociResponse.(DiscoverExternalExadataInfrastructureResponse); ok { + if convertedResponse, ok := ociResponse.(DropSqlPlanBaselinesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DiscoverExternalExadataInfrastructureResponse") + err = fmt.Errorf("failed to convert OCIResponse into DropSqlPlanBaselinesResponse") } return } -// discoverExternalExadataInfrastructure implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) discoverExternalExadataInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// dropSqlPlanBaselines implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) dropSqlPlanBaselines(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalExadataInfrastructures/actions/discoverExadataInfrastructure", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/dropSqlPlanBaselines", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DiscoverExternalExadataInfrastructureResponse + var response DropSqlPlanBaselinesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalExadataInfrastructure/DiscoverExternalExadataInfrastructure" - err = common.PostProcessServiceError(err, "DbManagement", "DiscoverExternalExadataInfrastructure", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/DropSqlPlanBaselines" + err = common.PostProcessServiceError(err, "DbManagement", "DropSqlPlanBaselines", apiReferenceLink) return response, err } @@ -2143,6 +2789,135 @@ func (client DbManagementClient) dropTablespace(ctx context.Context, request com return response, err } +// EnableAutomaticInitialPlanCapture Enables automatic initial plan capture. When enabled, the database checks whether +// executed SQL statements are eligible for automatic capture. It creates initial +// plan baselines for eligible statements. +// By default, the database creates a SQL plan baseline for every eligible repeatable +// statement, including all recursive SQL and monitoring SQL. Thus, automatic capture +// may result in the creation of an extremely large number of plan baselines. To limit +// the statements that are eligible for plan baselines, configure filters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableAutomaticInitialPlanCapture.go.html to see an example of how to use EnableAutomaticInitialPlanCapture API. +func (client DbManagementClient) EnableAutomaticInitialPlanCapture(ctx context.Context, request EnableAutomaticInitialPlanCaptureRequest) (response EnableAutomaticInitialPlanCaptureResponse, 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.enableAutomaticInitialPlanCapture, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableAutomaticInitialPlanCaptureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableAutomaticInitialPlanCaptureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableAutomaticInitialPlanCaptureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableAutomaticInitialPlanCaptureResponse") + } + return +} + +// enableAutomaticInitialPlanCapture implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) enableAutomaticInitialPlanCapture(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/enableAutomaticInitialPlanCapture", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableAutomaticInitialPlanCaptureResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/EnableAutomaticInitialPlanCapture" + err = common.PostProcessServiceError(err, "DbManagement", "EnableAutomaticInitialPlanCapture", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// EnableAutomaticSpmEvolveAdvisorTask Enables the Automatic SPM Evolve Advisor task. By default, the automatic task +// `SYS_AUTO_SPM_EVOLVE_TASK` runs every day in the scheduled maintenance window. +// The SPM Evolve Advisor performs the following tasks: +// - Checks AWR for top SQL +// - Looks for alternative plans in all available sources +// - Adds unaccepted plans to the plan history +// - Tests the execution of as many plans as possible during the maintenance window +// - Adds the alternative plan to the baseline if it performs better than the current plan +// One client controls both Automatic SQL Tuning Advisor and Automatic SPM Evolve Advisor. +// Thus, the same task enables or disables both. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use EnableAutomaticSpmEvolveAdvisorTask API. +func (client DbManagementClient) EnableAutomaticSpmEvolveAdvisorTask(ctx context.Context, request EnableAutomaticSpmEvolveAdvisorTaskRequest) (response EnableAutomaticSpmEvolveAdvisorTaskResponse, 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.enableAutomaticSpmEvolveAdvisorTask, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableAutomaticSpmEvolveAdvisorTaskResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableAutomaticSpmEvolveAdvisorTaskResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableAutomaticSpmEvolveAdvisorTaskResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableAutomaticSpmEvolveAdvisorTaskResponse") + } + return +} + +// enableAutomaticSpmEvolveAdvisorTask implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) enableAutomaticSpmEvolveAdvisorTask(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/enableAutomaticSpmEvolveAdvisorTask", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableAutomaticSpmEvolveAdvisorTaskResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/EnableAutomaticSpmEvolveAdvisorTask" + err = common.PostProcessServiceError(err, "DbManagement", "EnableAutomaticSpmEvolveAdvisorTask", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // EnableExternalDbSystemDatabaseManagement Enables Database Management service for all the components of the specified // external DB system (except databases). // @@ -2207,11 +2982,75 @@ func (client DbManagementClient) enableExternalDbSystemDatabaseManagement(ctx co return response, err } -// EnableExternalExadataInfrastructureManagement Enables Database Management service for the exadata infrastructure specified by externalExadataInfrastructureId. It covers the following -// components -// Exadata infrastructure -// Exadata storage grid -// Exadata storage server +// EnableExternalDbSystemStackMonitoring Enables Stack Monitoring for all the components of the specified +// external DB system (except databases). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableExternalDbSystemStackMonitoring.go.html to see an example of how to use EnableExternalDbSystemStackMonitoring API. +// A default retry strategy applies to this operation EnableExternalDbSystemStackMonitoring() +func (client DbManagementClient) EnableExternalDbSystemStackMonitoring(ctx context.Context, request EnableExternalDbSystemStackMonitoringRequest) (response EnableExternalDbSystemStackMonitoringResponse, 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.enableExternalDbSystemStackMonitoring, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableExternalDbSystemStackMonitoringResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableExternalDbSystemStackMonitoringResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableExternalDbSystemStackMonitoringResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableExternalDbSystemStackMonitoringResponse") + } + return +} + +// enableExternalDbSystemStackMonitoring implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) enableExternalDbSystemStackMonitoring(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalDbSystems/{externalDbSystemId}/actions/enableStackMonitoring", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableExternalDbSystemStackMonitoringResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalDbSystem/EnableExternalDbSystemStackMonitoring" + err = common.PostProcessServiceError(err, "DbManagement", "EnableExternalDbSystemStackMonitoring", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// EnableExternalExadataInfrastructureManagement Enables Database Management for the Exadata infrastructure specified by externalExadataInfrastructureId. It covers the following +// components: +// - Exadata infrastructure +// - Exadata storage grid +// - Exadata storage server // // See also // @@ -2230,43 +3069,165 @@ func (client DbManagementClient) EnableExternalExadataInfrastructureManagement(c if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } - - ociResponse, err = common.Retry(ctx, request, client.enableExternalExadataInfrastructureManagement, policy) + + ociResponse, err = common.Retry(ctx, request, client.enableExternalExadataInfrastructureManagement, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableExternalExadataInfrastructureManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableExternalExadataInfrastructureManagementResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableExternalExadataInfrastructureManagementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableExternalExadataInfrastructureManagementResponse") + } + return +} + +// enableExternalExadataInfrastructureManagement implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) enableExternalExadataInfrastructureManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalExadataInfrastructures/{externalExadataInfrastructureId}/actions/enableDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableExternalExadataInfrastructureManagementResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalExadataInfrastructure/EnableExternalExadataInfrastructureManagement" + err = common.PostProcessServiceError(err, "DbManagement", "EnableExternalExadataInfrastructureManagement", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// EnableHighFrequencyAutomaticSpmEvolveAdvisorTask Enables the high-frequency Automatic SPM Evolve Advisor task. The high-frequency +// task runs every hour and runs for no longer than 30 minutes. These settings +// are not configurable. +// The high-frequency task complements the standard Automatic SPM Evolve Advisor task. +// They are independent and are scheduled through two different frameworks. +// It is available only on Oracle Exadata Database Machine, Oracle Database Exadata +// Cloud Service (ExaCS) and Oracle Database Exadata Cloud@Customer (ExaCC). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableHighFrequencyAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use EnableHighFrequencyAutomaticSpmEvolveAdvisorTask API. +func (client DbManagementClient) EnableHighFrequencyAutomaticSpmEvolveAdvisorTask(ctx context.Context, request EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) (response EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse, 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.enableHighFrequencyAutomaticSpmEvolveAdvisorTask, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse") + } + return +} + +// enableHighFrequencyAutomaticSpmEvolveAdvisorTask implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) enableHighFrequencyAutomaticSpmEvolveAdvisorTask(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/enableHighFrequencyAutomaticSpmEvolveAdvisorTask", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/EnableHighFrequencyAutomaticSpmEvolveAdvisorTask" + err = common.PostProcessServiceError(err, "DbManagement", "EnableHighFrequencyAutomaticSpmEvolveAdvisorTask", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// EnableSqlPlanBaselinesUsage Enables the use of SQL plan baselines stored in SQL Management Base. +// When enabled, the optimizer uses SQL plan baselines to select plans +// to avoid potential performance regressions. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableSqlPlanBaselinesUsage.go.html to see an example of how to use EnableSqlPlanBaselinesUsage API. +func (client DbManagementClient) EnableSqlPlanBaselinesUsage(ctx context.Context, request EnableSqlPlanBaselinesUsageRequest) (response EnableSqlPlanBaselinesUsageResponse, 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.enableSqlPlanBaselinesUsage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = EnableExternalExadataInfrastructureManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = EnableSqlPlanBaselinesUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = EnableExternalExadataInfrastructureManagementResponse{} + response = EnableSqlPlanBaselinesUsageResponse{} } } return } - if convertedResponse, ok := ociResponse.(EnableExternalExadataInfrastructureManagementResponse); ok { + if convertedResponse, ok := ociResponse.(EnableSqlPlanBaselinesUsageResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into EnableExternalExadataInfrastructureManagementResponse") + err = fmt.Errorf("failed to convert OCIResponse into EnableSqlPlanBaselinesUsageResponse") } return } -// enableExternalExadataInfrastructureManagement implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) enableExternalExadataInfrastructureManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// enableSqlPlanBaselinesUsage implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) enableSqlPlanBaselinesUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalExadataInfrastructures/{externalExadataInfrastructureId}/actions/enableDatabaseManagement", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/enableSqlPlanBaselinesUsage", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response EnableExternalExadataInfrastructureManagementResponse + var response EnableSqlPlanBaselinesUsageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ExternalExadataInfrastructure/EnableExternalExadataInfrastructureManagement" - err = common.PostProcessServiceError(err, "DbManagement", "EnableExternalExadataInfrastructureManagement", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/EnableSqlPlanBaselinesUsage" + err = common.PostProcessServiceError(err, "DbManagement", "EnableSqlPlanBaselinesUsage", apiReferenceLink) return response, err } @@ -3271,7 +4232,7 @@ func (client DbManagementClient) getExternalDbSystemDiscovery(ctx context.Contex return response, err } -// GetExternalExadataInfrastructure Gets the details for the the Exadata infrastructure specified by externalExadataInfrastructureId. It includes the database systems and storage grid within the +// GetExternalExadataInfrastructure Gets the details for the Exadata infrastructure specified by externalExadataInfrastructureId. It includes the DB systems and storage grid within the // Exadata infrastructure. // // See also @@ -3330,7 +4291,7 @@ func (client DbManagementClient) getExternalExadataInfrastructure(ctx context.Co return response, err } -// GetExternalExadataStorageConnector Gets the details for the storage server connector specified by exadataStorageConnectorId. +// GetExternalExadataStorageConnector Gets the details for the Exadata storage server connector specified by exadataStorageConnectorId. // // See also // @@ -3388,7 +4349,7 @@ func (client DbManagementClient) getExternalExadataStorageConnector(ctx context. return response, err } -// GetExternalExadataStorageGrid Gets the details for the storage server grid specified by exadataStorageGridId. +// GetExternalExadataStorageGrid Gets the details for the Exadata storage server grid specified by exadataStorageGridId. // // See also // @@ -3446,7 +4407,7 @@ func (client DbManagementClient) getExternalExadataStorageGrid(ctx context.Conte return response, err } -// GetExternalExadataStorageServer Gets the summary for the storage server specified by exadataStorageServerId. +// GetExternalExadataStorageServer Gets the summary for the Exadata storage server specified by exadataStorageServerId. // // See also // @@ -3562,7 +4523,7 @@ func (client DbManagementClient) getExternalListener(ctx context.Context, reques return response, err } -// GetIormPlan Get the IORM plan from the specific exadata storage server. +// GetIormPlan Get the IORM plan from the specific Exadata storage server. // // See also // @@ -3905,7 +4866,7 @@ func (client DbManagementClient) getManagedDatabaseGroup(ctx context.Context, re return response, err } -// GetOpenAlertHistory Get open alerts from storage server. +// GetOpenAlertHistory Gets the open alerts from the specified Exadata storage server. // // See also // @@ -4252,6 +5213,124 @@ func (client DbManagementClient) getPreferredCredential(ctx context.Context, req return response, err } +// GetSqlPlanBaseline Gets the SQL plan baseline details for the specified planName. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetSqlPlanBaseline.go.html to see an example of how to use GetSqlPlanBaseline API. +// A default retry strategy applies to this operation GetSqlPlanBaseline() +func (client DbManagementClient) GetSqlPlanBaseline(ctx context.Context, request GetSqlPlanBaselineRequest) (response GetSqlPlanBaselineResponse, 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.getSqlPlanBaseline, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetSqlPlanBaselineResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetSqlPlanBaselineResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetSqlPlanBaselineResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSqlPlanBaselineResponse") + } + return +} + +// getSqlPlanBaseline implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) getSqlPlanBaseline(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/{planName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetSqlPlanBaselineResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/GetSqlPlanBaseline" + err = common.PostProcessServiceError(err, "DbManagement", "GetSqlPlanBaseline", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSqlPlanBaselineConfiguration Gets the configuration details of SQL plan baselines for the specified +// Managed Database. The details include the settings for the capture and use of +// SQL plan baselines, SPM Evolve Advisor task, and SQL Management Base. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetSqlPlanBaselineConfiguration.go.html to see an example of how to use GetSqlPlanBaselineConfiguration API. +// A default retry strategy applies to this operation GetSqlPlanBaselineConfiguration() +func (client DbManagementClient) GetSqlPlanBaselineConfiguration(ctx context.Context, request GetSqlPlanBaselineConfigurationRequest) (response GetSqlPlanBaselineConfigurationResponse, 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.getSqlPlanBaselineConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetSqlPlanBaselineConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetSqlPlanBaselineConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetSqlPlanBaselineConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSqlPlanBaselineConfigurationResponse") + } + return +} + +// getSqlPlanBaselineConfiguration implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) getSqlPlanBaselineConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselineConfiguration", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetSqlPlanBaselineConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/GetSqlPlanBaselineConfiguration" + err = common.PostProcessServiceError(err, "DbManagement", "GetSqlPlanBaselineConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetTablespace Gets the details of the tablespace specified by tablespaceName within the Managed Database specified by managedDatabaseId. // // See also @@ -4309,7 +5388,7 @@ func (client DbManagementClient) getTablespace(ctx context.Context, request comm return response, err } -// GetTopSqlCpuActivity Get SQL ID with top cpu activity from storage server. +// GetTopSqlCpuActivity Gets the SQL IDs with the top CPU activity from the Exadata storage server. // // See also // @@ -4833,6 +5912,64 @@ func (client DbManagementClient) listConsumerGroupPrivileges(ctx context.Context return response, err } +// ListCursorCacheStatements Lists the SQL statements from shared SQL area, also called the cursor cache. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListCursorCacheStatements.go.html to see an example of how to use ListCursorCacheStatements API. +// A default retry strategy applies to this operation ListCursorCacheStatements() +func (client DbManagementClient) ListCursorCacheStatements(ctx context.Context, request ListCursorCacheStatementsRequest) (response ListCursorCacheStatementsResponse, 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.listCursorCacheStatements, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCursorCacheStatementsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCursorCacheStatementsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCursorCacheStatementsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCursorCacheStatementsResponse") + } + return +} + +// listCursorCacheStatements implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) listCursorCacheStatements(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/cursorCacheStatements", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCursorCacheStatementsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListCursorCacheStatements" + err = common.PostProcessServiceError(err, "DbManagement", "ListCursorCacheStatements", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListDataAccessContainers Gets the list of containers for a specific user. This is only applicable if ALL_CONTAINERS !='Y'. // // See also @@ -5700,7 +6837,7 @@ func (client DbManagementClient) listExternalDbSystems(ctx context.Context, requ return response, err } -// ListExternalExadataInfrastructures Lists the Exadata infrastructures for a specific compartment. +// ListExternalExadataInfrastructures Lists the Exadata infrastructure resources in the specified compartment. // // See also // @@ -5758,7 +6895,7 @@ func (client DbManagementClient) listExternalExadataInfrastructures(ctx context. return response, err } -// ListExternalExadataStorageConnectors Lists the connectors for the specific Exadata infrastructures. +// ListExternalExadataStorageConnectors Lists the Exadata storage server connectors for the specified Exadata infrastructure. // // See also // @@ -5816,7 +6953,7 @@ func (client DbManagementClient) listExternalExadataStorageConnectors(ctx contex return response, err } -// ListExternalExadataStorageServers Lists all the storage servers for the exadata infrastructure or storage grid. +// ListExternalExadataStorageServers Lists the Exadata storage servers for the specified Exadata infrastructure. // // See also // @@ -6548,42 +7685,156 @@ func (client DbManagementClient) ListPreferredCredentials(ctx context.Context, r if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listPreferredCredentials, policy) + ociResponse, err = common.Retry(ctx, request, client.listPreferredCredentials, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListPreferredCredentialsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListPreferredCredentialsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListPreferredCredentialsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPreferredCredentialsResponse") + } + return +} + +// listPreferredCredentials implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) listPreferredCredentials(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/preferredCredentials", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListPreferredCredentialsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/PreferredCredential/ListPreferredCredentials" + err = common.PostProcessServiceError(err, "DbManagement", "ListPreferredCredentials", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListProxiedForUsers Gets the list of users on whose behalf the current user acts as proxy. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListProxiedForUsers.go.html to see an example of how to use ListProxiedForUsers API. +func (client DbManagementClient) ListProxiedForUsers(ctx context.Context, request ListProxiedForUsersRequest) (response ListProxiedForUsersResponse, 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.listProxiedForUsers, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListProxiedForUsersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListProxiedForUsersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListProxiedForUsersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListProxiedForUsersResponse") + } + return +} + +// listProxiedForUsers implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) listProxiedForUsers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/users/{userName}/proxiedForUsers", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListProxiedForUsersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListProxiedForUsers" + err = common.PostProcessServiceError(err, "DbManagement", "ListProxiedForUsers", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListProxyUsers Gets the list of proxy users for the current user. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListProxyUsers.go.html to see an example of how to use ListProxyUsers API. +func (client DbManagementClient) ListProxyUsers(ctx context.Context, request ListProxyUsersRequest) (response ListProxyUsersResponse, 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.listProxyUsers, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListPreferredCredentialsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListProxyUsersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListPreferredCredentialsResponse{} + response = ListProxyUsersResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListPreferredCredentialsResponse); ok { + if convertedResponse, ok := ociResponse.(ListProxyUsersResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListPreferredCredentialsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListProxyUsersResponse") } return } -// listPreferredCredentials implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) listPreferredCredentials(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listProxyUsers implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) listProxyUsers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/preferredCredentials", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/users/{userName}/proxyUsers", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListPreferredCredentialsResponse + var response ListProxyUsersResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/PreferredCredential/ListPreferredCredentials" - err = common.PostProcessServiceError(err, "DbManagement", "ListPreferredCredentials", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListProxyUsers" + err = common.PostProcessServiceError(err, "DbManagement", "ListProxyUsers", apiReferenceLink) return response, err } @@ -6591,12 +7842,12 @@ func (client DbManagementClient) listPreferredCredentials(ctx context.Context, r return response, err } -// ListProxiedForUsers Gets the list of users on whose behalf the current user acts as proxy. +// ListRoles Gets the list of roles granted to a specific user. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListProxiedForUsers.go.html to see an example of how to use ListProxiedForUsers API. -func (client DbManagementClient) ListProxiedForUsers(ctx context.Context, request ListProxiedForUsersRequest) (response ListProxiedForUsersResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListRoles.go.html to see an example of how to use ListRoles API. +func (client DbManagementClient) ListRoles(ctx context.Context, request ListRolesRequest) (response ListRolesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6605,42 +7856,42 @@ func (client DbManagementClient) ListProxiedForUsers(ctx context.Context, reques if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listProxiedForUsers, policy) + ociResponse, err = common.Retry(ctx, request, client.listRoles, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListProxiedForUsersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListRolesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListProxiedForUsersResponse{} + response = ListRolesResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListProxiedForUsersResponse); ok { + if convertedResponse, ok := ociResponse.(ListRolesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListProxiedForUsersResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListRolesResponse") } return } -// listProxiedForUsers implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) listProxiedForUsers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listRoles implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) listRoles(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/users/{userName}/proxiedForUsers", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/users/{userName}/roles", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListProxiedForUsersResponse + var response ListRolesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListProxiedForUsers" - err = common.PostProcessServiceError(err, "DbManagement", "ListProxiedForUsers", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListRoles" + err = common.PostProcessServiceError(err, "DbManagement", "ListRoles", apiReferenceLink) return response, err } @@ -6648,56 +7899,57 @@ func (client DbManagementClient) listProxiedForUsers(ctx context.Context, reques return response, err } -// ListProxyUsers Gets the list of proxy users for the current user. +// ListSqlPlanBaselineJobs Lists the database jobs used for loading SQL plan baselines in the specified Managed Database. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListProxyUsers.go.html to see an example of how to use ListProxyUsers API. -func (client DbManagementClient) ListProxyUsers(ctx context.Context, request ListProxyUsersRequest) (response ListProxyUsersResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListSqlPlanBaselineJobs.go.html to see an example of how to use ListSqlPlanBaselineJobs API. +// A default retry strategy applies to this operation ListSqlPlanBaselineJobs() +func (client DbManagementClient) ListSqlPlanBaselineJobs(ctx context.Context, request ListSqlPlanBaselineJobsRequest) (response ListSqlPlanBaselineJobsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listProxyUsers, policy) + ociResponse, err = common.Retry(ctx, request, client.listSqlPlanBaselineJobs, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListProxyUsersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSqlPlanBaselineJobsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListProxyUsersResponse{} + response = ListSqlPlanBaselineJobsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListProxyUsersResponse); ok { + if convertedResponse, ok := ociResponse.(ListSqlPlanBaselineJobsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListProxyUsersResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSqlPlanBaselineJobsResponse") } return } -// listProxyUsers implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) listProxyUsers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSqlPlanBaselineJobs implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) listSqlPlanBaselineJobs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/users/{userName}/proxyUsers", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselineJobs", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListProxyUsersResponse + var response ListSqlPlanBaselineJobsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListProxyUsers" - err = common.PostProcessServiceError(err, "DbManagement", "ListProxyUsers", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListSqlPlanBaselineJobs" + err = common.PostProcessServiceError(err, "DbManagement", "ListSqlPlanBaselineJobs", apiReferenceLink) return response, err } @@ -6705,56 +7957,57 @@ func (client DbManagementClient) listProxyUsers(ctx context.Context, request com return response, err } -// ListRoles Gets the list of roles granted to a specific user. +// ListSqlPlanBaselines Lists the SQL plan baselines for the specified Managed Database. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListRoles.go.html to see an example of how to use ListRoles API. -func (client DbManagementClient) ListRoles(ctx context.Context, request ListRolesRequest) (response ListRolesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListSqlPlanBaselines.go.html to see an example of how to use ListSqlPlanBaselines API. +// A default retry strategy applies to this operation ListSqlPlanBaselines() +func (client DbManagementClient) ListSqlPlanBaselines(ctx context.Context, request ListSqlPlanBaselinesRequest) (response ListSqlPlanBaselinesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listRoles, policy) + ociResponse, err = common.Retry(ctx, request, client.listSqlPlanBaselines, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListRolesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSqlPlanBaselinesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListRolesResponse{} + response = ListSqlPlanBaselinesResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListRolesResponse); ok { + if convertedResponse, ok := ociResponse.(ListSqlPlanBaselinesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListRolesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSqlPlanBaselinesResponse") } return } -// listRoles implements the OCIOperation interface (enables retrying operations) -func (client DbManagementClient) listRoles(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSqlPlanBaselines implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) listSqlPlanBaselines(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/users/{userName}/roles", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListRolesResponse + var response ListSqlPlanBaselinesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListRoles" - err = common.PostProcessServiceError(err, "DbManagement", "ListRoles", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/ListSqlPlanBaselines" + err = common.PostProcessServiceError(err, "DbManagement", "ListSqlPlanBaselines", apiReferenceLink) return response, err } @@ -7162,6 +8415,126 @@ func (client DbManagementClient) listWorkRequests(ctx context.Context, request c return response, err } +// LoadSqlPlanBaselinesFromAwr Loads plans from Automatic Workload Repository (AWR) snapshots. You must +// specify the beginning and ending of the snapshot range. Optionally, you +// can apply a filter to load only plans that meet specified criteria. By +// default, the optimizer uses the loaded plans the next time that the database +// executes the SQL statements. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/LoadSqlPlanBaselinesFromAwr.go.html to see an example of how to use LoadSqlPlanBaselinesFromAwr API. +func (client DbManagementClient) LoadSqlPlanBaselinesFromAwr(ctx context.Context, request LoadSqlPlanBaselinesFromAwrRequest) (response LoadSqlPlanBaselinesFromAwrResponse, 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.loadSqlPlanBaselinesFromAwr, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = LoadSqlPlanBaselinesFromAwrResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = LoadSqlPlanBaselinesFromAwrResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(LoadSqlPlanBaselinesFromAwrResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into LoadSqlPlanBaselinesFromAwrResponse") + } + return +} + +// loadSqlPlanBaselinesFromAwr implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) loadSqlPlanBaselinesFromAwr(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/loadSqlPlanBaselinesFromAwr", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response LoadSqlPlanBaselinesFromAwrResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/LoadSqlPlanBaselinesFromAwr" + err = common.PostProcessServiceError(err, "DbManagement", "LoadSqlPlanBaselinesFromAwr", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// LoadSqlPlanBaselinesFromCursorCache Loads plans for statements directly from the shared SQL area, also called +// the cursor cache. By applying a filter on the module name, the schema, or +// the SQL ID you identify the SQL statement or set of SQL statements to load. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/LoadSqlPlanBaselinesFromCursorCache.go.html to see an example of how to use LoadSqlPlanBaselinesFromCursorCache API. +func (client DbManagementClient) LoadSqlPlanBaselinesFromCursorCache(ctx context.Context, request LoadSqlPlanBaselinesFromCursorCacheRequest) (response LoadSqlPlanBaselinesFromCursorCacheResponse, 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.loadSqlPlanBaselinesFromCursorCache, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = LoadSqlPlanBaselinesFromCursorCacheResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = LoadSqlPlanBaselinesFromCursorCacheResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(LoadSqlPlanBaselinesFromCursorCacheResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into LoadSqlPlanBaselinesFromCursorCacheResponse") + } + return +} + +// loadSqlPlanBaselinesFromCursorCache implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) loadSqlPlanBaselinesFromCursorCache(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselines/actions/loadSqlPlanBaselinesFromCursorCache", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response LoadSqlPlanBaselinesFromCursorCacheResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/LoadSqlPlanBaselinesFromCursorCache" + err = common.PostProcessServiceError(err, "DbManagement", "LoadSqlPlanBaselinesFromCursorCache", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // PatchExternalDbSystemDiscovery Patches the external DB system discovery specified by `externalDbSystemDiscoveryId`. // // See also @@ -8509,6 +9882,122 @@ func (client DbManagementClient) summarizeManagedDatabaseAvailabilityMetrics(ctx return response, err } +// SummarizeSqlPlanBaselines Gets the number of SQL plan baselines aggregated by their attributes. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/SummarizeSqlPlanBaselines.go.html to see an example of how to use SummarizeSqlPlanBaselines API. +// A default retry strategy applies to this operation SummarizeSqlPlanBaselines() +func (client DbManagementClient) SummarizeSqlPlanBaselines(ctx context.Context, request SummarizeSqlPlanBaselinesRequest) (response SummarizeSqlPlanBaselinesResponse, 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.summarizeSqlPlanBaselines, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeSqlPlanBaselinesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeSqlPlanBaselinesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeSqlPlanBaselinesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeSqlPlanBaselinesResponse") + } + return +} + +// summarizeSqlPlanBaselines implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) summarizeSqlPlanBaselines(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselineStats", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeSqlPlanBaselinesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/SummarizeSqlPlanBaselines" + err = common.PostProcessServiceError(err, "DbManagement", "SummarizeSqlPlanBaselines", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeSqlPlanBaselinesByLastExecution Gets the number of SQL plan baselines aggregated by the age of their last execution in weeks. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/SummarizeSqlPlanBaselinesByLastExecution.go.html to see an example of how to use SummarizeSqlPlanBaselinesByLastExecution API. +// A default retry strategy applies to this operation SummarizeSqlPlanBaselinesByLastExecution() +func (client DbManagementClient) SummarizeSqlPlanBaselinesByLastExecution(ctx context.Context, request SummarizeSqlPlanBaselinesByLastExecutionRequest) (response SummarizeSqlPlanBaselinesByLastExecutionResponse, 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.summarizeSqlPlanBaselinesByLastExecution, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeSqlPlanBaselinesByLastExecutionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeSqlPlanBaselinesByLastExecutionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeSqlPlanBaselinesByLastExecutionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeSqlPlanBaselinesByLastExecutionResponse") + } + return +} + +// summarizeSqlPlanBaselinesByLastExecution implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) summarizeSqlPlanBaselinesByLastExecution(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/sqlPlanBaselineExecutionStats", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeSqlPlanBaselinesByLastExecutionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/ManagedDatabase/SummarizeSqlPlanBaselinesByLastExecution" + err = common.PostProcessServiceError(err, "DbManagement", "SummarizeSqlPlanBaselinesByLastExecution", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // TestPreferredCredential Tests the preferred credential. // // See also @@ -9022,7 +10511,7 @@ func (client DbManagementClient) updateExternalDbSystemDiscovery(ctx context.Con return response, err } -// UpdateExternalExadataInfrastructure Updates the details for the the Exadata infrastructure specified by externalExadataInfrastructureId. +// UpdateExternalExadataInfrastructure Updates the details for the Exadata infrastructure specified by externalExadataInfrastructureId. // // See also // @@ -9085,7 +10574,7 @@ func (client DbManagementClient) updateExternalExadataInfrastructure(ctx context return response, err } -// UpdateExternalExadataStorageConnector Updates the details for the storage server connector specified by exadataStorageConnectorId. +// UpdateExternalExadataStorageConnector Updates the Exadata storage server connector specified by exadataStorageConnectorId. // // See also // diff --git a/databasemanagement/dbm_resource.go b/databasemanagement/dbm_resource.go index e294e030b4..0447d3648f 100644 --- a/databasemanagement/dbm_resource.go +++ b/databasemanagement/dbm_resource.go @@ -18,34 +18,34 @@ import ( "strings" ) -// DbmResource The base exadata resource. +// DbmResource The base Exadata resource. type DbmResource interface { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. GetId() *string - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. GetDisplayName() *string - // The version of the resource. + // The version of the Exadata resource. GetVersion() *string - // The internal ID. + // The internal ID of the Exadata resource. GetInternalId() *string - // The status of the entity. + // The status of the Exadata resource. GetStatus() *string // The current lifecycle state of the database resource. GetLifecycleState() DbmResourceLifecycleStateEnum - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. GetTimeCreated() *common.SDKTime - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. GetTimeUpdated() *common.SDKTime - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. GetLifecycleDetails() *string // The additional details of the resource defined in `{"key": "value"}` format. diff --git a/databasemanagement/disable_automatic_initial_plan_capture_details.go b/databasemanagement/disable_automatic_initial_plan_capture_details.go new file mode 100644 index 0000000000..57d99d2702 --- /dev/null +++ b/databasemanagement/disable_automatic_initial_plan_capture_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DisableAutomaticInitialPlanCaptureDetails The details required to disable automatic initial plan capture. +type DisableAutomaticInitialPlanCaptureDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m DisableAutomaticInitialPlanCaptureDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DisableAutomaticInitialPlanCaptureDetails) 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 *DisableAutomaticInitialPlanCaptureDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/disable_automatic_initial_plan_capture_request_response.go b/databasemanagement/disable_automatic_initial_plan_capture_request_response.go new file mode 100644 index 0000000000..fb1da12845 --- /dev/null +++ b/databasemanagement/disable_automatic_initial_plan_capture_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableAutomaticInitialPlanCaptureRequest wrapper for the DisableAutomaticInitialPlanCapture operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableAutomaticInitialPlanCapture.go.html to see an example of how to use DisableAutomaticInitialPlanCaptureRequest. +type DisableAutomaticInitialPlanCaptureRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to disable automatic initial plan capture. + DisableAutomaticInitialPlanCaptureDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DisableAutomaticInitialPlanCaptureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableAutomaticInitialPlanCaptureRequest) 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 DisableAutomaticInitialPlanCaptureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableAutomaticInitialPlanCaptureRequest) 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 DisableAutomaticInitialPlanCaptureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableAutomaticInitialPlanCaptureResponse wrapper for the DisableAutomaticInitialPlanCapture operation +type DisableAutomaticInitialPlanCaptureResponse 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 DisableAutomaticInitialPlanCaptureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableAutomaticInitialPlanCaptureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/disable_automatic_spm_evolve_advisor_task_details.go b/databasemanagement/disable_automatic_spm_evolve_advisor_task_details.go new file mode 100644 index 0000000000..2c5f611c0c --- /dev/null +++ b/databasemanagement/disable_automatic_spm_evolve_advisor_task_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DisableAutomaticSpmEvolveAdvisorTaskDetails The details required to disable Automatic SPM Evolve Advisor task. +type DisableAutomaticSpmEvolveAdvisorTaskDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m DisableAutomaticSpmEvolveAdvisorTaskDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DisableAutomaticSpmEvolveAdvisorTaskDetails) 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 *DisableAutomaticSpmEvolveAdvisorTaskDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/disable_automatic_spm_evolve_advisor_task_request_response.go b/databasemanagement/disable_automatic_spm_evolve_advisor_task_request_response.go new file mode 100644 index 0000000000..68958a0c8d --- /dev/null +++ b/databasemanagement/disable_automatic_spm_evolve_advisor_task_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableAutomaticSpmEvolveAdvisorTaskRequest wrapper for the DisableAutomaticSpmEvolveAdvisorTask operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use DisableAutomaticSpmEvolveAdvisorTaskRequest. +type DisableAutomaticSpmEvolveAdvisorTaskRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to disable Automatic SPM Evolve Advisor task. + DisableAutomaticSpmEvolveAdvisorTaskDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DisableAutomaticSpmEvolveAdvisorTaskRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableAutomaticSpmEvolveAdvisorTaskRequest) 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 DisableAutomaticSpmEvolveAdvisorTaskRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableAutomaticSpmEvolveAdvisorTaskRequest) 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 DisableAutomaticSpmEvolveAdvisorTaskRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableAutomaticSpmEvolveAdvisorTaskResponse wrapper for the DisableAutomaticSpmEvolveAdvisorTask operation +type DisableAutomaticSpmEvolveAdvisorTaskResponse 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 DisableAutomaticSpmEvolveAdvisorTaskResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableAutomaticSpmEvolveAdvisorTaskResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/disable_external_db_system_stack_monitoring_request_response.go b/databasemanagement/disable_external_db_system_stack_monitoring_request_response.go new file mode 100644 index 0000000000..8f1509563e --- /dev/null +++ b/databasemanagement/disable_external_db_system_stack_monitoring_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableExternalDbSystemStackMonitoringRequest wrapper for the DisableExternalDbSystemStackMonitoring operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableExternalDbSystemStackMonitoring.go.html to see an example of how to use DisableExternalDbSystemStackMonitoringRequest. +type DisableExternalDbSystemStackMonitoringRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the external DB system. + ExternalDbSystemId *string `mandatory:"true" contributesTo:"path" name:"externalDbSystemId"` + + // 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 DisableExternalDbSystemStackMonitoringRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableExternalDbSystemStackMonitoringRequest) 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 DisableExternalDbSystemStackMonitoringRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableExternalDbSystemStackMonitoringRequest) 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 DisableExternalDbSystemStackMonitoringRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableExternalDbSystemStackMonitoringResponse wrapper for the DisableExternalDbSystemStackMonitoring operation +type DisableExternalDbSystemStackMonitoringResponse 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 DisableExternalDbSystemStackMonitoringResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableExternalDbSystemStackMonitoringResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/disable_high_frequency_automatic_spm_evolve_advisor_task_details.go b/databasemanagement/disable_high_frequency_automatic_spm_evolve_advisor_task_details.go new file mode 100644 index 0000000000..cd8dc6e983 --- /dev/null +++ b/databasemanagement/disable_high_frequency_automatic_spm_evolve_advisor_task_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails The details required to disable high frequency Automatic SPM Evolve Advisor task. +type DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails) 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 *DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/disable_high_frequency_automatic_spm_evolve_advisor_task_request_response.go b/databasemanagement/disable_high_frequency_automatic_spm_evolve_advisor_task_request_response.go new file mode 100644 index 0000000000..c588cbbad1 --- /dev/null +++ b/databasemanagement/disable_high_frequency_automatic_spm_evolve_advisor_task_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest wrapper for the DisableHighFrequencyAutomaticSpmEvolveAdvisorTask operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableHighFrequencyAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest. +type DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to disable high frequency Automatic SPM Evolve Advisor task. + DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) 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 DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) 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 DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse wrapper for the DisableHighFrequencyAutomaticSpmEvolveAdvisorTask operation +type DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse 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 DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/disable_sql_plan_baselines_usage_details.go b/databasemanagement/disable_sql_plan_baselines_usage_details.go new file mode 100644 index 0000000000..66dbe8eaf7 --- /dev/null +++ b/databasemanagement/disable_sql_plan_baselines_usage_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DisableSqlPlanBaselinesUsageDetails The details required to disable SQL plan baseline usage. +type DisableSqlPlanBaselinesUsageDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m DisableSqlPlanBaselinesUsageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DisableSqlPlanBaselinesUsageDetails) 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 *DisableSqlPlanBaselinesUsageDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/disable_sql_plan_baselines_usage_request_response.go b/databasemanagement/disable_sql_plan_baselines_usage_request_response.go new file mode 100644 index 0000000000..12cbaefac5 --- /dev/null +++ b/databasemanagement/disable_sql_plan_baselines_usage_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableSqlPlanBaselinesUsageRequest wrapper for the DisableSqlPlanBaselinesUsage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableSqlPlanBaselinesUsage.go.html to see an example of how to use DisableSqlPlanBaselinesUsageRequest. +type DisableSqlPlanBaselinesUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to disable SQL plan baseline usage. + DisableSqlPlanBaselinesUsageDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DisableSqlPlanBaselinesUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableSqlPlanBaselinesUsageRequest) 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 DisableSqlPlanBaselinesUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableSqlPlanBaselinesUsageRequest) 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 DisableSqlPlanBaselinesUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableSqlPlanBaselinesUsageResponse wrapper for the DisableSqlPlanBaselinesUsage operation +type DisableSqlPlanBaselinesUsageResponse 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 DisableSqlPlanBaselinesUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableSqlPlanBaselinesUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/discover_external_exadata_infrastructure_details.go b/databasemanagement/discover_external_exadata_infrastructure_details.go index 5bb2b5a74d..a1327c9ee9 100644 --- a/databasemanagement/discover_external_exadata_infrastructure_details.go +++ b/databasemanagement/discover_external_exadata_infrastructure_details.go @@ -17,19 +17,19 @@ import ( "strings" ) -// DiscoverExternalExadataInfrastructureDetails The connection information and the discovery options for the Exadata discovery. +// DiscoverExternalExadataInfrastructureDetails The connection details and the discovery options for the Exadata discovery. type DiscoverExternalExadataInfrastructureDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The type of the discovery. + // The type of discovery. DiscoveryType DiscoverExternalExadataInfrastructureDetailsDiscoveryTypeEnum `mandatory:"true" json:"discoveryType"` - // The list of the database system identifiers. + // The list of the DB system identifiers. DbSystemIds []string `mandatory:"true" json:"dbSystemIds"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of Exadata infrastructure system. For rediscover only. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. This is applicable for rediscovery only. ExadataInfrastructureId *string `mandatory:"false" json:"exadataInfrastructureId"` } diff --git a/databasemanagement/discover_external_exadata_infrastructure_request_response.go b/databasemanagement/discover_external_exadata_infrastructure_request_response.go index edbb2eaeb2..c61fc8beb9 100644 --- a/databasemanagement/discover_external_exadata_infrastructure_request_response.go +++ b/databasemanagement/discover_external_exadata_infrastructure_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DiscoverExternalExadataInfrastructure.go.html to see an example of how to use DiscoverExternalExadataInfrastructureRequest. type DiscoverExternalExadataInfrastructureRequest struct { - // The details required to discover and monitor the Exadata system infrastructure. + // The details required to discover and monitor the Exadata infrastructure. DiscoverExternalExadataInfrastructureDetails `contributesTo:"body"` // The client request ID for tracing. diff --git a/databasemanagement/drop_sql_plan_baselines_details.go b/databasemanagement/drop_sql_plan_baselines_details.go new file mode 100644 index 0000000000..7fbfd74030 --- /dev/null +++ b/databasemanagement/drop_sql_plan_baselines_details.go @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DropSqlPlanBaselinesDetails The details required to drop SQL plan baselines. +type DropSqlPlanBaselinesDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` + + // The SQL statement handle. It identifies plans associated with a SQL statement + // that are to be dropped. If `null` then `planName` must be specified. + SqlHandle *string `mandatory:"false" json:"sqlHandle"` + + // The plan name. It identifies a specific plan. If `null' then all plans + // associated with the SQL statement identified by `sqlHandle' are dropped. + PlanName *string `mandatory:"false" json:"planName"` +} + +func (m DropSqlPlanBaselinesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DropSqlPlanBaselinesDetails) 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 *DropSqlPlanBaselinesDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + SqlHandle *string `json:"sqlHandle"` + PlanName *string `json:"planName"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.SqlHandle = model.SqlHandle + + m.PlanName = model.PlanName + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/drop_sql_plan_baselines_request_response.go b/databasemanagement/drop_sql_plan_baselines_request_response.go new file mode 100644 index 0000000000..a26d470ee2 --- /dev/null +++ b/databasemanagement/drop_sql_plan_baselines_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DropSqlPlanBaselinesRequest wrapper for the DropSqlPlanBaselines operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DropSqlPlanBaselines.go.html to see an example of how to use DropSqlPlanBaselinesRequest. +type DropSqlPlanBaselinesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to drop SQL plan baselines. + DropSqlPlanBaselinesDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DropSqlPlanBaselinesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DropSqlPlanBaselinesRequest) 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 DropSqlPlanBaselinesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DropSqlPlanBaselinesRequest) 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 DropSqlPlanBaselinesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DropSqlPlanBaselinesResponse wrapper for the DropSqlPlanBaselines operation +type DropSqlPlanBaselinesResponse 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 DropSqlPlanBaselinesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DropSqlPlanBaselinesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/enable_automatic_initial_plan_capture_details.go b/databasemanagement/enable_automatic_initial_plan_capture_details.go new file mode 100644 index 0000000000..8e4fed9d2f --- /dev/null +++ b/databasemanagement/enable_automatic_initial_plan_capture_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableAutomaticInitialPlanCaptureDetails The details required to enable automatic initial plan capture. +type EnableAutomaticInitialPlanCaptureDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m EnableAutomaticInitialPlanCaptureDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnableAutomaticInitialPlanCaptureDetails) 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 *EnableAutomaticInitialPlanCaptureDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/enable_automatic_initial_plan_capture_request_response.go b/databasemanagement/enable_automatic_initial_plan_capture_request_response.go new file mode 100644 index 0000000000..f8524adab1 --- /dev/null +++ b/databasemanagement/enable_automatic_initial_plan_capture_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableAutomaticInitialPlanCaptureRequest wrapper for the EnableAutomaticInitialPlanCapture operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableAutomaticInitialPlanCapture.go.html to see an example of how to use EnableAutomaticInitialPlanCaptureRequest. +type EnableAutomaticInitialPlanCaptureRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to enable automatic initial plan capture. + EnableAutomaticInitialPlanCaptureDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EnableAutomaticInitialPlanCaptureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableAutomaticInitialPlanCaptureRequest) 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 EnableAutomaticInitialPlanCaptureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableAutomaticInitialPlanCaptureRequest) 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 EnableAutomaticInitialPlanCaptureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableAutomaticInitialPlanCaptureResponse wrapper for the EnableAutomaticInitialPlanCapture operation +type EnableAutomaticInitialPlanCaptureResponse 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 EnableAutomaticInitialPlanCaptureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableAutomaticInitialPlanCaptureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/enable_automatic_spm_evolve_advisor_task_details.go b/databasemanagement/enable_automatic_spm_evolve_advisor_task_details.go new file mode 100644 index 0000000000..75e7eebf8c --- /dev/null +++ b/databasemanagement/enable_automatic_spm_evolve_advisor_task_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableAutomaticSpmEvolveAdvisorTaskDetails The details required to enable Automatic SPM Evolve Advisor task. +type EnableAutomaticSpmEvolveAdvisorTaskDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m EnableAutomaticSpmEvolveAdvisorTaskDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnableAutomaticSpmEvolveAdvisorTaskDetails) 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 *EnableAutomaticSpmEvolveAdvisorTaskDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/enable_automatic_spm_evolve_advisor_task_request_response.go b/databasemanagement/enable_automatic_spm_evolve_advisor_task_request_response.go new file mode 100644 index 0000000000..49d1413d79 --- /dev/null +++ b/databasemanagement/enable_automatic_spm_evolve_advisor_task_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableAutomaticSpmEvolveAdvisorTaskRequest wrapper for the EnableAutomaticSpmEvolveAdvisorTask operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use EnableAutomaticSpmEvolveAdvisorTaskRequest. +type EnableAutomaticSpmEvolveAdvisorTaskRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to enable Automatic SPM Evolve Advisor task. + EnableAutomaticSpmEvolveAdvisorTaskDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EnableAutomaticSpmEvolveAdvisorTaskRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableAutomaticSpmEvolveAdvisorTaskRequest) 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 EnableAutomaticSpmEvolveAdvisorTaskRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableAutomaticSpmEvolveAdvisorTaskRequest) 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 EnableAutomaticSpmEvolveAdvisorTaskRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableAutomaticSpmEvolveAdvisorTaskResponse wrapper for the EnableAutomaticSpmEvolveAdvisorTask operation +type EnableAutomaticSpmEvolveAdvisorTaskResponse 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 EnableAutomaticSpmEvolveAdvisorTaskResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableAutomaticSpmEvolveAdvisorTaskResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/enable_external_db_system_stack_monitoring_details.go b/databasemanagement/enable_external_db_system_stack_monitoring_details.go new file mode 100644 index 0000000000..df230336bd --- /dev/null +++ b/databasemanagement/enable_external_db_system_stack_monitoring_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableExternalDbSystemStackMonitoringDetails The details required to enable Stack Monitoring for an external DB system. +type EnableExternalDbSystemStackMonitoringDetails struct { + + // The status of the associated service. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The associated service-specific inputs in JSON string format, which Database Management can identify. + Metadata *string `mandatory:"false" json:"metadata"` +} + +func (m EnableExternalDbSystemStackMonitoringDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnableExternalDbSystemStackMonitoringDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/enable_external_db_system_stack_monitoring_request_response.go b/databasemanagement/enable_external_db_system_stack_monitoring_request_response.go new file mode 100644 index 0000000000..fe254124ed --- /dev/null +++ b/databasemanagement/enable_external_db_system_stack_monitoring_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableExternalDbSystemStackMonitoringRequest wrapper for the EnableExternalDbSystemStackMonitoring operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableExternalDbSystemStackMonitoring.go.html to see an example of how to use EnableExternalDbSystemStackMonitoringRequest. +type EnableExternalDbSystemStackMonitoringRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the external DB system. + ExternalDbSystemId *string `mandatory:"true" contributesTo:"path" name:"externalDbSystemId"` + + // The details required to enable Stack Monitoring for an external DB system. + EnableExternalDbSystemStackMonitoringDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EnableExternalDbSystemStackMonitoringRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableExternalDbSystemStackMonitoringRequest) 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 EnableExternalDbSystemStackMonitoringRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableExternalDbSystemStackMonitoringRequest) 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 EnableExternalDbSystemStackMonitoringRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableExternalDbSystemStackMonitoringResponse wrapper for the EnableExternalDbSystemStackMonitoring operation +type EnableExternalDbSystemStackMonitoringResponse 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 EnableExternalDbSystemStackMonitoringResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableExternalDbSystemStackMonitoringResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/enable_external_exadata_infrastructure_management_details.go b/databasemanagement/enable_external_exadata_infrastructure_management_details.go index 56f023f131..78c1312b10 100644 --- a/databasemanagement/enable_external_exadata_infrastructure_management_details.go +++ b/databasemanagement/enable_external_exadata_infrastructure_management_details.go @@ -17,7 +17,7 @@ import ( "strings" ) -// EnableExternalExadataInfrastructureManagementDetails Details to enable Management on an Exadata infrastructure. +// EnableExternalExadataInfrastructureManagementDetails The details required to enable Database Management on the Exadata infrastructure. type EnableExternalExadataInfrastructureManagementDetails struct { // The Oracle license model. diff --git a/databasemanagement/enable_external_exadata_infrastructure_management_request_response.go b/databasemanagement/enable_external_exadata_infrastructure_management_request_response.go index 69e7dd3731..1fd3377bb7 100644 --- a/databasemanagement/enable_external_exadata_infrastructure_management_request_response.go +++ b/databasemanagement/enable_external_exadata_infrastructure_management_request_response.go @@ -21,7 +21,7 @@ type EnableExternalExadataInfrastructureManagementRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. ExternalExadataInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"externalExadataInfrastructureId"` - // The details required to enable the management for the Exadata infrastructure. + // The details required to enable management for the Exadata infrastructure. EnableExternalExadataInfrastructureManagementDetails `contributesTo:"body"` // The client request ID for tracing. diff --git a/databasemanagement/enable_high_frequency_automatic_spm_evolve_advisor_task_details.go b/databasemanagement/enable_high_frequency_automatic_spm_evolve_advisor_task_details.go new file mode 100644 index 0000000000..ed3c867bac --- /dev/null +++ b/databasemanagement/enable_high_frequency_automatic_spm_evolve_advisor_task_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails The details required to enable high frequency Automatic SPM Evolve Advisor task. +type EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails) 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 *EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/enable_high_frequency_automatic_spm_evolve_advisor_task_request_response.go b/databasemanagement/enable_high_frequency_automatic_spm_evolve_advisor_task_request_response.go new file mode 100644 index 0000000000..000f9ead43 --- /dev/null +++ b/databasemanagement/enable_high_frequency_automatic_spm_evolve_advisor_task_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest wrapper for the EnableHighFrequencyAutomaticSpmEvolveAdvisorTask operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableHighFrequencyAutomaticSpmEvolveAdvisorTask.go.html to see an example of how to use EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest. +type EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to enable high frequency Automatic SPM Evolve Advisor task. + EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) 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 EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) 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 EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse wrapper for the EnableHighFrequencyAutomaticSpmEvolveAdvisorTask operation +type EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse 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 EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableHighFrequencyAutomaticSpmEvolveAdvisorTaskResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/enable_sql_plan_baselines_usage_details.go b/databasemanagement/enable_sql_plan_baselines_usage_details.go new file mode 100644 index 0000000000..a18917d37c --- /dev/null +++ b/databasemanagement/enable_sql_plan_baselines_usage_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableSqlPlanBaselinesUsageDetails The details required to enable SQL plan baseline usage. +type EnableSqlPlanBaselinesUsageDetails struct { + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` +} + +func (m EnableSqlPlanBaselinesUsageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnableSqlPlanBaselinesUsageDetails) 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 *EnableSqlPlanBaselinesUsageDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/enable_sql_plan_baselines_usage_request_response.go b/databasemanagement/enable_sql_plan_baselines_usage_request_response.go new file mode 100644 index 0000000000..dd63f7f397 --- /dev/null +++ b/databasemanagement/enable_sql_plan_baselines_usage_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableSqlPlanBaselinesUsageRequest wrapper for the EnableSqlPlanBaselinesUsage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableSqlPlanBaselinesUsage.go.html to see an example of how to use EnableSqlPlanBaselinesUsageRequest. +type EnableSqlPlanBaselinesUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to enable SQL plan baseline usage. + EnableSqlPlanBaselinesUsageDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EnableSqlPlanBaselinesUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableSqlPlanBaselinesUsageRequest) 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 EnableSqlPlanBaselinesUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableSqlPlanBaselinesUsageRequest) 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 EnableSqlPlanBaselinesUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableSqlPlanBaselinesUsageResponse wrapper for the EnableSqlPlanBaselinesUsage operation +type EnableSqlPlanBaselinesUsageResponse 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 EnableSqlPlanBaselinesUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableSqlPlanBaselinesUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/entity_discovered.go b/databasemanagement/entity_discovered.go index 3f9384cab0..5c6b06e6dc 100644 --- a/databasemanagement/entity_discovered.go +++ b/databasemanagement/entity_discovered.go @@ -18,16 +18,16 @@ import ( "strings" ) -// EntityDiscovered The base discover entity. +// EntityDiscovered The details of the base entity discovery. type EntityDiscovered interface { // The name of the entity. GetDisplayName() *string - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Null for new discover case. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the entity discovered. GetId() *string - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent could be used for monitoring. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent used for monitoring. GetAgentId() *string // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated connector. @@ -36,19 +36,19 @@ type EntityDiscovered interface { // The version of the entity. GetVersion() *string - // The internal identifier. + // The internal identifier of the entity. GetInternalId() *string // The status of the entity. GetStatus() *string - // The status of the entity discover. + // The status of the entity discovery. GetDiscoverStatus() EntityDiscoveredDiscoverStatusEnum - // The error code of the discovery on the resource + // The error code of the discovery. GetDiscoverErrorCode() *string - // The error message of the discovery on the resource + // The error message of the discovery. GetDiscoverErrorMsg() *string } diff --git a/databasemanagement/external_database_system_discovery_summary.go b/databasemanagement/external_database_system_discovery_summary.go index d168e3a213..113765bc0a 100644 --- a/databasemanagement/external_database_system_discovery_summary.go +++ b/databasemanagement/external_database_system_discovery_summary.go @@ -18,16 +18,16 @@ import ( "strings" ) -// ExternalDatabaseSystemDiscoverySummary The summary of the database system. +// ExternalDatabaseSystemDiscoverySummary The summary of the DB system discovery. type ExternalDatabaseSystemDiscoverySummary struct { // The name of the entity. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Null for new discover case. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the entity discovered. Id *string `mandatory:"false" json:"id"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent could be used for monitoring. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent used for monitoring. AgentId *string `mandatory:"false" json:"agentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated connector. @@ -36,31 +36,31 @@ type ExternalDatabaseSystemDiscoverySummary struct { // The version of the entity. Version *string `mandatory:"false" json:"version"` - // The internal identifier. + // The internal identifier of the entity. InternalId *string `mandatory:"false" json:"internalId"` // The status of the entity. Status *string `mandatory:"false" json:"status"` - // The error code of the discovery on the resource + // The error code of the discovery. DiscoverErrorCode *string `mandatory:"false" json:"discoverErrorCode"` - // The error message of the discovery on the resource + // The error message of the discovery. DiscoverErrorMsg *string `mandatory:"false" json:"discoverErrorMsg"` // The Oracle home path. OracleHome *string `mandatory:"false" json:"oracleHome"` - // The display name of ASM connector. + // The display name of the ASM connector. AsmConnectorName *string `mandatory:"false" json:"asmConnectorName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` // The Oracle license model that applies to the database management resources. LicenseModel ExternalDatabaseSystemDiscoverySummaryLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` - // The status of the entity discover. + // The status of the entity discovery. DiscoverStatus EntityDiscoveredDiscoverStatusEnum `mandatory:"false" json:"discoverStatus,omitempty"` } diff --git a/databasemanagement/external_db_system.go b/databasemanagement/external_db_system.go index 893b851935..2c0983a375 100644 --- a/databasemanagement/external_db_system.go +++ b/databasemanagement/external_db_system.go @@ -53,6 +53,8 @@ type ExternalDbSystem struct { DatabaseManagementConfig *ExternalDbSystemDatabaseManagementConfigDetails `mandatory:"false" json:"databaseManagementConfig"` + StackMonitoringConfig *ExternalDbSystemStackMonitoringConfigDetails `mandatory:"false" json:"stackMonitoringConfig"` + // Additional information about the current lifecycle state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` } diff --git a/databasemanagement/external_db_system_stack_monitoring_config_details.go b/databasemanagement/external_db_system_stack_monitoring_config_details.go new file mode 100644 index 0000000000..b8aa32d387 --- /dev/null +++ b/databasemanagement/external_db_system_stack_monitoring_config_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalDbSystemStackMonitoringConfigDetails The configuration details of Stack Monitoring for an external DB system. +type ExternalDbSystemStackMonitoringConfigDetails struct { + + // The status of the associated service. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The associated service-specific inputs in JSON string format, which Database Management can identify. + Metadata *string `mandatory:"false" json:"metadata"` +} + +func (m ExternalDbSystemStackMonitoringConfigDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExternalDbSystemStackMonitoringConfigDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/external_exadata_database_system_summary.go b/databasemanagement/external_exadata_database_system_summary.go index 4e9c873025..d6c93aca07 100644 --- a/databasemanagement/external_exadata_database_system_summary.go +++ b/databasemanagement/external_exadata_database_system_summary.go @@ -18,38 +18,38 @@ import ( "strings" ) -// ExternalExadataDatabaseSystemSummary The database system of the Exadata infrastructure. +// ExternalExadataDatabaseSystemSummary The DB systems of the Exadata infrastructure. type ExternalExadataDatabaseSystemSummary struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` // The Oracle license model that applies to the database management resources. diff --git a/databasemanagement/external_exadata_infrastructure.go b/databasemanagement/external_exadata_infrastructure.go index 326b3f614d..0ebf49b1c4 100644 --- a/databasemanagement/external_exadata_infrastructure.go +++ b/databasemanagement/external_exadata_infrastructure.go @@ -18,46 +18,46 @@ import ( "strings" ) -// ExternalExadataInfrastructure The Exadata infrastructure details. +// ExternalExadataInfrastructure The details of the Exadata infrastructure. type ExternalExadataInfrastructure struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` StorageGrid *ExternalExadataStorageGridSummary `mandatory:"false" json:"storageGrid"` - // A list of database systems. + // A list of DB systems. DatabaseSystems []ExternalExadataDatabaseSystemSummary `mandatory:"false" json:"databaseSystems"` - // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartments + // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartments. DatabaseCompartments []string `mandatory:"false" json:"databaseCompartments"` // The rack size of the Exadata infrastructure. diff --git a/databasemanagement/external_exadata_infrastructure_collection.go b/databasemanagement/external_exadata_infrastructure_collection.go index 0da64a9780..0d26198eb6 100644 --- a/databasemanagement/external_exadata_infrastructure_collection.go +++ b/databasemanagement/external_exadata_infrastructure_collection.go @@ -17,10 +17,10 @@ import ( "strings" ) -// ExternalExadataInfrastructureCollection The Exadata infrastructure list. +// ExternalExadataInfrastructureCollection A list of the Exadata infrastructure resources. type ExternalExadataInfrastructureCollection struct { - // A list of Exadata infrastructure. + // A list of Exadata infrastructures. Items []ExternalExadataInfrastructureSummary `mandatory:"true" json:"items"` } diff --git a/databasemanagement/external_exadata_infrastructure_discovery.go b/databasemanagement/external_exadata_infrastructure_discovery.go index 2dbb204125..f5b7eddd42 100644 --- a/databasemanagement/external_exadata_infrastructure_discovery.go +++ b/databasemanagement/external_exadata_infrastructure_discovery.go @@ -18,7 +18,7 @@ import ( "strings" ) -// ExternalExadataInfrastructureDiscovery The discovery result of the Exadata infrastructure. +// ExternalExadataInfrastructureDiscovery The result of the Exadata infrastructure discovery. type ExternalExadataInfrastructureDiscovery struct { // The name of the entity. @@ -27,10 +27,10 @@ type ExternalExadataInfrastructureDiscovery struct { // The unique key of the discovery request. DiscoveryKey *string `mandatory:"true" json:"discoveryKey"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Null for new discover case. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the entity discovered. Id *string `mandatory:"false" json:"id"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent could be used for monitoring. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent used for monitoring. AgentId *string `mandatory:"false" json:"agentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated connector. @@ -39,30 +39,30 @@ type ExternalExadataInfrastructureDiscovery struct { // The version of the entity. Version *string `mandatory:"false" json:"version"` - // The internal identifier. + // The internal identifier of the entity. InternalId *string `mandatory:"false" json:"internalId"` // The status of the entity. Status *string `mandatory:"false" json:"status"` - // The error code of the discovery on the resource + // The error code of the discovery. DiscoverErrorCode *string `mandatory:"false" json:"discoverErrorCode"` - // The error message of the discovery on the resource + // The error message of the discovery. DiscoverErrorMsg *string `mandatory:"false" json:"discoverErrorMsg"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` - // The Oracle home path of the infrastructure. + // The Oracle home path of the Exadata infrastructure. GridHomePath *string `mandatory:"false" json:"gridHomePath"` - // The list of all the rac database systems. + // The list of DB systems in the Exadata infrastructure. DbSystems []ExternalDatabaseSystemDiscoverySummary `mandatory:"false" json:"dbSystems"` StorageGrid *ExternalStorageGridDiscoverySummary `mandatory:"false" json:"storageGrid"` - // The list of all the storage servers. + // The list of storage servers in the Exadata infrastructure. StorageServers []ExternalStorageServerDiscoverySummary `mandatory:"false" json:"storageServers"` // The Oracle license model that applies to the database management resources. @@ -71,7 +71,7 @@ type ExternalExadataInfrastructureDiscovery struct { // The size of the Exadata infrastructure. RackSize ExternalExadataInfrastructureDiscoveryRackSizeEnum `mandatory:"false" json:"rackSize,omitempty"` - // The status of the entity discover. + // The status of the entity discovery. DiscoverStatus EntityDiscoveredDiscoverStatusEnum `mandatory:"false" json:"discoverStatus,omitempty"` } diff --git a/databasemanagement/external_exadata_infrastructure_discovery_summary.go b/databasemanagement/external_exadata_infrastructure_discovery_summary.go index 9f483302fc..d2a5c23a9e 100644 --- a/databasemanagement/external_exadata_infrastructure_discovery_summary.go +++ b/databasemanagement/external_exadata_infrastructure_discovery_summary.go @@ -18,16 +18,16 @@ import ( "strings" ) -// ExternalExadataInfrastructureDiscoverySummary The discovery result for the Exadata system infrastructure. +// ExternalExadataInfrastructureDiscoverySummary The summary of the Exadata system infrastructure discovery. type ExternalExadataInfrastructureDiscoverySummary struct { // The name of the entity. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Null for new discover case. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the entity discovered. Id *string `mandatory:"false" json:"id"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent could be used for monitoring. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent used for monitoring. AgentId *string `mandatory:"false" json:"agentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated connector. @@ -36,22 +36,22 @@ type ExternalExadataInfrastructureDiscoverySummary struct { // The version of the entity. Version *string `mandatory:"false" json:"version"` - // The internal identifier. + // The internal identifier of the entity. InternalId *string `mandatory:"false" json:"internalId"` // The status of the entity. Status *string `mandatory:"false" json:"status"` - // The error code of the discovery on the resource + // The error code of the discovery. DiscoverErrorCode *string `mandatory:"false" json:"discoverErrorCode"` - // The error message of the discovery on the resource + // The error message of the discovery. DiscoverErrorMsg *string `mandatory:"false" json:"discoverErrorMsg"` // The size of the Exadata infrastructure. RackSize ExternalExadataInfrastructureDiscoverySummaryRackSizeEnum `mandatory:"false" json:"rackSize,omitempty"` - // The status of the entity discover. + // The status of the entity discovery. DiscoverStatus EntityDiscoveredDiscoverStatusEnum `mandatory:"false" json:"discoverStatus,omitempty"` } diff --git a/databasemanagement/external_exadata_infrastructure_summary.go b/databasemanagement/external_exadata_infrastructure_summary.go index d734bf1406..440de1eeed 100644 --- a/databasemanagement/external_exadata_infrastructure_summary.go +++ b/databasemanagement/external_exadata_infrastructure_summary.go @@ -24,28 +24,28 @@ type ExternalExadataInfrastructureSummary struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. diff --git a/databasemanagement/external_exadata_storage_connector.go b/databasemanagement/external_exadata_storage_connector.go index db89d018d4..b280c720ca 100644 --- a/databasemanagement/external_exadata_storage_connector.go +++ b/databasemanagement/external_exadata_storage_connector.go @@ -18,44 +18,44 @@ import ( "strings" ) -// ExternalExadataStorageConnector The connector of the storage server. +// ExternalExadataStorageConnector The details of the Exadata storage server connector. type ExternalExadataStorageConnector struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of Exadata infrastructure system. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. ExadataInfrastructureId *string `mandatory:"false" json:"exadataInfrastructureId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent for the Exadata storage server. AgentId *string `mandatory:"false" json:"agentId"` - // The unique connection string of the connection. For example, "https://slcm21celadm02.us.oracle.com:443/MS/RESTService/". + // The unique string of the connection. For example, "https:///MS/RESTService/". ConnectionUri *string `mandatory:"false" json:"connectionUri"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata storage server. diff --git a/databasemanagement/external_exadata_storage_connector_collection.go b/databasemanagement/external_exadata_storage_connector_collection.go index 36d412b4bf..a47aec1b1f 100644 --- a/databasemanagement/external_exadata_storage_connector_collection.go +++ b/databasemanagement/external_exadata_storage_connector_collection.go @@ -20,7 +20,7 @@ import ( // ExternalExadataStorageConnectorCollection The Exadata storage server connector list. type ExternalExadataStorageConnectorCollection struct { - // A list of Exadata storage server connector. + // A list of Exadata storage server connectors. Items []ExternalExadataStorageConnectorSummary `mandatory:"true" json:"items"` } diff --git a/databasemanagement/external_exadata_storage_connector_status.go b/databasemanagement/external_exadata_storage_connector_status.go index 50e69cbda4..c5cb734429 100644 --- a/databasemanagement/external_exadata_storage_connector_status.go +++ b/databasemanagement/external_exadata_storage_connector_status.go @@ -17,13 +17,13 @@ import ( "strings" ) -// ExternalExadataStorageConnectorStatus The status of a Exadata storage server connector. +// ExternalExadataStorageConnectorStatus The status of an Exadata storage server connector. type ExternalExadataStorageConnectorStatus struct { // The connection status of the connector. Status ExternalExadataStorageConnectorStatusStatusEnum `mandatory:"true" json:"status"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata storage connector. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata storage server connector. Id *string `mandatory:"false" json:"id"` // The error message indicating the reason for failure or `null` if the connection was successful. diff --git a/databasemanagement/external_exadata_storage_connector_summary.go b/databasemanagement/external_exadata_storage_connector_summary.go index a7129fd463..2b8ea85e49 100644 --- a/databasemanagement/external_exadata_storage_connector_summary.go +++ b/databasemanagement/external_exadata_storage_connector_summary.go @@ -18,38 +18,38 @@ import ( "strings" ) -// ExternalExadataStorageConnectorSummary The connector of the storage server. +// ExternalExadataStorageConnectorSummary The connector of the Exadata storage server. type ExternalExadataStorageConnectorSummary struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The unique connection string of the connection. For example, "https://slcm21celadm02.us.oracle.com:443/MS/RESTService/". + // The unique string of the connection. For example, "https:///MS/RESTService/". ConnectionUri *string `mandatory:"false" json:"connectionUri"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata storage server. diff --git a/databasemanagement/external_exadata_storage_grid.go b/databasemanagement/external_exadata_storage_grid.go index 18f0aa8a54..83ec6b44ef 100644 --- a/databasemanagement/external_exadata_storage_grid.go +++ b/databasemanagement/external_exadata_storage_grid.go @@ -18,44 +18,44 @@ import ( "strings" ) -// ExternalExadataStorageGrid The Exadata storage grid details. +// ExternalExadataStorageGrid The details of the Exadata storage server grid. type ExternalExadataStorageGrid struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of Exadata infrastructure system. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. ExadataInfrastructureId *string `mandatory:"false" json:"exadataInfrastructureId"` - // The number of the storage servers in the Exadata infrastructure. + // The number of Exadata storage servers in the Exadata infrastructure. ServerCount *float32 `mandatory:"false" json:"serverCount"` - // A list of monitored Exadata storage server. + // A list of monitored Exadata storage servers. StorageServers []ExternalExadataStorageServerSummary `mandatory:"false" json:"storageServers"` // The current lifecycle state of the database resource. diff --git a/databasemanagement/external_exadata_storage_grid_summary.go b/databasemanagement/external_exadata_storage_grid_summary.go index 0b0d5b8b63..138797faa2 100644 --- a/databasemanagement/external_exadata_storage_grid_summary.go +++ b/databasemanagement/external_exadata_storage_grid_summary.go @@ -18,38 +18,38 @@ import ( "strings" ) -// ExternalExadataStorageGridSummary The storage server grid of the Exadata infrastructure. +// ExternalExadataStorageGridSummary The Exadata storage server grid of the Exadata infrastructure. type ExternalExadataStorageGridSummary struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The number of the storage servers in the Exadata infrastructure. + // The number of Exadata storage servers in the Exadata infrastructure. ServerCount *float32 `mandatory:"false" json:"serverCount"` // The current lifecycle state of the database resource. diff --git a/databasemanagement/external_exadata_storage_server.go b/databasemanagement/external_exadata_storage_server.go index 0b41f76bb4..66be0f5663 100644 --- a/databasemanagement/external_exadata_storage_server.go +++ b/databasemanagement/external_exadata_storage_server.go @@ -18,65 +18,65 @@ import ( "strings" ) -// ExternalExadataStorageServer The Exadata storage server details. +// ExternalExadataStorageServer The details of the Exadata storage server. type ExternalExadataStorageServer struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of Exadata infrastructure system. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. ExadataInfrastructureId *string `mandatory:"false" json:"exadataInfrastructureId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of Exadata storage grid. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata storage server grid. StorageGridId *string `mandatory:"false" json:"storageGridId"` - // The make model of the storage server. + // The make model of the Exadata storage server. MakeModel *string `mandatory:"false" json:"makeModel"` - // The IP address of the storage server. + // The IP address of the Exadata storage server. IpAddress *string `mandatory:"false" json:"ipAddress"` - // CPU count of the storage server + // The CPU count of the Exadata storage server. CpuCount *float32 `mandatory:"false" json:"cpuCount"` - // Storage server memory size in GB + // The Exadata storage server memory size in GB. MemoryGB *float64 `mandatory:"false" json:"memoryGB"` - // Maximum hard disk IO operations per second of the storage server + // The maximum hard disk IO operations per second of the Exadata storage server. MaxHardDiskIOPS *int `mandatory:"false" json:"maxHardDiskIOPS"` - // Maximum hard disk IO throughput in MB/s of the storage server + // The maximum hard disk IO throughput in MB/s of the Exadata storage server. MaxHardDiskThroughput *int `mandatory:"false" json:"maxHardDiskThroughput"` - // Maximum flash disk IO operations per second of the storage server + // The maximum flash disk IO operations per second of the Exadata storage server. MaxFlashDiskIOPS *int `mandatory:"false" json:"maxFlashDiskIOPS"` - // Maximum flash disk IO throughput in MB/s of the storage server + // The maximum flash disk IO throughput in MB/s of the Exadata storage server. MaxFlashDiskThroughput *int `mandatory:"false" json:"maxFlashDiskThroughput"` Connector *ExternalExadataStorageConnectorSummary `mandatory:"false" json:"connector"` diff --git a/databasemanagement/external_exadata_storage_server_collection.go b/databasemanagement/external_exadata_storage_server_collection.go index 8e64a16ed0..a3f52812b5 100644 --- a/databasemanagement/external_exadata_storage_server_collection.go +++ b/databasemanagement/external_exadata_storage_server_collection.go @@ -20,7 +20,7 @@ import ( // ExternalExadataStorageServerCollection The Exadata storage server list. type ExternalExadataStorageServerCollection struct { - // A list of Exadata storage server. + // A list of Exadata storage servers. Items []ExternalExadataStorageServerSummary `mandatory:"true" json:"items"` } diff --git a/databasemanagement/external_exadata_storage_server_summary.go b/databasemanagement/external_exadata_storage_server_summary.go index 148a0e04ef..d9e23945a6 100644 --- a/databasemanagement/external_exadata_storage_server_summary.go +++ b/databasemanagement/external_exadata_storage_server_summary.go @@ -18,62 +18,62 @@ import ( "strings" ) -// ExternalExadataStorageServerSummary The storage server of the Exadata infrastructure. +// ExternalExadataStorageServerSummary The Exadata storage server of the Exadata infrastructure. type ExternalExadataStorageServerSummary struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata resource. Id *string `mandatory:"true" json:"id"` - // The name of the resource. English letters, numbers, "-", "_" and "." only. + // The name of the Exadata resource. English letters, numbers, "-", "_" and "." only. DisplayName *string `mandatory:"true" json:"displayName"` - // The version of the resource. + // The version of the Exadata resource. Version *string `mandatory:"false" json:"version"` - // The internal ID. + // The internal ID of the Exadata resource. InternalId *string `mandatory:"false" json:"internalId"` - // The status of the entity. + // The status of the Exadata resource. Status *string `mandatory:"false" json:"status"` - // The timestamp of the creation. + // The timestamp of the creation of the Exadata resource. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The timestamp of the last update. + // The timestamp of the last update of the Exadata resource. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The details of the lifecycle state. + // The details of the lifecycle state of the Exadata resource. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // The additional details of the resource defined in `{"key": "value"}` format. // Example: `{"bar-key": "value"}` AdditionalDetails map[string]string `mandatory:"false" json:"additionalDetails"` - // The make model of the storage server. + // The make model of the Exadata storage server. MakeModel *string `mandatory:"false" json:"makeModel"` - // The IP address of the storage server. + // The IP address of the Exadata storage server. IpAddress *string `mandatory:"false" json:"ipAddress"` - // The CPU count of the storage server + // The CPU count of the Exadata storage server. CpuCount *float32 `mandatory:"false" json:"cpuCount"` - // The storage server memory size in GB + // The Exadata storage server memory size in GB. MemoryGB *float64 `mandatory:"false" json:"memoryGB"` - // The maximum hard disk IO operations per second of the storage server + // The maximum hard disk IO operations per second of the Exadata storage server. MaxHardDiskIOPS *int `mandatory:"false" json:"maxHardDiskIOPS"` - // The maximum hard disk IO throughput in MB/s of the storage server + // The maximum hard disk IO throughput in MB/s of the Exadata storage server. MaxHardDiskThroughput *int `mandatory:"false" json:"maxHardDiskThroughput"` - // The maximum flash disk IO operations per second of the storage server + // The maximum flash disk IO operations per second of the Exadata storage server. MaxFlashDiskIOPS *int `mandatory:"false" json:"maxFlashDiskIOPS"` - // The maximum flash disk IO throughput in MB/s of the storage server + // The maximum flash disk IO throughput in MB/s of the Exadata storage server. MaxFlashDiskThroughput *int `mandatory:"false" json:"maxFlashDiskThroughput"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of connector. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the connector. ConnectorId *string `mandatory:"false" json:"connectorId"` // The current lifecycle state of the database resource. diff --git a/databasemanagement/external_storage_grid_discovery_summary.go b/databasemanagement/external_storage_grid_discovery_summary.go index a8451a9121..0cef3c80ce 100644 --- a/databasemanagement/external_storage_grid_discovery_summary.go +++ b/databasemanagement/external_storage_grid_discovery_summary.go @@ -18,16 +18,16 @@ import ( "strings" ) -// ExternalStorageGridDiscoverySummary The Exadata storage server grid. +// ExternalStorageGridDiscoverySummary The summary of the Exadata storage server grid discovery. type ExternalStorageGridDiscoverySummary struct { // The name of the entity. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Null for new discover case. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the entity discovered. Id *string `mandatory:"false" json:"id"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent could be used for monitoring. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent used for monitoring. AgentId *string `mandatory:"false" json:"agentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated connector. @@ -36,22 +36,22 @@ type ExternalStorageGridDiscoverySummary struct { // The version of the entity. Version *string `mandatory:"false" json:"version"` - // The internal identifier. + // The internal identifier of the entity. InternalId *string `mandatory:"false" json:"internalId"` // The status of the entity. Status *string `mandatory:"false" json:"status"` - // The error code of the discovery on the resource + // The error code of the discovery. DiscoverErrorCode *string `mandatory:"false" json:"discoverErrorCode"` - // The error message of the discovery on the resource + // The error message of the discovery. DiscoverErrorMsg *string `mandatory:"false" json:"discoverErrorMsg"` - // The total number of the storage servers discovered. + // The total number of Exadata storage servers discovered. CountOfStorageServersDiscovered *int `mandatory:"false" json:"countOfStorageServersDiscovered"` - // The status of the entity discover. + // The status of the entity discovery. DiscoverStatus EntityDiscoveredDiscoverStatusEnum `mandatory:"false" json:"discoverStatus,omitempty"` } diff --git a/databasemanagement/external_storage_server_discovery_summary.go b/databasemanagement/external_storage_server_discovery_summary.go index 60bdcd4a30..6253e1df56 100644 --- a/databasemanagement/external_storage_server_discovery_summary.go +++ b/databasemanagement/external_storage_server_discovery_summary.go @@ -18,16 +18,16 @@ import ( "strings" ) -// ExternalStorageServerDiscoverySummary The Exadata storage server. +// ExternalStorageServerDiscoverySummary The summary of the Exadata storage server discovery. type ExternalStorageServerDiscoverySummary struct { // The name of the entity. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Null for new discover case. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the entity discovered. Id *string `mandatory:"false" json:"id"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent could be used for monitoring. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the agent used for monitoring. AgentId *string `mandatory:"false" json:"agentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated connector. @@ -36,34 +36,34 @@ type ExternalStorageServerDiscoverySummary struct { // The version of the entity. Version *string `mandatory:"false" json:"version"` - // The internal identifier. + // The internal identifier of the entity. InternalId *string `mandatory:"false" json:"internalId"` // The status of the entity. Status *string `mandatory:"false" json:"status"` - // The error code of the discovery on the resource + // The error code of the discovery. DiscoverErrorCode *string `mandatory:"false" json:"discoverErrorCode"` - // The error message of the discovery on the resource + // The error message of the discovery. DiscoverErrorMsg *string `mandatory:"false" json:"discoverErrorMsg"` - // The IP address of the storage server. + // The IP address of the Exadata storage server. IpAddress *string `mandatory:"false" json:"ipAddress"` - // The make model of the storage server. + // The make model of the Exadata storage server. MakeModel *string `mandatory:"false" json:"makeModel"` - // The cpu count of the storage server. + // The CPU count of the Exadata storage server. CpuCount *int `mandatory:"false" json:"cpuCount"` - // The memory size in GB of the storage server. + // The memory size in GB of the Exadata storage server. MemoryGB *float64 `mandatory:"false" json:"memoryGB"` - // The connector name of the storage server in rediscovery case. + // The name of the Exadata storage server connector in case of rediscovery. ConnectorName *string `mandatory:"false" json:"connectorName"` - // The status of the entity discover. + // The status of the entity discovery. DiscoverStatus EntityDiscoveredDiscoverStatusEnum `mandatory:"false" json:"discoverStatus,omitempty"` } diff --git a/databasemanagement/get_sql_plan_baseline_configuration_request_response.go b/databasemanagement/get_sql_plan_baseline_configuration_request_response.go new file mode 100644 index 0000000000..6c87c81073 --- /dev/null +++ b/databasemanagement/get_sql_plan_baseline_configuration_request_response.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSqlPlanBaselineConfigurationRequest wrapper for the GetSqlPlanBaselineConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetSqlPlanBaselineConfiguration.go.html to see an example of how to use GetSqlPlanBaselineConfigurationRequest. +type GetSqlPlanBaselineConfigurationRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The 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 GetSqlPlanBaselineConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSqlPlanBaselineConfigurationRequest) 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 GetSqlPlanBaselineConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSqlPlanBaselineConfigurationRequest) 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 GetSqlPlanBaselineConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSqlPlanBaselineConfigurationResponse wrapper for the GetSqlPlanBaselineConfiguration operation +type GetSqlPlanBaselineConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SqlPlanBaselineConfiguration instance + SqlPlanBaselineConfiguration `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 GetSqlPlanBaselineConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSqlPlanBaselineConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/get_sql_plan_baseline_request_response.go b/databasemanagement/get_sql_plan_baseline_request_response.go new file mode 100644 index 0000000000..b5145ceb82 --- /dev/null +++ b/databasemanagement/get_sql_plan_baseline_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSqlPlanBaselineRequest wrapper for the GetSqlPlanBaseline operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetSqlPlanBaseline.go.html to see an example of how to use GetSqlPlanBaselineRequest. +type GetSqlPlanBaselineRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The plan name of the SQL plan baseline. + PlanName *string `mandatory:"true" contributesTo:"path" name:"planName"` + + // 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 GetSqlPlanBaselineRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSqlPlanBaselineRequest) 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 GetSqlPlanBaselineRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSqlPlanBaselineRequest) 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 GetSqlPlanBaselineRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSqlPlanBaselineResponse wrapper for the GetSqlPlanBaseline operation +type GetSqlPlanBaselineResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SqlPlanBaseline instance + SqlPlanBaseline `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 GetSqlPlanBaselineResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSqlPlanBaselineResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/iorm_plan.go b/databasemanagement/iorm_plan.go index e065cd064b..4e73d51c42 100644 --- a/databasemanagement/iorm_plan.go +++ b/databasemanagement/iorm_plan.go @@ -17,7 +17,7 @@ import ( "strings" ) -// IormPlan The IORM plan from a storage server. +// IormPlan The IORM plan from an Exadata storage server. type IormPlan struct { // The status of the IORM plan. diff --git a/databasemanagement/job_execution.go b/databasemanagement/job_execution.go index 4be7d9c9c7..27c05d3f6e 100644 --- a/databasemanagement/job_execution.go +++ b/databasemanagement/job_execution.go @@ -84,6 +84,10 @@ type JobExecution struct { // The SQL text executed as part of the job. SqlText *string `mandatory:"false" json:"sqlText"` + InBinds *JobInBindsDetails `mandatory:"false" json:"inBinds"` + + OutBinds *JobOutBindsDetails `mandatory:"false" json:"outBinds"` + ScheduleDetails *JobScheduleDetails `mandatory:"false" json:"scheduleDetails"` } @@ -132,6 +136,8 @@ func (m *JobExecution) UnmarshalJSON(data []byte) (e error) { TimeCompleted *common.SDKTime `json:"timeCompleted"` UserName *string `json:"userName"` SqlText *string `json:"sqlText"` + InBinds *JobInBindsDetails `json:"inBinds"` + OutBinds *JobOutBindsDetails `json:"outBinds"` ScheduleDetails *JobScheduleDetails `json:"scheduleDetails"` Id *string `json:"id"` Name *string `json:"name"` @@ -180,6 +186,10 @@ func (m *JobExecution) UnmarshalJSON(data []byte) (e error) { m.SqlText = model.SqlText + m.InBinds = model.InBinds + + m.OutBinds = model.OutBinds + m.ScheduleDetails = model.ScheduleDetails m.Id = model.Id diff --git a/databasemanagement/job_in_bind.go b/databasemanagement/job_in_bind.go new file mode 100644 index 0000000000..28bcceaa12 --- /dev/null +++ b/databasemanagement/job_in_bind.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JobInBind The details of the job in-bind variable. +type JobInBind struct { + + // The position of the in-bind variable. + Position *int `mandatory:"true" json:"position"` + + // The datatype of the in-bind variable. + DataType JobInBindDataTypeEnum `mandatory:"true" json:"dataType"` + + // The values for the in-bind variable. + Values []string `mandatory:"true" json:"values"` + + // The Oracle schema object name for the predefined type of array. + ArrayTypeName *string `mandatory:"false" json:"arrayTypeName"` +} + +func (m JobInBind) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JobInBind) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingJobInBindDataTypeEnum(string(m.DataType)); !ok && m.DataType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataType: %s. Supported values are: %s.", m.DataType, strings.Join(GetJobInBindDataTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// JobInBindDataTypeEnum Enum with underlying type: string +type JobInBindDataTypeEnum string + +// Set of constants representing the allowable values for JobInBindDataTypeEnum +const ( + JobInBindDataTypeNumber JobInBindDataTypeEnum = "NUMBER" + JobInBindDataTypeString JobInBindDataTypeEnum = "STRING" + JobInBindDataTypeClob JobInBindDataTypeEnum = "CLOB" +) + +var mappingJobInBindDataTypeEnum = map[string]JobInBindDataTypeEnum{ + "NUMBER": JobInBindDataTypeNumber, + "STRING": JobInBindDataTypeString, + "CLOB": JobInBindDataTypeClob, +} + +var mappingJobInBindDataTypeEnumLowerCase = map[string]JobInBindDataTypeEnum{ + "number": JobInBindDataTypeNumber, + "string": JobInBindDataTypeString, + "clob": JobInBindDataTypeClob, +} + +// GetJobInBindDataTypeEnumValues Enumerates the set of values for JobInBindDataTypeEnum +func GetJobInBindDataTypeEnumValues() []JobInBindDataTypeEnum { + values := make([]JobInBindDataTypeEnum, 0) + for _, v := range mappingJobInBindDataTypeEnum { + values = append(values, v) + } + return values +} + +// GetJobInBindDataTypeEnumStringValues Enumerates the set of values in String for JobInBindDataTypeEnum +func GetJobInBindDataTypeEnumStringValues() []string { + return []string{ + "NUMBER", + "STRING", + "CLOB", + } +} + +// GetMappingJobInBindDataTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingJobInBindDataTypeEnum(val string) (JobInBindDataTypeEnum, bool) { + enum, ok := mappingJobInBindDataTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/job_in_binds_details.go b/databasemanagement/job_in_binds_details.go new file mode 100644 index 0000000000..6d01be8219 --- /dev/null +++ b/databasemanagement/job_in_binds_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JobInBindsDetails A collection of job in-bind variables. +type JobInBindsDetails struct { + + // A list of JobInBind objects. + Items []JobInBind `mandatory:"true" json:"items"` +} + +func (m JobInBindsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JobInBindsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/job_out_bind.go b/databasemanagement/job_out_bind.go new file mode 100644 index 0000000000..814dd60343 --- /dev/null +++ b/databasemanagement/job_out_bind.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JobOutBind The details of the job out-bind variable. +type JobOutBind struct { + + // The position of the out-bind variable. + Position *int `mandatory:"true" json:"position"` + + // The datatype of the out-bind variable. + DataType JobOutBindDataTypeEnum `mandatory:"true" json:"dataType"` +} + +func (m JobOutBind) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JobOutBind) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingJobOutBindDataTypeEnum(string(m.DataType)); !ok && m.DataType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataType: %s. Supported values are: %s.", m.DataType, strings.Join(GetJobOutBindDataTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// JobOutBindDataTypeEnum Enum with underlying type: string +type JobOutBindDataTypeEnum string + +// Set of constants representing the allowable values for JobOutBindDataTypeEnum +const ( + JobOutBindDataTypeNumber JobOutBindDataTypeEnum = "NUMBER" + JobOutBindDataTypeString JobOutBindDataTypeEnum = "STRING" + JobOutBindDataTypeClob JobOutBindDataTypeEnum = "CLOB" +) + +var mappingJobOutBindDataTypeEnum = map[string]JobOutBindDataTypeEnum{ + "NUMBER": JobOutBindDataTypeNumber, + "STRING": JobOutBindDataTypeString, + "CLOB": JobOutBindDataTypeClob, +} + +var mappingJobOutBindDataTypeEnumLowerCase = map[string]JobOutBindDataTypeEnum{ + "number": JobOutBindDataTypeNumber, + "string": JobOutBindDataTypeString, + "clob": JobOutBindDataTypeClob, +} + +// GetJobOutBindDataTypeEnumValues Enumerates the set of values for JobOutBindDataTypeEnum +func GetJobOutBindDataTypeEnumValues() []JobOutBindDataTypeEnum { + values := make([]JobOutBindDataTypeEnum, 0) + for _, v := range mappingJobOutBindDataTypeEnum { + values = append(values, v) + } + return values +} + +// GetJobOutBindDataTypeEnumStringValues Enumerates the set of values in String for JobOutBindDataTypeEnum +func GetJobOutBindDataTypeEnumStringValues() []string { + return []string{ + "NUMBER", + "STRING", + "CLOB", + } +} + +// GetMappingJobOutBindDataTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingJobOutBindDataTypeEnum(val string) (JobOutBindDataTypeEnum, bool) { + enum, ok := mappingJobOutBindDataTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/job_out_binds_details.go b/databasemanagement/job_out_binds_details.go new file mode 100644 index 0000000000..fb4a70cd00 --- /dev/null +++ b/databasemanagement/job_out_binds_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JobOutBindsDetails A collection of job out-bind variables. +type JobOutBindsDetails struct { + + // A list of JobOutBind objects. + Items []JobOutBind `mandatory:"true" json:"items"` +} + +func (m JobOutBindsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JobOutBindsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/list_cursor_cache_statements_request_response.go b/databasemanagement/list_cursor_cache_statements_request_response.go new file mode 100644 index 0000000000..66fccbf668 --- /dev/null +++ b/databasemanagement/list_cursor_cache_statements_request_response.go @@ -0,0 +1,203 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCursorCacheStatementsRequest wrapper for the ListCursorCacheStatements operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListCursorCacheStatements.go.html to see an example of how to use ListCursorCacheStatementsRequest. +type ListCursorCacheStatementsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // A filter to return all the SQL plan baselines that match the SQL text. By default, the search + // is case insensitive. To run an exact or case-sensitive search, double-quote the search string. + // You may also use the '%' symbol as a wildcard. + SqlText *string `mandatory:"false" contributesTo:"query" name:"sqlText"` + + // The page token representing the page from where the next set of paginated results + // are retrieved. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of records returned in the paginated response. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The option to sort the SQL statement summary data. + SortBy ListCursorCacheStatementsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The option to sort information in ascending (‘ASC’) or descending (‘DESC’) order. Ascending order is the default order. + SortOrder ListCursorCacheStatementsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCursorCacheStatementsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCursorCacheStatementsRequest) 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 ListCursorCacheStatementsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCursorCacheStatementsRequest) 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 ListCursorCacheStatementsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCursorCacheStatementsSortByEnum(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(GetListCursorCacheStatementsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListCursorCacheStatementsSortOrderEnum(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(GetListCursorCacheStatementsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCursorCacheStatementsResponse wrapper for the ListCursorCacheStatements operation +type ListCursorCacheStatementsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CursorCacheStatementCollection instances + CursorCacheStatementCollection `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 ListCursorCacheStatementsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCursorCacheStatementsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCursorCacheStatementsSortByEnum Enum with underlying type: string +type ListCursorCacheStatementsSortByEnum string + +// Set of constants representing the allowable values for ListCursorCacheStatementsSortByEnum +const ( + ListCursorCacheStatementsSortBySqlid ListCursorCacheStatementsSortByEnum = "sqlId" + ListCursorCacheStatementsSortBySchema ListCursorCacheStatementsSortByEnum = "schema" +) + +var mappingListCursorCacheStatementsSortByEnum = map[string]ListCursorCacheStatementsSortByEnum{ + "sqlId": ListCursorCacheStatementsSortBySqlid, + "schema": ListCursorCacheStatementsSortBySchema, +} + +var mappingListCursorCacheStatementsSortByEnumLowerCase = map[string]ListCursorCacheStatementsSortByEnum{ + "sqlid": ListCursorCacheStatementsSortBySqlid, + "schema": ListCursorCacheStatementsSortBySchema, +} + +// GetListCursorCacheStatementsSortByEnumValues Enumerates the set of values for ListCursorCacheStatementsSortByEnum +func GetListCursorCacheStatementsSortByEnumValues() []ListCursorCacheStatementsSortByEnum { + values := make([]ListCursorCacheStatementsSortByEnum, 0) + for _, v := range mappingListCursorCacheStatementsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCursorCacheStatementsSortByEnumStringValues Enumerates the set of values in String for ListCursorCacheStatementsSortByEnum +func GetListCursorCacheStatementsSortByEnumStringValues() []string { + return []string{ + "sqlId", + "schema", + } +} + +// GetMappingListCursorCacheStatementsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCursorCacheStatementsSortByEnum(val string) (ListCursorCacheStatementsSortByEnum, bool) { + enum, ok := mappingListCursorCacheStatementsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCursorCacheStatementsSortOrderEnum Enum with underlying type: string +type ListCursorCacheStatementsSortOrderEnum string + +// Set of constants representing the allowable values for ListCursorCacheStatementsSortOrderEnum +const ( + ListCursorCacheStatementsSortOrderAsc ListCursorCacheStatementsSortOrderEnum = "ASC" + ListCursorCacheStatementsSortOrderDesc ListCursorCacheStatementsSortOrderEnum = "DESC" +) + +var mappingListCursorCacheStatementsSortOrderEnum = map[string]ListCursorCacheStatementsSortOrderEnum{ + "ASC": ListCursorCacheStatementsSortOrderAsc, + "DESC": ListCursorCacheStatementsSortOrderDesc, +} + +var mappingListCursorCacheStatementsSortOrderEnumLowerCase = map[string]ListCursorCacheStatementsSortOrderEnum{ + "asc": ListCursorCacheStatementsSortOrderAsc, + "desc": ListCursorCacheStatementsSortOrderDesc, +} + +// GetListCursorCacheStatementsSortOrderEnumValues Enumerates the set of values for ListCursorCacheStatementsSortOrderEnum +func GetListCursorCacheStatementsSortOrderEnumValues() []ListCursorCacheStatementsSortOrderEnum { + values := make([]ListCursorCacheStatementsSortOrderEnum, 0) + for _, v := range mappingListCursorCacheStatementsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCursorCacheStatementsSortOrderEnumStringValues Enumerates the set of values in String for ListCursorCacheStatementsSortOrderEnum +func GetListCursorCacheStatementsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCursorCacheStatementsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCursorCacheStatementsSortOrderEnum(val string) (ListCursorCacheStatementsSortOrderEnum, bool) { + enum, ok := mappingListCursorCacheStatementsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/list_sql_plan_baseline_jobs_request_response.go b/databasemanagement/list_sql_plan_baseline_jobs_request_response.go new file mode 100644 index 0000000000..558354cb58 --- /dev/null +++ b/databasemanagement/list_sql_plan_baseline_jobs_request_response.go @@ -0,0 +1,203 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSqlPlanBaselineJobsRequest wrapper for the ListSqlPlanBaselineJobs operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListSqlPlanBaselineJobs.go.html to see an example of how to use ListSqlPlanBaselineJobsRequest. +type ListSqlPlanBaselineJobsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // A filter to return the SQL plan baseline jobs that match the name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // The page token representing the page from where the next set of paginated results + // are retrieved. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of records returned in the paginated response. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort information by. Only one sortOrder can be used. The default sort order + // for ‘TIMECREATED’ is descending and the default sort order for ‘NAME’ is ascending. + // The ‘NAME’ sort order is case-sensitive. + SortBy ListSqlPlanBaselineJobsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The option to sort information in ascending (‘ASC’) or descending (‘DESC’) order. Ascending order is the default order. + SortOrder ListSqlPlanBaselineJobsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListSqlPlanBaselineJobsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSqlPlanBaselineJobsRequest) 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 ListSqlPlanBaselineJobsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSqlPlanBaselineJobsRequest) 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 ListSqlPlanBaselineJobsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSqlPlanBaselineJobsSortByEnum(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(GetListSqlPlanBaselineJobsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListSqlPlanBaselineJobsSortOrderEnum(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(GetListSqlPlanBaselineJobsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSqlPlanBaselineJobsResponse wrapper for the ListSqlPlanBaselineJobs operation +type ListSqlPlanBaselineJobsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SqlPlanBaselineJobCollection instances + SqlPlanBaselineJobCollection `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 ListSqlPlanBaselineJobsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSqlPlanBaselineJobsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSqlPlanBaselineJobsSortByEnum Enum with underlying type: string +type ListSqlPlanBaselineJobsSortByEnum string + +// Set of constants representing the allowable values for ListSqlPlanBaselineJobsSortByEnum +const ( + ListSqlPlanBaselineJobsSortByTimecreated ListSqlPlanBaselineJobsSortByEnum = "TIMECREATED" + ListSqlPlanBaselineJobsSortByName ListSqlPlanBaselineJobsSortByEnum = "NAME" +) + +var mappingListSqlPlanBaselineJobsSortByEnum = map[string]ListSqlPlanBaselineJobsSortByEnum{ + "TIMECREATED": ListSqlPlanBaselineJobsSortByTimecreated, + "NAME": ListSqlPlanBaselineJobsSortByName, +} + +var mappingListSqlPlanBaselineJobsSortByEnumLowerCase = map[string]ListSqlPlanBaselineJobsSortByEnum{ + "timecreated": ListSqlPlanBaselineJobsSortByTimecreated, + "name": ListSqlPlanBaselineJobsSortByName, +} + +// GetListSqlPlanBaselineJobsSortByEnumValues Enumerates the set of values for ListSqlPlanBaselineJobsSortByEnum +func GetListSqlPlanBaselineJobsSortByEnumValues() []ListSqlPlanBaselineJobsSortByEnum { + values := make([]ListSqlPlanBaselineJobsSortByEnum, 0) + for _, v := range mappingListSqlPlanBaselineJobsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSqlPlanBaselineJobsSortByEnumStringValues Enumerates the set of values in String for ListSqlPlanBaselineJobsSortByEnum +func GetListSqlPlanBaselineJobsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "NAME", + } +} + +// GetMappingListSqlPlanBaselineJobsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlPlanBaselineJobsSortByEnum(val string) (ListSqlPlanBaselineJobsSortByEnum, bool) { + enum, ok := mappingListSqlPlanBaselineJobsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSqlPlanBaselineJobsSortOrderEnum Enum with underlying type: string +type ListSqlPlanBaselineJobsSortOrderEnum string + +// Set of constants representing the allowable values for ListSqlPlanBaselineJobsSortOrderEnum +const ( + ListSqlPlanBaselineJobsSortOrderAsc ListSqlPlanBaselineJobsSortOrderEnum = "ASC" + ListSqlPlanBaselineJobsSortOrderDesc ListSqlPlanBaselineJobsSortOrderEnum = "DESC" +) + +var mappingListSqlPlanBaselineJobsSortOrderEnum = map[string]ListSqlPlanBaselineJobsSortOrderEnum{ + "ASC": ListSqlPlanBaselineJobsSortOrderAsc, + "DESC": ListSqlPlanBaselineJobsSortOrderDesc, +} + +var mappingListSqlPlanBaselineJobsSortOrderEnumLowerCase = map[string]ListSqlPlanBaselineJobsSortOrderEnum{ + "asc": ListSqlPlanBaselineJobsSortOrderAsc, + "desc": ListSqlPlanBaselineJobsSortOrderDesc, +} + +// GetListSqlPlanBaselineJobsSortOrderEnumValues Enumerates the set of values for ListSqlPlanBaselineJobsSortOrderEnum +func GetListSqlPlanBaselineJobsSortOrderEnumValues() []ListSqlPlanBaselineJobsSortOrderEnum { + values := make([]ListSqlPlanBaselineJobsSortOrderEnum, 0) + for _, v := range mappingListSqlPlanBaselineJobsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSqlPlanBaselineJobsSortOrderEnumStringValues Enumerates the set of values in String for ListSqlPlanBaselineJobsSortOrderEnum +func GetListSqlPlanBaselineJobsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSqlPlanBaselineJobsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlPlanBaselineJobsSortOrderEnum(val string) (ListSqlPlanBaselineJobsSortOrderEnum, bool) { + enum, ok := mappingListSqlPlanBaselineJobsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/list_sql_plan_baselines_request_response.go b/databasemanagement/list_sql_plan_baselines_request_response.go new file mode 100644 index 0000000000..d0d295ec74 --- /dev/null +++ b/databasemanagement/list_sql_plan_baselines_request_response.go @@ -0,0 +1,329 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSqlPlanBaselinesRequest wrapper for the ListSqlPlanBaselines operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ListSqlPlanBaselines.go.html to see an example of how to use ListSqlPlanBaselinesRequest. +type ListSqlPlanBaselinesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // A filter to return only SQL plan baselines that match the plan name. + PlanName *string `mandatory:"false" contributesTo:"query" name:"planName"` + + // A filter to return all the SQL plan baselines for the specified SQL handle. + SqlHandle *string `mandatory:"false" contributesTo:"query" name:"sqlHandle"` + + // A filter to return all the SQL plan baselines that match the SQL text. By default, the search + // is case insensitive. To run an exact or case-sensitive search, double-quote the search string. + // You may also use the '%' symbol as a wildcard. + SqlText *string `mandatory:"false" contributesTo:"query" name:"sqlText"` + + // A filter to return only SQL plan baselines that are either enabled or not enabled. + // By default, all SQL plan baselines are returned. + IsEnabled *bool `mandatory:"false" contributesTo:"query" name:"isEnabled"` + + // A filter to return only SQL plan baselines that are either accepted or not accepted. + // By default, all SQL plan baselines are returned. + IsAccepted *bool `mandatory:"false" contributesTo:"query" name:"isAccepted"` + + // A filter to return only SQL plan baselines that were either reproduced or + // not reproduced by the optimizer. By default, all SQL plan baselines are returned. + IsReproduced *bool `mandatory:"false" contributesTo:"query" name:"isReproduced"` + + // A filter to return only SQL plan baselines that are either fixed or not fixed. + // By default, all SQL plan baselines are returned. + IsFixed *bool `mandatory:"false" contributesTo:"query" name:"isFixed"` + + // A filter to return only SQL plan baselines that are either adaptive or not adaptive. + // By default, all SQL plan baselines are returned. + IsAdaptive *bool `mandatory:"false" contributesTo:"query" name:"isAdaptive"` + + // A filter to return all the SQL plan baselines that match the origin. + Origin ListSqlPlanBaselinesOriginEnum `mandatory:"false" contributesTo:"query" name:"origin" omitEmpty:"true"` + + // The page token representing the page from where the next set of paginated results + // are retrieved. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of records returned in the paginated response. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The option to sort the SQL plan baseline summary data. + SortBy ListSqlPlanBaselinesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The option to sort information in ascending (‘ASC’) or descending (‘DESC’) order. Descending order is the default order. + SortOrder ListSqlPlanBaselinesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListSqlPlanBaselinesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSqlPlanBaselinesRequest) 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 ListSqlPlanBaselinesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSqlPlanBaselinesRequest) 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 ListSqlPlanBaselinesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSqlPlanBaselinesOriginEnum(string(request.Origin)); !ok && request.Origin != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Origin: %s. Supported values are: %s.", request.Origin, strings.Join(GetListSqlPlanBaselinesOriginEnumStringValues(), ","))) + } + if _, ok := GetMappingListSqlPlanBaselinesSortByEnum(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(GetListSqlPlanBaselinesSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListSqlPlanBaselinesSortOrderEnum(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(GetListSqlPlanBaselinesSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSqlPlanBaselinesResponse wrapper for the ListSqlPlanBaselines operation +type ListSqlPlanBaselinesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SqlPlanBaselineCollection instances + SqlPlanBaselineCollection `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 ListSqlPlanBaselinesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSqlPlanBaselinesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSqlPlanBaselinesOriginEnum Enum with underlying type: string +type ListSqlPlanBaselinesOriginEnum string + +// Set of constants representing the allowable values for ListSqlPlanBaselinesOriginEnum +const ( + ListSqlPlanBaselinesOriginAddmSqltune ListSqlPlanBaselinesOriginEnum = "ADDM_SQLTUNE" + ListSqlPlanBaselinesOriginAutoCapture ListSqlPlanBaselinesOriginEnum = "AUTO_CAPTURE" + ListSqlPlanBaselinesOriginAutoSqltune ListSqlPlanBaselinesOriginEnum = "AUTO_SQLTUNE" + ListSqlPlanBaselinesOriginEvolveAutoIndexLoad ListSqlPlanBaselinesOriginEnum = "EVOLVE_AUTO_INDEX_LOAD" + ListSqlPlanBaselinesOriginEvolveCreateFromAdaptive ListSqlPlanBaselinesOriginEnum = "EVOLVE_CREATE_FROM_ADAPTIVE" + ListSqlPlanBaselinesOriginEvolveLoadFromSts ListSqlPlanBaselinesOriginEnum = "EVOLVE_LOAD_FROM_STS" + ListSqlPlanBaselinesOriginEvolveLoadFromAwr ListSqlPlanBaselinesOriginEnum = "EVOLVE_LOAD_FROM_AWR" + ListSqlPlanBaselinesOriginEvolveLoadFromCursorCache ListSqlPlanBaselinesOriginEnum = "EVOLVE_LOAD_FROM_CURSOR_CACHE" + ListSqlPlanBaselinesOriginManualLoad ListSqlPlanBaselinesOriginEnum = "MANUAL_LOAD" + ListSqlPlanBaselinesOriginManualLoadFromAwr ListSqlPlanBaselinesOriginEnum = "MANUAL_LOAD_FROM_AWR" + ListSqlPlanBaselinesOriginManualLoadFromCursorCache ListSqlPlanBaselinesOriginEnum = "MANUAL_LOAD_FROM_CURSOR_CACHE" + ListSqlPlanBaselinesOriginManualLoadFromSts ListSqlPlanBaselinesOriginEnum = "MANUAL_LOAD_FROM_STS" + ListSqlPlanBaselinesOriginManualSqltune ListSqlPlanBaselinesOriginEnum = "MANUAL_SQLTUNE" + ListSqlPlanBaselinesOriginStoredOutline ListSqlPlanBaselinesOriginEnum = "STORED_OUTLINE" + ListSqlPlanBaselinesOriginUnknown ListSqlPlanBaselinesOriginEnum = "UNKNOWN" +) + +var mappingListSqlPlanBaselinesOriginEnum = map[string]ListSqlPlanBaselinesOriginEnum{ + "ADDM_SQLTUNE": ListSqlPlanBaselinesOriginAddmSqltune, + "AUTO_CAPTURE": ListSqlPlanBaselinesOriginAutoCapture, + "AUTO_SQLTUNE": ListSqlPlanBaselinesOriginAutoSqltune, + "EVOLVE_AUTO_INDEX_LOAD": ListSqlPlanBaselinesOriginEvolveAutoIndexLoad, + "EVOLVE_CREATE_FROM_ADAPTIVE": ListSqlPlanBaselinesOriginEvolveCreateFromAdaptive, + "EVOLVE_LOAD_FROM_STS": ListSqlPlanBaselinesOriginEvolveLoadFromSts, + "EVOLVE_LOAD_FROM_AWR": ListSqlPlanBaselinesOriginEvolveLoadFromAwr, + "EVOLVE_LOAD_FROM_CURSOR_CACHE": ListSqlPlanBaselinesOriginEvolveLoadFromCursorCache, + "MANUAL_LOAD": ListSqlPlanBaselinesOriginManualLoad, + "MANUAL_LOAD_FROM_AWR": ListSqlPlanBaselinesOriginManualLoadFromAwr, + "MANUAL_LOAD_FROM_CURSOR_CACHE": ListSqlPlanBaselinesOriginManualLoadFromCursorCache, + "MANUAL_LOAD_FROM_STS": ListSqlPlanBaselinesOriginManualLoadFromSts, + "MANUAL_SQLTUNE": ListSqlPlanBaselinesOriginManualSqltune, + "STORED_OUTLINE": ListSqlPlanBaselinesOriginStoredOutline, + "UNKNOWN": ListSqlPlanBaselinesOriginUnknown, +} + +var mappingListSqlPlanBaselinesOriginEnumLowerCase = map[string]ListSqlPlanBaselinesOriginEnum{ + "addm_sqltune": ListSqlPlanBaselinesOriginAddmSqltune, + "auto_capture": ListSqlPlanBaselinesOriginAutoCapture, + "auto_sqltune": ListSqlPlanBaselinesOriginAutoSqltune, + "evolve_auto_index_load": ListSqlPlanBaselinesOriginEvolveAutoIndexLoad, + "evolve_create_from_adaptive": ListSqlPlanBaselinesOriginEvolveCreateFromAdaptive, + "evolve_load_from_sts": ListSqlPlanBaselinesOriginEvolveLoadFromSts, + "evolve_load_from_awr": ListSqlPlanBaselinesOriginEvolveLoadFromAwr, + "evolve_load_from_cursor_cache": ListSqlPlanBaselinesOriginEvolveLoadFromCursorCache, + "manual_load": ListSqlPlanBaselinesOriginManualLoad, + "manual_load_from_awr": ListSqlPlanBaselinesOriginManualLoadFromAwr, + "manual_load_from_cursor_cache": ListSqlPlanBaselinesOriginManualLoadFromCursorCache, + "manual_load_from_sts": ListSqlPlanBaselinesOriginManualLoadFromSts, + "manual_sqltune": ListSqlPlanBaselinesOriginManualSqltune, + "stored_outline": ListSqlPlanBaselinesOriginStoredOutline, + "unknown": ListSqlPlanBaselinesOriginUnknown, +} + +// GetListSqlPlanBaselinesOriginEnumValues Enumerates the set of values for ListSqlPlanBaselinesOriginEnum +func GetListSqlPlanBaselinesOriginEnumValues() []ListSqlPlanBaselinesOriginEnum { + values := make([]ListSqlPlanBaselinesOriginEnum, 0) + for _, v := range mappingListSqlPlanBaselinesOriginEnum { + values = append(values, v) + } + return values +} + +// GetListSqlPlanBaselinesOriginEnumStringValues Enumerates the set of values in String for ListSqlPlanBaselinesOriginEnum +func GetListSqlPlanBaselinesOriginEnumStringValues() []string { + return []string{ + "ADDM_SQLTUNE", + "AUTO_CAPTURE", + "AUTO_SQLTUNE", + "EVOLVE_AUTO_INDEX_LOAD", + "EVOLVE_CREATE_FROM_ADAPTIVE", + "EVOLVE_LOAD_FROM_STS", + "EVOLVE_LOAD_FROM_AWR", + "EVOLVE_LOAD_FROM_CURSOR_CACHE", + "MANUAL_LOAD", + "MANUAL_LOAD_FROM_AWR", + "MANUAL_LOAD_FROM_CURSOR_CACHE", + "MANUAL_LOAD_FROM_STS", + "MANUAL_SQLTUNE", + "STORED_OUTLINE", + "UNKNOWN", + } +} + +// GetMappingListSqlPlanBaselinesOriginEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlPlanBaselinesOriginEnum(val string) (ListSqlPlanBaselinesOriginEnum, bool) { + enum, ok := mappingListSqlPlanBaselinesOriginEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSqlPlanBaselinesSortByEnum Enum with underlying type: string +type ListSqlPlanBaselinesSortByEnum string + +// Set of constants representing the allowable values for ListSqlPlanBaselinesSortByEnum +const ( + ListSqlPlanBaselinesSortByTimecreated ListSqlPlanBaselinesSortByEnum = "timeCreated" + ListSqlPlanBaselinesSortByTimelastmodified ListSqlPlanBaselinesSortByEnum = "timeLastModified" +) + +var mappingListSqlPlanBaselinesSortByEnum = map[string]ListSqlPlanBaselinesSortByEnum{ + "timeCreated": ListSqlPlanBaselinesSortByTimecreated, + "timeLastModified": ListSqlPlanBaselinesSortByTimelastmodified, +} + +var mappingListSqlPlanBaselinesSortByEnumLowerCase = map[string]ListSqlPlanBaselinesSortByEnum{ + "timecreated": ListSqlPlanBaselinesSortByTimecreated, + "timelastmodified": ListSqlPlanBaselinesSortByTimelastmodified, +} + +// GetListSqlPlanBaselinesSortByEnumValues Enumerates the set of values for ListSqlPlanBaselinesSortByEnum +func GetListSqlPlanBaselinesSortByEnumValues() []ListSqlPlanBaselinesSortByEnum { + values := make([]ListSqlPlanBaselinesSortByEnum, 0) + for _, v := range mappingListSqlPlanBaselinesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSqlPlanBaselinesSortByEnumStringValues Enumerates the set of values in String for ListSqlPlanBaselinesSortByEnum +func GetListSqlPlanBaselinesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "timeLastModified", + } +} + +// GetMappingListSqlPlanBaselinesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlPlanBaselinesSortByEnum(val string) (ListSqlPlanBaselinesSortByEnum, bool) { + enum, ok := mappingListSqlPlanBaselinesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSqlPlanBaselinesSortOrderEnum Enum with underlying type: string +type ListSqlPlanBaselinesSortOrderEnum string + +// Set of constants representing the allowable values for ListSqlPlanBaselinesSortOrderEnum +const ( + ListSqlPlanBaselinesSortOrderAsc ListSqlPlanBaselinesSortOrderEnum = "ASC" + ListSqlPlanBaselinesSortOrderDesc ListSqlPlanBaselinesSortOrderEnum = "DESC" +) + +var mappingListSqlPlanBaselinesSortOrderEnum = map[string]ListSqlPlanBaselinesSortOrderEnum{ + "ASC": ListSqlPlanBaselinesSortOrderAsc, + "DESC": ListSqlPlanBaselinesSortOrderDesc, +} + +var mappingListSqlPlanBaselinesSortOrderEnumLowerCase = map[string]ListSqlPlanBaselinesSortOrderEnum{ + "asc": ListSqlPlanBaselinesSortOrderAsc, + "desc": ListSqlPlanBaselinesSortOrderDesc, +} + +// GetListSqlPlanBaselinesSortOrderEnumValues Enumerates the set of values for ListSqlPlanBaselinesSortOrderEnum +func GetListSqlPlanBaselinesSortOrderEnumValues() []ListSqlPlanBaselinesSortOrderEnum { + values := make([]ListSqlPlanBaselinesSortOrderEnum, 0) + for _, v := range mappingListSqlPlanBaselinesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSqlPlanBaselinesSortOrderEnumStringValues Enumerates the set of values in String for ListSqlPlanBaselinesSortOrderEnum +func GetListSqlPlanBaselinesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSqlPlanBaselinesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlPlanBaselinesSortOrderEnum(val string) (ListSqlPlanBaselinesSortOrderEnum, bool) { + enum, ok := mappingListSqlPlanBaselinesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/load_sql_plan_baselines_from_awr_details.go b/databasemanagement/load_sql_plan_baselines_from_awr_details.go new file mode 100644 index 0000000000..b165e899a2 --- /dev/null +++ b/databasemanagement/load_sql_plan_baselines_from_awr_details.go @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LoadSqlPlanBaselinesFromAwrDetails The details required to load plans from Automatic Workload Repository (AWR). +type LoadSqlPlanBaselinesFromAwrDetails struct { + + // The name of the database job used for loading SQL plan baselines. + JobName *string `mandatory:"true" json:"jobName"` + + // The begin snapshot. + BeginSnapshot *int `mandatory:"true" json:"beginSnapshot"` + + // The end snapshot. + EndSnapshot *int `mandatory:"true" json:"endSnapshot"` + + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` + + // The description of the job. + JobDescription *string `mandatory:"false" json:"jobDescription"` + + // A filter applied to AWR to select only qualifying plans to be loaded. + // By default all plans in AWR are selected. The filter can take the form of + // any `WHERE` clause predicate that can be specified against the column + // `DBA_HIST_SQLTEXT.SQL_TEXT`. An example is `sql_text like 'SELECT %'`. + SqlTextFilter *string `mandatory:"false" json:"sqlTextFilter"` + + // Indicates whether the plans are loaded as fixed plans (`true`) or non-fixed plans (`false`). + // By default, they are loaded as non-fixed plans. + IsFixed *bool `mandatory:"false" json:"isFixed"` + + // Indicates whether the loaded plans are enabled (`true`) or not (`false`). + // By default, they are enabled. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` +} + +func (m LoadSqlPlanBaselinesFromAwrDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LoadSqlPlanBaselinesFromAwrDetails) 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 *LoadSqlPlanBaselinesFromAwrDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + JobDescription *string `json:"jobDescription"` + SqlTextFilter *string `json:"sqlTextFilter"` + IsFixed *bool `json:"isFixed"` + IsEnabled *bool `json:"isEnabled"` + JobName *string `json:"jobName"` + BeginSnapshot *int `json:"beginSnapshot"` + EndSnapshot *int `json:"endSnapshot"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.JobDescription = model.JobDescription + + m.SqlTextFilter = model.SqlTextFilter + + m.IsFixed = model.IsFixed + + m.IsEnabled = model.IsEnabled + + m.JobName = model.JobName + + m.BeginSnapshot = model.BeginSnapshot + + m.EndSnapshot = model.EndSnapshot + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} diff --git a/databasemanagement/load_sql_plan_baselines_from_awr_request_response.go b/databasemanagement/load_sql_plan_baselines_from_awr_request_response.go new file mode 100644 index 0000000000..cde4e481d1 --- /dev/null +++ b/databasemanagement/load_sql_plan_baselines_from_awr_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// LoadSqlPlanBaselinesFromAwrRequest wrapper for the LoadSqlPlanBaselinesFromAwr operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/LoadSqlPlanBaselinesFromAwr.go.html to see an example of how to use LoadSqlPlanBaselinesFromAwrRequest. +type LoadSqlPlanBaselinesFromAwrRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details required to load plans from Automatic Workload Repository (AWR). + LoadSqlPlanBaselinesFromAwrDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request LoadSqlPlanBaselinesFromAwrRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request LoadSqlPlanBaselinesFromAwrRequest) 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 LoadSqlPlanBaselinesFromAwrRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request LoadSqlPlanBaselinesFromAwrRequest) 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 LoadSqlPlanBaselinesFromAwrRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// LoadSqlPlanBaselinesFromAwrResponse wrapper for the LoadSqlPlanBaselinesFromAwr operation +type LoadSqlPlanBaselinesFromAwrResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SqlPlanBaselineJob instance + SqlPlanBaselineJob `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 LoadSqlPlanBaselinesFromAwrResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response LoadSqlPlanBaselinesFromAwrResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/load_sql_plan_baselines_from_cursor_cache_details.go b/databasemanagement/load_sql_plan_baselines_from_cursor_cache_details.go new file mode 100644 index 0000000000..7d66c32331 --- /dev/null +++ b/databasemanagement/load_sql_plan_baselines_from_cursor_cache_details.go @@ -0,0 +1,191 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LoadSqlPlanBaselinesFromCursorCacheDetails The details of SQL statements and plans to be loaded from cursor cache. You can specify +// the plans to load using SQL ID, plan identifier, or filterName and filterValue pair. +// You can also control the SQL plan baseline into which the plans are loaded using either +// SQL text or SQL handle. +type LoadSqlPlanBaselinesFromCursorCacheDetails struct { + + // The name of the database job used for loading SQL plan baselines. + JobName *string `mandatory:"true" json:"jobName"` + + Credentials ManagedDatabaseCredential `mandatory:"true" json:"credentials"` + + // The description of the job. + JobDescription *string `mandatory:"false" json:"jobDescription"` + + // The SQL statement identifier. Identifies a SQL statement in the cursor cache. + SqlId *string `mandatory:"false" json:"sqlId"` + + // The plan identifier. By default, all plans present in the cursor cache + // for the SQL statement identified by `sqlId` are captured. + PlanHash *float32 `mandatory:"false" json:"planHash"` + + // The SQL text to use in identifying the SQL plan baseline into which the plans + // are loaded. If the SQL plan baseline does not exist, it is created. + SqlText *string `mandatory:"false" json:"sqlText"` + + // The SQL handle to use in identifying the SQL plan baseline into which + // the plans are loaded. + SqlHandle *string `mandatory:"false" json:"sqlHandle"` + + // The name of the filter. + // - SQL_TEXT: Search pattern to apply to SQL text. + // - PARSING_SCHEMA_NAME: Name of the parsing schema. + // - MODULE: Name of the module. + // - ACTION: Name of the action. + FilterName LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum `mandatory:"false" json:"filterName,omitempty"` + + // The filter value. It is upper-cased except when it is enclosed in + // double quotes or filter name is `SQL_TEXT`. + FilterValue *string `mandatory:"false" json:"filterValue"` + + // Indicates whether the plans are loaded as fixed plans (`true`) or non-fixed plans (`false`). + // By default, they are loaded as non-fixed plans. + IsFixed *bool `mandatory:"false" json:"isFixed"` + + // Indicates whether the loaded plans are enabled (`true`) or not (`false`). + // By default, they are enabled. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` +} + +func (m LoadSqlPlanBaselinesFromCursorCacheDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LoadSqlPlanBaselinesFromCursorCacheDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum(string(m.FilterName)); !ok && m.FilterName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FilterName: %s. Supported values are: %s.", m.FilterName, strings.Join(GetLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *LoadSqlPlanBaselinesFromCursorCacheDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + JobDescription *string `json:"jobDescription"` + SqlId *string `json:"sqlId"` + PlanHash *float32 `json:"planHash"` + SqlText *string `json:"sqlText"` + SqlHandle *string `json:"sqlHandle"` + FilterName LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum `json:"filterName"` + FilterValue *string `json:"filterValue"` + IsFixed *bool `json:"isFixed"` + IsEnabled *bool `json:"isEnabled"` + JobName *string `json:"jobName"` + Credentials manageddatabasecredential `json:"credentials"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.JobDescription = model.JobDescription + + m.SqlId = model.SqlId + + m.PlanHash = model.PlanHash + + m.SqlText = model.SqlText + + m.SqlHandle = model.SqlHandle + + m.FilterName = model.FilterName + + m.FilterValue = model.FilterValue + + m.IsFixed = model.IsFixed + + m.IsEnabled = model.IsEnabled + + m.JobName = model.JobName + + nn, e = model.Credentials.UnmarshalPolymorphicJSON(model.Credentials.JsonData) + if e != nil { + return + } + if nn != nil { + m.Credentials = nn.(ManagedDatabaseCredential) + } else { + m.Credentials = nil + } + + return +} + +// LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum Enum with underlying type: string +type LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum string + +// Set of constants representing the allowable values for LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum +const ( + LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameSqlText LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum = "SQL_TEXT" + LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameParsingSchemaName LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum = "PARSING_SCHEMA_NAME" + LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameModule LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum = "MODULE" + LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameAction LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum = "ACTION" +) + +var mappingLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum = map[string]LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum{ + "SQL_TEXT": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameSqlText, + "PARSING_SCHEMA_NAME": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameParsingSchemaName, + "MODULE": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameModule, + "ACTION": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameAction, +} + +var mappingLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnumLowerCase = map[string]LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum{ + "sql_text": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameSqlText, + "parsing_schema_name": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameParsingSchemaName, + "module": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameModule, + "action": LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameAction, +} + +// GetLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnumValues Enumerates the set of values for LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum +func GetLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnumValues() []LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum { + values := make([]LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum, 0) + for _, v := range mappingLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum { + values = append(values, v) + } + return values +} + +// GetLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnumStringValues Enumerates the set of values in String for LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum +func GetLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnumStringValues() []string { + return []string{ + "SQL_TEXT", + "PARSING_SCHEMA_NAME", + "MODULE", + "ACTION", + } +} + +// GetMappingLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum(val string) (LoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnum, bool) { + enum, ok := mappingLoadSqlPlanBaselinesFromCursorCacheDetailsFilterNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/load_sql_plan_baselines_from_cursor_cache_request_response.go b/databasemanagement/load_sql_plan_baselines_from_cursor_cache_request_response.go new file mode 100644 index 0000000000..3915a90e3e --- /dev/null +++ b/databasemanagement/load_sql_plan_baselines_from_cursor_cache_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// LoadSqlPlanBaselinesFromCursorCacheRequest wrapper for the LoadSqlPlanBaselinesFromCursorCache operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/LoadSqlPlanBaselinesFromCursorCache.go.html to see an example of how to use LoadSqlPlanBaselinesFromCursorCacheRequest. +type LoadSqlPlanBaselinesFromCursorCacheRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The details of SQL statements and plans to be loaded from cursor cache. + LoadSqlPlanBaselinesFromCursorCacheDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request LoadSqlPlanBaselinesFromCursorCacheRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request LoadSqlPlanBaselinesFromCursorCacheRequest) 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 LoadSqlPlanBaselinesFromCursorCacheRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request LoadSqlPlanBaselinesFromCursorCacheRequest) 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 LoadSqlPlanBaselinesFromCursorCacheRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// LoadSqlPlanBaselinesFromCursorCacheResponse wrapper for the LoadSqlPlanBaselinesFromCursorCache operation +type LoadSqlPlanBaselinesFromCursorCacheResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SqlPlanBaselineJob instance + SqlPlanBaselineJob `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 LoadSqlPlanBaselinesFromCursorCacheResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response LoadSqlPlanBaselinesFromCursorCacheResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/open_alert_history.go b/databasemanagement/open_alert_history.go index e44926050a..ae488ee330 100644 --- a/databasemanagement/open_alert_history.go +++ b/databasemanagement/open_alert_history.go @@ -17,7 +17,7 @@ import ( "strings" ) -// OpenAlertHistory The open alerts current existing in a storage server. +// OpenAlertHistory The existing open alerts in the Exadata storage server. type OpenAlertHistory struct { // A list of open alerts. diff --git a/databasemanagement/open_alert_summary.go b/databasemanagement/open_alert_summary.go index 1132eef449..6802173a33 100644 --- a/databasemanagement/open_alert_summary.go +++ b/databasemanagement/open_alert_summary.go @@ -17,13 +17,13 @@ import ( "strings" ) -// OpenAlertSummary An alert from storage server. +// OpenAlertSummary An alert from the Exadata storage server. type OpenAlertSummary struct { // The severity of the alert. Severity AlertSeverityEnumEnum `mandatory:"false" json:"severity,omitempty"` - // The type of the alert. + // The type of alert. Type AlertTypeEnumEnum `mandatory:"false" json:"type,omitempty"` // The start time of the alert. diff --git a/databasemanagement/rest_credential.go b/databasemanagement/rest_credential.go index 287354ae5c..b4fc54cde6 100644 --- a/databasemanagement/rest_credential.go +++ b/databasemanagement/rest_credential.go @@ -26,13 +26,13 @@ type RestCredential struct { // The password of the user. Password *string `mandatory:"true" json:"password"` - // The SSL trust store type. + // The SSL truststore type. SslTrustStoreType RestCredentialSslTrustStoreTypeEnum `mandatory:"false" json:"sslTrustStoreType,omitempty"` - // The full path of the SSL trust store Location in the agent. + // The full path of the SSL truststore location in the agent. SslTrustStoreLocation *string `mandatory:"false" json:"sslTrustStoreLocation"` - // The password of the SSL trust store Location in the agent. + // The password of the SSL truststore location in the agent. SslTrustStorePassword *string `mandatory:"false" json:"sslTrustStorePassword"` } diff --git a/databasemanagement/spm_evolve_task_parameters.go b/databasemanagement/spm_evolve_task_parameters.go new file mode 100644 index 0000000000..fd5a465808 --- /dev/null +++ b/databasemanagement/spm_evolve_task_parameters.go @@ -0,0 +1,163 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SpmEvolveTaskParameters The set of parameters used in an SPM evolve task. +type SpmEvolveTaskParameters struct { + + // Determines which sources to search for additional plans. + AlternatePlanSources []SpmEvolveTaskParametersAlternatePlanSourcesEnum `mandatory:"false" json:"alternatePlanSources,omitempty"` + + // Determines which alternative plans should be loaded. + AlternatePlanBaselines []SpmEvolveTaskParametersAlternatePlanBaselinesEnum `mandatory:"false" json:"alternatePlanBaselines,omitempty"` + + // Specifies the maximum number of plans to load in total (that is, not + // the limit for each SQL statement). A value of zero indicates `UNLIMITED` + // number of plans. + AlternatePlanLimit *int `mandatory:"false" json:"alternatePlanLimit"` + + // Specifies whether to accept recommended plans automatically. + ArePlansAutoAccepted *bool `mandatory:"false" json:"arePlansAutoAccepted"` + + // The global time limit in seconds. This is the total time allowed for the task. + AllowedTimeLimit *int `mandatory:"false" json:"allowedTimeLimit"` +} + +func (m SpmEvolveTaskParameters) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SpmEvolveTaskParameters) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.AlternatePlanSources { + if _, ok := GetMappingSpmEvolveTaskParametersAlternatePlanSourcesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AlternatePlanSources: %s. Supported values are: %s.", val, strings.Join(GetSpmEvolveTaskParametersAlternatePlanSourcesEnumStringValues(), ","))) + } + } + + for _, val := range m.AlternatePlanBaselines { + if _, ok := GetMappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AlternatePlanBaselines: %s. Supported values are: %s.", val, strings.Join(GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SpmEvolveTaskParametersAlternatePlanSourcesEnum Enum with underlying type: string +type SpmEvolveTaskParametersAlternatePlanSourcesEnum string + +// Set of constants representing the allowable values for SpmEvolveTaskParametersAlternatePlanSourcesEnum +const ( + SpmEvolveTaskParametersAlternatePlanSourcesAuto SpmEvolveTaskParametersAlternatePlanSourcesEnum = "AUTO" + SpmEvolveTaskParametersAlternatePlanSourcesAutomaticWorkloadRepository SpmEvolveTaskParametersAlternatePlanSourcesEnum = "AUTOMATIC_WORKLOAD_REPOSITORY" + SpmEvolveTaskParametersAlternatePlanSourcesCursorCache SpmEvolveTaskParametersAlternatePlanSourcesEnum = "CURSOR_CACHE" + SpmEvolveTaskParametersAlternatePlanSourcesSqlTuningSet SpmEvolveTaskParametersAlternatePlanSourcesEnum = "SQL_TUNING_SET" +) + +var mappingSpmEvolveTaskParametersAlternatePlanSourcesEnum = map[string]SpmEvolveTaskParametersAlternatePlanSourcesEnum{ + "AUTO": SpmEvolveTaskParametersAlternatePlanSourcesAuto, + "AUTOMATIC_WORKLOAD_REPOSITORY": SpmEvolveTaskParametersAlternatePlanSourcesAutomaticWorkloadRepository, + "CURSOR_CACHE": SpmEvolveTaskParametersAlternatePlanSourcesCursorCache, + "SQL_TUNING_SET": SpmEvolveTaskParametersAlternatePlanSourcesSqlTuningSet, +} + +var mappingSpmEvolveTaskParametersAlternatePlanSourcesEnumLowerCase = map[string]SpmEvolveTaskParametersAlternatePlanSourcesEnum{ + "auto": SpmEvolveTaskParametersAlternatePlanSourcesAuto, + "automatic_workload_repository": SpmEvolveTaskParametersAlternatePlanSourcesAutomaticWorkloadRepository, + "cursor_cache": SpmEvolveTaskParametersAlternatePlanSourcesCursorCache, + "sql_tuning_set": SpmEvolveTaskParametersAlternatePlanSourcesSqlTuningSet, +} + +// GetSpmEvolveTaskParametersAlternatePlanSourcesEnumValues Enumerates the set of values for SpmEvolveTaskParametersAlternatePlanSourcesEnum +func GetSpmEvolveTaskParametersAlternatePlanSourcesEnumValues() []SpmEvolveTaskParametersAlternatePlanSourcesEnum { + values := make([]SpmEvolveTaskParametersAlternatePlanSourcesEnum, 0) + for _, v := range mappingSpmEvolveTaskParametersAlternatePlanSourcesEnum { + values = append(values, v) + } + return values +} + +// GetSpmEvolveTaskParametersAlternatePlanSourcesEnumStringValues Enumerates the set of values in String for SpmEvolveTaskParametersAlternatePlanSourcesEnum +func GetSpmEvolveTaskParametersAlternatePlanSourcesEnumStringValues() []string { + return []string{ + "AUTO", + "AUTOMATIC_WORKLOAD_REPOSITORY", + "CURSOR_CACHE", + "SQL_TUNING_SET", + } +} + +// GetMappingSpmEvolveTaskParametersAlternatePlanSourcesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSpmEvolveTaskParametersAlternatePlanSourcesEnum(val string) (SpmEvolveTaskParametersAlternatePlanSourcesEnum, bool) { + enum, ok := mappingSpmEvolveTaskParametersAlternatePlanSourcesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SpmEvolveTaskParametersAlternatePlanBaselinesEnum Enum with underlying type: string +type SpmEvolveTaskParametersAlternatePlanBaselinesEnum string + +// Set of constants representing the allowable values for SpmEvolveTaskParametersAlternatePlanBaselinesEnum +const ( + SpmEvolveTaskParametersAlternatePlanBaselinesAuto SpmEvolveTaskParametersAlternatePlanBaselinesEnum = "AUTO" + SpmEvolveTaskParametersAlternatePlanBaselinesExisting SpmEvolveTaskParametersAlternatePlanBaselinesEnum = "EXISTING" + SpmEvolveTaskParametersAlternatePlanBaselinesNew SpmEvolveTaskParametersAlternatePlanBaselinesEnum = "NEW" +) + +var mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum = map[string]SpmEvolveTaskParametersAlternatePlanBaselinesEnum{ + "AUTO": SpmEvolveTaskParametersAlternatePlanBaselinesAuto, + "EXISTING": SpmEvolveTaskParametersAlternatePlanBaselinesExisting, + "NEW": SpmEvolveTaskParametersAlternatePlanBaselinesNew, +} + +var mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnumLowerCase = map[string]SpmEvolveTaskParametersAlternatePlanBaselinesEnum{ + "auto": SpmEvolveTaskParametersAlternatePlanBaselinesAuto, + "existing": SpmEvolveTaskParametersAlternatePlanBaselinesExisting, + "new": SpmEvolveTaskParametersAlternatePlanBaselinesNew, +} + +// GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumValues Enumerates the set of values for SpmEvolveTaskParametersAlternatePlanBaselinesEnum +func GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumValues() []SpmEvolveTaskParametersAlternatePlanBaselinesEnum { + values := make([]SpmEvolveTaskParametersAlternatePlanBaselinesEnum, 0) + for _, v := range mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum { + values = append(values, v) + } + return values +} + +// GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumStringValues Enumerates the set of values in String for SpmEvolveTaskParametersAlternatePlanBaselinesEnum +func GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumStringValues() []string { + return []string{ + "AUTO", + "EXISTING", + "NEW", + } +} + +// GetMappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum(val string) (SpmEvolveTaskParametersAlternatePlanBaselinesEnum, bool) { + enum, ok := mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/sql_cpu_activity.go b/databasemanagement/sql_cpu_activity.go index f2f549c25b..30a54285eb 100644 --- a/databasemanagement/sql_cpu_activity.go +++ b/databasemanagement/sql_cpu_activity.go @@ -17,7 +17,7 @@ import ( "strings" ) -// SqlCpuActivity SQL CPU activity from storage server. +// SqlCpuActivity The SQL CPU activity from the Exadata storage server. type SqlCpuActivity struct { // The database name. diff --git a/databasemanagement/sql_job.go b/databasemanagement/sql_job.go index 2562f733be..c151e3a014 100644 --- a/databasemanagement/sql_job.go +++ b/databasemanagement/sql_job.go @@ -61,6 +61,10 @@ type SqlJob struct { // The SQL text to be executed in the job. This is a mandatory field for the EXECUTE_SQL operationType. SqlText *string `mandatory:"false" json:"sqlText"` + InBinds *JobInBindsDetails `mandatory:"false" json:"inBinds"` + + OutBinds *JobOutBindsDetails `mandatory:"false" json:"outBinds"` + // The database user name used to execute the SQL job. If the job is being executed on a Managed Database Group, // then the user name should exist on all the databases in the group with the same password. UserName *string `mandatory:"false" json:"userName"` @@ -226,6 +230,8 @@ func (m *SqlJob) UnmarshalJSON(data []byte) (e error) { SubmissionErrorMessage *string `json:"submissionErrorMessage"` SqlType SqlJobSqlTypeEnum `json:"sqlType"` SqlText *string `json:"sqlText"` + InBinds *JobInBindsDetails `json:"inBinds"` + OutBinds *JobOutBindsDetails `json:"outBinds"` UserName *string `json:"userName"` Role SqlJobRoleEnum `json:"role"` Id *string `json:"id"` @@ -276,6 +282,10 @@ func (m *SqlJob) UnmarshalJSON(data []byte) (e error) { m.SqlText = model.SqlText + m.InBinds = model.InBinds + + m.OutBinds = model.OutBinds + m.UserName = model.UserName m.Role = model.Role diff --git a/databasemanagement/sql_plan_baseline.go b/databasemanagement/sql_plan_baseline.go new file mode 100644 index 0000000000..60567fb65c --- /dev/null +++ b/databasemanagement/sql_plan_baseline.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaseline The details of a SQL plan baseline. +type SqlPlanBaseline struct { + + // The unique plan identifier. + PlanName *string `mandatory:"true" json:"planName"` + + // The unique SQL identifier. + SqlHandle *string `mandatory:"true" json:"sqlHandle"` + + // The SQL text. + SqlText *string `mandatory:"true" json:"sqlText"` + + // The date and time when the plan baseline was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The execution plan for the SQL statement. + ExecutionPlan *string `mandatory:"true" json:"executionPlan"` + + // The origin of the SQL plan baseline. + Origin SqlPlanBaselineOriginEnum `mandatory:"false" json:"origin,omitempty"` + + // The date and time when the plan baseline was last modified. + TimeLastModified *common.SDKTime `mandatory:"false" json:"timeLastModified"` + + // The date and time when the plan baseline was last executed. + // **Note:** For performance reasons, database does not update this value + // immediately after each execution of the plan baseline. Therefore, the plan + // baseline may have been executed more recently than this value indicates. + TimeLastExecuted *common.SDKTime `mandatory:"false" json:"timeLastExecuted"` + + // Indicates whether the plan baseline is enabled (`YES`) or disabled (`NO`). + Enabled *string `mandatory:"false" json:"enabled"` + + // Indicates whether the plan baseline is accepted (`YES`) or not (`NO`). + Accepted *string `mandatory:"false" json:"accepted"` + + // Indicates whether the plan baseline is fixed (`YES`) or not (`NO`). + Fixed *string `mandatory:"false" json:"fixed"` + + // Indicates whether the optimizer was able to reproduce the plan (`YES`) or not (`NO`). + // The value is set to `YES` when a plan is initially added to the plan baseline. + Reproduced *string `mandatory:"false" json:"reproduced"` + + // Indicates whether the plan baseline is auto-purged (`YES`) or not (`NO`). + AutoPurge *string `mandatory:"false" json:"autoPurge"` + + // Indicates whether a plan that is automatically captured by SQL plan management is marked adaptive or not. + // When a new adaptive plan is found for a SQL statement that has an existing SQL plan baseline, that new plan + // will be added to the SQL plan baseline as an unaccepted plan, and the `ADAPTIVE` property will be marked `YES`. + // When this new plan is verified (either manually or via the auto evolve task), the plan will be test executed + // and the final plan determined at execution will become an accepted plan if its performance is better than + // the existing plan baseline. At this point, the value of the `ADAPTIVE` property is set to `NO` since the plan + // is no longer adaptive, but resolved. + Adaptive *string `mandatory:"false" json:"adaptive"` + + // The application module name. + Module *string `mandatory:"false" json:"module"` + + // The application action. + Action *string `mandatory:"false" json:"action"` +} + +func (m SqlPlanBaseline) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaseline) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSqlPlanBaselineOriginEnum(string(m.Origin)); !ok && m.Origin != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Origin: %s. Supported values are: %s.", m.Origin, strings.Join(GetSqlPlanBaselineOriginEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/sql_plan_baseline_aggregation.go b/databasemanagement/sql_plan_baseline_aggregation.go new file mode 100644 index 0000000000..691a540e3e --- /dev/null +++ b/databasemanagement/sql_plan_baseline_aggregation.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineAggregation A summary of SQL plan baselines. +type SqlPlanBaselineAggregation struct { + Dimensions *SqlPlanBaselineDimensions `mandatory:"true" json:"dimensions"` + + // The number of SQL plan baselines matching aggregation criteria. + Count *int `mandatory:"false" json:"count"` +} + +func (m SqlPlanBaselineAggregation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineAggregation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/sql_plan_baseline_aggregation_collection.go b/databasemanagement/sql_plan_baseline_aggregation_collection.go new file mode 100644 index 0000000000..0a9a95dc0c --- /dev/null +++ b/databasemanagement/sql_plan_baseline_aggregation_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineAggregationCollection A collection of SQL plan baseline aggregations. +type SqlPlanBaselineAggregationCollection struct { + + // A list of SQL plan baseline aggregations. + Items []SqlPlanBaselineAggregation `mandatory:"true" json:"items"` +} + +func (m SqlPlanBaselineAggregationCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineAggregationCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/sql_plan_baseline_collection.go b/databasemanagement/sql_plan_baseline_collection.go new file mode 100644 index 0000000000..15db8b1b17 --- /dev/null +++ b/databasemanagement/sql_plan_baseline_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineCollection The SQL plan baseline list. +type SqlPlanBaselineCollection struct { + + // A list of SQL plan baselines. + Items []SqlPlanBaselineSummary `mandatory:"true" json:"items"` +} + +func (m SqlPlanBaselineCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/sql_plan_baseline_configuration.go b/databasemanagement/sql_plan_baseline_configuration.go new file mode 100644 index 0000000000..d4fa36a04d --- /dev/null +++ b/databasemanagement/sql_plan_baseline_configuration.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineConfiguration The configuration details of SQL plan baselines. The details include: +// - whether automatic initial plan capture is enabled or disabled +// - whether use of SQL plan baselines is enabled or disabled +// - whether Automatic SPM Evolve Advisor task is enabled or disabled +// - whether high-frequency Automatic SPM Evolve Advisor task is enabled or disabled +// - filters for the automatic initial plan capture +// - parameters for the Automatic SPM Evolve Advisor task +// - plan retention and allocated space for the plan baselines +type SqlPlanBaselineConfiguration struct { + + // Indicates whether the automatic capture of SQL plan baselines is enabled (`true`) or not (`false`). + IsAutomaticInitialPlanCaptureEnabled *bool `mandatory:"true" json:"isAutomaticInitialPlanCaptureEnabled"` + + // Indicates whether the database uses SQL plan baselines (`true`) or not (`false`). + IsSqlPlanBaselinesUsageEnabled *bool `mandatory:"true" json:"isSqlPlanBaselinesUsageEnabled"` + + // Indicates whether the Automatic SPM Evolve Advisor task is enabled (`true`) or not (`false`). + IsAutoSpmEvolveTaskEnabled *bool `mandatory:"true" json:"isAutoSpmEvolveTaskEnabled"` + + // Indicates whether the high frequency Automatic SPM Evolve Advisor task is enabled (`true`) or not (`false`). + IsHighFrequencyAutoSpmEvolveTaskEnabled *bool `mandatory:"true" json:"isHighFrequencyAutoSpmEvolveTaskEnabled"` + + // The number of weeks to retain unused plans before they are purged. + PlanRetentionWeeks *int `mandatory:"true" json:"planRetentionWeeks"` + + // The maximum percent of `SYSAUX` space that can be used for SQL Management Base. + SpaceBudgetPercent *float32 `mandatory:"true" json:"spaceBudgetPercent"` + + // The maximum `SYSAUX` space that can be used for SQL Management Base in MB. + SpaceBudgetMB *float32 `mandatory:"false" json:"spaceBudgetMB"` + + // The space used by SQL Management Base in MB. + SpaceUsedMB *float32 `mandatory:"false" json:"spaceUsedMB"` + + // The capture filters used in automatic initial plan capture. + AutoCaptureFilters []AutomaticCaptureFilter `mandatory:"false" json:"autoCaptureFilters"` + + AutoSpmEvolveTaskParameters *SpmEvolveTaskParameters `mandatory:"false" json:"autoSpmEvolveTaskParameters"` +} + +func (m SqlPlanBaselineConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/sql_plan_baseline_dimensions.go b/databasemanagement/sql_plan_baseline_dimensions.go new file mode 100644 index 0000000000..0a43b7fb02 --- /dev/null +++ b/databasemanagement/sql_plan_baseline_dimensions.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineDimensions The details of the SQL plan baseline dimensions. +type SqlPlanBaselineDimensions struct { + + // The name of the SQL plan baseline attribute. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // The value of the attribute. + AttributeValue *string `mandatory:"true" json:"attributeValue"` +} + +func (m SqlPlanBaselineDimensions) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineDimensions) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/sql_plan_baseline_job.go b/databasemanagement/sql_plan_baseline_job.go new file mode 100644 index 0000000000..8e3b67c4ee --- /dev/null +++ b/databasemanagement/sql_plan_baseline_job.go @@ -0,0 +1,140 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineJob The details of the database job used for loading and evolving SQL plan baselines. +type SqlPlanBaselineJob struct { + + // The job name. + Name *string `mandatory:"true" json:"name"` + + // The job type. + Type SqlPlanBaselineJobTypeEnum `mandatory:"true" json:"type"` + + // The job status. + Status SqlPlanBaselineJobStatusEnum `mandatory:"true" json:"status"` + + // The date and time the job was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m SqlPlanBaselineJob) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineJob) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSqlPlanBaselineJobTypeEnum(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(GetSqlPlanBaselineJobTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingSqlPlanBaselineJobStatusEnum(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(GetSqlPlanBaselineJobStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SqlPlanBaselineJobTypeEnum Enum with underlying type: string +type SqlPlanBaselineJobTypeEnum string + +// Set of constants representing the allowable values for SqlPlanBaselineJobTypeEnum +const ( + SqlPlanBaselineJobTypeLoad SqlPlanBaselineJobTypeEnum = "LOAD" +) + +var mappingSqlPlanBaselineJobTypeEnum = map[string]SqlPlanBaselineJobTypeEnum{ + "LOAD": SqlPlanBaselineJobTypeLoad, +} + +var mappingSqlPlanBaselineJobTypeEnumLowerCase = map[string]SqlPlanBaselineJobTypeEnum{ + "load": SqlPlanBaselineJobTypeLoad, +} + +// GetSqlPlanBaselineJobTypeEnumValues Enumerates the set of values for SqlPlanBaselineJobTypeEnum +func GetSqlPlanBaselineJobTypeEnumValues() []SqlPlanBaselineJobTypeEnum { + values := make([]SqlPlanBaselineJobTypeEnum, 0) + for _, v := range mappingSqlPlanBaselineJobTypeEnum { + values = append(values, v) + } + return values +} + +// GetSqlPlanBaselineJobTypeEnumStringValues Enumerates the set of values in String for SqlPlanBaselineJobTypeEnum +func GetSqlPlanBaselineJobTypeEnumStringValues() []string { + return []string{ + "LOAD", + } +} + +// GetMappingSqlPlanBaselineJobTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSqlPlanBaselineJobTypeEnum(val string) (SqlPlanBaselineJobTypeEnum, bool) { + enum, ok := mappingSqlPlanBaselineJobTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SqlPlanBaselineJobStatusEnum Enum with underlying type: string +type SqlPlanBaselineJobStatusEnum string + +// Set of constants representing the allowable values for SqlPlanBaselineJobStatusEnum +const ( + SqlPlanBaselineJobStatusSucceeded SqlPlanBaselineJobStatusEnum = "SUCCEEDED" + SqlPlanBaselineJobStatusScheduled SqlPlanBaselineJobStatusEnum = "SCHEDULED" + SqlPlanBaselineJobStatusFailed SqlPlanBaselineJobStatusEnum = "FAILED" +) + +var mappingSqlPlanBaselineJobStatusEnum = map[string]SqlPlanBaselineJobStatusEnum{ + "SUCCEEDED": SqlPlanBaselineJobStatusSucceeded, + "SCHEDULED": SqlPlanBaselineJobStatusScheduled, + "FAILED": SqlPlanBaselineJobStatusFailed, +} + +var mappingSqlPlanBaselineJobStatusEnumLowerCase = map[string]SqlPlanBaselineJobStatusEnum{ + "succeeded": SqlPlanBaselineJobStatusSucceeded, + "scheduled": SqlPlanBaselineJobStatusScheduled, + "failed": SqlPlanBaselineJobStatusFailed, +} + +// GetSqlPlanBaselineJobStatusEnumValues Enumerates the set of values for SqlPlanBaselineJobStatusEnum +func GetSqlPlanBaselineJobStatusEnumValues() []SqlPlanBaselineJobStatusEnum { + values := make([]SqlPlanBaselineJobStatusEnum, 0) + for _, v := range mappingSqlPlanBaselineJobStatusEnum { + values = append(values, v) + } + return values +} + +// GetSqlPlanBaselineJobStatusEnumStringValues Enumerates the set of values in String for SqlPlanBaselineJobStatusEnum +func GetSqlPlanBaselineJobStatusEnumStringValues() []string { + return []string{ + "SUCCEEDED", + "SCHEDULED", + "FAILED", + } +} + +// GetMappingSqlPlanBaselineJobStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSqlPlanBaselineJobStatusEnum(val string) (SqlPlanBaselineJobStatusEnum, bool) { + enum, ok := mappingSqlPlanBaselineJobStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/sql_plan_baseline_job_collection.go b/databasemanagement/sql_plan_baseline_job_collection.go new file mode 100644 index 0000000000..6592f50f30 --- /dev/null +++ b/databasemanagement/sql_plan_baseline_job_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineJobCollection A collection of database jobs used for loading and evolving SQL plan baselines. +type SqlPlanBaselineJobCollection struct { + + // A list of SQL plan baseline jobs. + Items []SqlPlanBaselineJobSummary `mandatory:"true" json:"items"` +} + +func (m SqlPlanBaselineJobCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineJobCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/sql_plan_baseline_job_summary.go b/databasemanagement/sql_plan_baseline_job_summary.go new file mode 100644 index 0000000000..3771ee1811 --- /dev/null +++ b/databasemanagement/sql_plan_baseline_job_summary.go @@ -0,0 +1,140 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineJobSummary A summary of the database job used for loading and evolving SQL plan baselines. +type SqlPlanBaselineJobSummary struct { + + // The name of the job. + Name *string `mandatory:"true" json:"name"` + + // The type of the job. + Type SqlPlanBaselineJobSummaryTypeEnum `mandatory:"true" json:"type"` + + // The status of the job. + Status SqlPlanBaselineJobSummaryStatusEnum `mandatory:"true" json:"status"` + + // The date and time the job was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m SqlPlanBaselineJobSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineJobSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSqlPlanBaselineJobSummaryTypeEnum(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(GetSqlPlanBaselineJobSummaryTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingSqlPlanBaselineJobSummaryStatusEnum(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(GetSqlPlanBaselineJobSummaryStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SqlPlanBaselineJobSummaryTypeEnum Enum with underlying type: string +type SqlPlanBaselineJobSummaryTypeEnum string + +// Set of constants representing the allowable values for SqlPlanBaselineJobSummaryTypeEnum +const ( + SqlPlanBaselineJobSummaryTypeLoad SqlPlanBaselineJobSummaryTypeEnum = "LOAD" +) + +var mappingSqlPlanBaselineJobSummaryTypeEnum = map[string]SqlPlanBaselineJobSummaryTypeEnum{ + "LOAD": SqlPlanBaselineJobSummaryTypeLoad, +} + +var mappingSqlPlanBaselineJobSummaryTypeEnumLowerCase = map[string]SqlPlanBaselineJobSummaryTypeEnum{ + "load": SqlPlanBaselineJobSummaryTypeLoad, +} + +// GetSqlPlanBaselineJobSummaryTypeEnumValues Enumerates the set of values for SqlPlanBaselineJobSummaryTypeEnum +func GetSqlPlanBaselineJobSummaryTypeEnumValues() []SqlPlanBaselineJobSummaryTypeEnum { + values := make([]SqlPlanBaselineJobSummaryTypeEnum, 0) + for _, v := range mappingSqlPlanBaselineJobSummaryTypeEnum { + values = append(values, v) + } + return values +} + +// GetSqlPlanBaselineJobSummaryTypeEnumStringValues Enumerates the set of values in String for SqlPlanBaselineJobSummaryTypeEnum +func GetSqlPlanBaselineJobSummaryTypeEnumStringValues() []string { + return []string{ + "LOAD", + } +} + +// GetMappingSqlPlanBaselineJobSummaryTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSqlPlanBaselineJobSummaryTypeEnum(val string) (SqlPlanBaselineJobSummaryTypeEnum, bool) { + enum, ok := mappingSqlPlanBaselineJobSummaryTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SqlPlanBaselineJobSummaryStatusEnum Enum with underlying type: string +type SqlPlanBaselineJobSummaryStatusEnum string + +// Set of constants representing the allowable values for SqlPlanBaselineJobSummaryStatusEnum +const ( + SqlPlanBaselineJobSummaryStatusSucceeded SqlPlanBaselineJobSummaryStatusEnum = "SUCCEEDED" + SqlPlanBaselineJobSummaryStatusScheduled SqlPlanBaselineJobSummaryStatusEnum = "SCHEDULED" + SqlPlanBaselineJobSummaryStatusFailed SqlPlanBaselineJobSummaryStatusEnum = "FAILED" +) + +var mappingSqlPlanBaselineJobSummaryStatusEnum = map[string]SqlPlanBaselineJobSummaryStatusEnum{ + "SUCCEEDED": SqlPlanBaselineJobSummaryStatusSucceeded, + "SCHEDULED": SqlPlanBaselineJobSummaryStatusScheduled, + "FAILED": SqlPlanBaselineJobSummaryStatusFailed, +} + +var mappingSqlPlanBaselineJobSummaryStatusEnumLowerCase = map[string]SqlPlanBaselineJobSummaryStatusEnum{ + "succeeded": SqlPlanBaselineJobSummaryStatusSucceeded, + "scheduled": SqlPlanBaselineJobSummaryStatusScheduled, + "failed": SqlPlanBaselineJobSummaryStatusFailed, +} + +// GetSqlPlanBaselineJobSummaryStatusEnumValues Enumerates the set of values for SqlPlanBaselineJobSummaryStatusEnum +func GetSqlPlanBaselineJobSummaryStatusEnumValues() []SqlPlanBaselineJobSummaryStatusEnum { + values := make([]SqlPlanBaselineJobSummaryStatusEnum, 0) + for _, v := range mappingSqlPlanBaselineJobSummaryStatusEnum { + values = append(values, v) + } + return values +} + +// GetSqlPlanBaselineJobSummaryStatusEnumStringValues Enumerates the set of values in String for SqlPlanBaselineJobSummaryStatusEnum +func GetSqlPlanBaselineJobSummaryStatusEnumStringValues() []string { + return []string{ + "SUCCEEDED", + "SCHEDULED", + "FAILED", + } +} + +// GetMappingSqlPlanBaselineJobSummaryStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSqlPlanBaselineJobSummaryStatusEnum(val string) (SqlPlanBaselineJobSummaryStatusEnum, bool) { + enum, ok := mappingSqlPlanBaselineJobSummaryStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/sql_plan_baseline_origin.go b/databasemanagement/sql_plan_baseline_origin.go new file mode 100644 index 0000000000..1c5e65c7d3 --- /dev/null +++ b/databasemanagement/sql_plan_baseline_origin.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "strings" +) + +// SqlPlanBaselineOriginEnum Enum with underlying type: string +type SqlPlanBaselineOriginEnum string + +// Set of constants representing the allowable values for SqlPlanBaselineOriginEnum +const ( + SqlPlanBaselineOriginAddmSqltune SqlPlanBaselineOriginEnum = "ADDM_SQLTUNE" + SqlPlanBaselineOriginAutoCapture SqlPlanBaselineOriginEnum = "AUTO_CAPTURE" + SqlPlanBaselineOriginAutoSqltune SqlPlanBaselineOriginEnum = "AUTO_SQLTUNE" + SqlPlanBaselineOriginEvolveAutoIndexLoad SqlPlanBaselineOriginEnum = "EVOLVE_AUTO_INDEX_LOAD" + SqlPlanBaselineOriginEvolveCreateFromAdaptive SqlPlanBaselineOriginEnum = "EVOLVE_CREATE_FROM_ADAPTIVE" + SqlPlanBaselineOriginEvolveLoadFromSts SqlPlanBaselineOriginEnum = "EVOLVE_LOAD_FROM_STS" + SqlPlanBaselineOriginEvolveLoadFromAwr SqlPlanBaselineOriginEnum = "EVOLVE_LOAD_FROM_AWR" + SqlPlanBaselineOriginEvolveLoadFromCursorCache SqlPlanBaselineOriginEnum = "EVOLVE_LOAD_FROM_CURSOR_CACHE" + SqlPlanBaselineOriginManualLoad SqlPlanBaselineOriginEnum = "MANUAL_LOAD" + SqlPlanBaselineOriginManualLoadFromAwr SqlPlanBaselineOriginEnum = "MANUAL_LOAD_FROM_AWR" + SqlPlanBaselineOriginManualLoadFromCursorCache SqlPlanBaselineOriginEnum = "MANUAL_LOAD_FROM_CURSOR_CACHE" + SqlPlanBaselineOriginManualLoadFromSts SqlPlanBaselineOriginEnum = "MANUAL_LOAD_FROM_STS" + SqlPlanBaselineOriginManualSqltune SqlPlanBaselineOriginEnum = "MANUAL_SQLTUNE" + SqlPlanBaselineOriginStoredOutline SqlPlanBaselineOriginEnum = "STORED_OUTLINE" + SqlPlanBaselineOriginUnknown SqlPlanBaselineOriginEnum = "UNKNOWN" +) + +var mappingSqlPlanBaselineOriginEnum = map[string]SqlPlanBaselineOriginEnum{ + "ADDM_SQLTUNE": SqlPlanBaselineOriginAddmSqltune, + "AUTO_CAPTURE": SqlPlanBaselineOriginAutoCapture, + "AUTO_SQLTUNE": SqlPlanBaselineOriginAutoSqltune, + "EVOLVE_AUTO_INDEX_LOAD": SqlPlanBaselineOriginEvolveAutoIndexLoad, + "EVOLVE_CREATE_FROM_ADAPTIVE": SqlPlanBaselineOriginEvolveCreateFromAdaptive, + "EVOLVE_LOAD_FROM_STS": SqlPlanBaselineOriginEvolveLoadFromSts, + "EVOLVE_LOAD_FROM_AWR": SqlPlanBaselineOriginEvolveLoadFromAwr, + "EVOLVE_LOAD_FROM_CURSOR_CACHE": SqlPlanBaselineOriginEvolveLoadFromCursorCache, + "MANUAL_LOAD": SqlPlanBaselineOriginManualLoad, + "MANUAL_LOAD_FROM_AWR": SqlPlanBaselineOriginManualLoadFromAwr, + "MANUAL_LOAD_FROM_CURSOR_CACHE": SqlPlanBaselineOriginManualLoadFromCursorCache, + "MANUAL_LOAD_FROM_STS": SqlPlanBaselineOriginManualLoadFromSts, + "MANUAL_SQLTUNE": SqlPlanBaselineOriginManualSqltune, + "STORED_OUTLINE": SqlPlanBaselineOriginStoredOutline, + "UNKNOWN": SqlPlanBaselineOriginUnknown, +} + +var mappingSqlPlanBaselineOriginEnumLowerCase = map[string]SqlPlanBaselineOriginEnum{ + "addm_sqltune": SqlPlanBaselineOriginAddmSqltune, + "auto_capture": SqlPlanBaselineOriginAutoCapture, + "auto_sqltune": SqlPlanBaselineOriginAutoSqltune, + "evolve_auto_index_load": SqlPlanBaselineOriginEvolveAutoIndexLoad, + "evolve_create_from_adaptive": SqlPlanBaselineOriginEvolveCreateFromAdaptive, + "evolve_load_from_sts": SqlPlanBaselineOriginEvolveLoadFromSts, + "evolve_load_from_awr": SqlPlanBaselineOriginEvolveLoadFromAwr, + "evolve_load_from_cursor_cache": SqlPlanBaselineOriginEvolveLoadFromCursorCache, + "manual_load": SqlPlanBaselineOriginManualLoad, + "manual_load_from_awr": SqlPlanBaselineOriginManualLoadFromAwr, + "manual_load_from_cursor_cache": SqlPlanBaselineOriginManualLoadFromCursorCache, + "manual_load_from_sts": SqlPlanBaselineOriginManualLoadFromSts, + "manual_sqltune": SqlPlanBaselineOriginManualSqltune, + "stored_outline": SqlPlanBaselineOriginStoredOutline, + "unknown": SqlPlanBaselineOriginUnknown, +} + +// GetSqlPlanBaselineOriginEnumValues Enumerates the set of values for SqlPlanBaselineOriginEnum +func GetSqlPlanBaselineOriginEnumValues() []SqlPlanBaselineOriginEnum { + values := make([]SqlPlanBaselineOriginEnum, 0) + for _, v := range mappingSqlPlanBaselineOriginEnum { + values = append(values, v) + } + return values +} + +// GetSqlPlanBaselineOriginEnumStringValues Enumerates the set of values in String for SqlPlanBaselineOriginEnum +func GetSqlPlanBaselineOriginEnumStringValues() []string { + return []string{ + "ADDM_SQLTUNE", + "AUTO_CAPTURE", + "AUTO_SQLTUNE", + "EVOLVE_AUTO_INDEX_LOAD", + "EVOLVE_CREATE_FROM_ADAPTIVE", + "EVOLVE_LOAD_FROM_STS", + "EVOLVE_LOAD_FROM_AWR", + "EVOLVE_LOAD_FROM_CURSOR_CACHE", + "MANUAL_LOAD", + "MANUAL_LOAD_FROM_AWR", + "MANUAL_LOAD_FROM_CURSOR_CACHE", + "MANUAL_LOAD_FROM_STS", + "MANUAL_SQLTUNE", + "STORED_OUTLINE", + "UNKNOWN", + } +} + +// GetMappingSqlPlanBaselineOriginEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSqlPlanBaselineOriginEnum(val string) (SqlPlanBaselineOriginEnum, bool) { + enum, ok := mappingSqlPlanBaselineOriginEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/sql_plan_baseline_summary.go b/databasemanagement/sql_plan_baseline_summary.go new file mode 100644 index 0000000000..cd44eb0d31 --- /dev/null +++ b/databasemanagement/sql_plan_baseline_summary.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlPlanBaselineSummary The summary of a SQL plan baseline. +type SqlPlanBaselineSummary struct { + + // The unique plan identifier. + PlanName *string `mandatory:"true" json:"planName"` + + // The unique SQL identifier. + SqlHandle *string `mandatory:"true" json:"sqlHandle"` + + // The SQL text (truncated to the first 50 characters). + SqlText *string `mandatory:"true" json:"sqlText"` + + // The date and time when the plan baseline was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The origin of the SQL plan baseline. + Origin SqlPlanBaselineOriginEnum `mandatory:"false" json:"origin,omitempty"` + + // The date and time when the plan baseline was last modified. + TimeLastModified *common.SDKTime `mandatory:"false" json:"timeLastModified"` + + // The date and time when the plan baseline was last executed. + // **Note:** For performance reasons, database does not update this value + // immediately after each execution of the plan baseline. Therefore, the plan + // baseline may have been executed more recently than this value indicates. + TimeLastExecuted *common.SDKTime `mandatory:"false" json:"timeLastExecuted"` + + // Indicates whether the plan baseline is enabled (`YES`) or disabled (`NO`). + Enabled *string `mandatory:"false" json:"enabled"` + + // Indicates whether the plan baseline is accepted (`YES`) or not (`NO`). + Accepted *string `mandatory:"false" json:"accepted"` + + // Indicates whether the plan baseline is fixed (`YES`) or not (`NO`). + Fixed *string `mandatory:"false" json:"fixed"` + + // Indicates whether the optimizer was able to reproduce the plan (`YES`) or not (`NO`). + // The value is set to `YES` when a plan is initially added to the plan baseline. + Reproduced *string `mandatory:"false" json:"reproduced"` + + // Indicates whether the plan baseline is auto-purged (`YES`) or not (`NO`). + AutoPurge *string `mandatory:"false" json:"autoPurge"` + + // Indicates whether a plan that is automatically captured by SQL plan management is marked adaptive or not. + // When a new adaptive plan is found for a SQL statement that has an existing SQL plan baseline, that new plan + // will be added to the SQL plan baseline as an unaccepted plan, and the `ADAPTIVE` property will be marked `YES`. + // When this new plan is verified (either manually or via the auto evolve task), the plan will be test executed + // and the final plan determined at execution will become an accepted plan if its performance is better than + // the existing plan baseline. At this point, the value of the `ADAPTIVE` property is set to `NO` since the plan + // is no longer adaptive, but resolved. + Adaptive *string `mandatory:"false" json:"adaptive"` +} + +func (m SqlPlanBaselineSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlPlanBaselineSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSqlPlanBaselineOriginEnum(string(m.Origin)); !ok && m.Origin != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Origin: %s. Supported values are: %s.", m.Origin, strings.Join(GetSqlPlanBaselineOriginEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/summarize_sql_plan_baselines_by_last_execution_request_response.go b/databasemanagement/summarize_sql_plan_baselines_by_last_execution_request_response.go new file mode 100644 index 0000000000..909d1252fe --- /dev/null +++ b/databasemanagement/summarize_sql_plan_baselines_by_last_execution_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SummarizeSqlPlanBaselinesByLastExecutionRequest wrapper for the SummarizeSqlPlanBaselinesByLastExecution operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/SummarizeSqlPlanBaselinesByLastExecution.go.html to see an example of how to use SummarizeSqlPlanBaselinesByLastExecutionRequest. +type SummarizeSqlPlanBaselinesByLastExecutionRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The page token representing the page from where the next set of paginated results + // are retrieved. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeSqlPlanBaselinesByLastExecutionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeSqlPlanBaselinesByLastExecutionRequest) 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 SummarizeSqlPlanBaselinesByLastExecutionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeSqlPlanBaselinesByLastExecutionRequest) 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 SummarizeSqlPlanBaselinesByLastExecutionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SummarizeSqlPlanBaselinesByLastExecutionResponse wrapper for the SummarizeSqlPlanBaselinesByLastExecution operation +type SummarizeSqlPlanBaselinesByLastExecutionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SqlPlanBaselineAggregationCollection instances + SqlPlanBaselineAggregationCollection `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 SummarizeSqlPlanBaselinesByLastExecutionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeSqlPlanBaselinesByLastExecutionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/summarize_sql_plan_baselines_request_response.go b/databasemanagement/summarize_sql_plan_baselines_request_response.go new file mode 100644 index 0000000000..d45bf7d352 --- /dev/null +++ b/databasemanagement/summarize_sql_plan_baselines_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SummarizeSqlPlanBaselinesRequest wrapper for the SummarizeSqlPlanBaselines operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/SummarizeSqlPlanBaselines.go.html to see an example of how to use SummarizeSqlPlanBaselinesRequest. +type SummarizeSqlPlanBaselinesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The page token representing the page from where the next set of paginated results + // are retrieved. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeSqlPlanBaselinesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeSqlPlanBaselinesRequest) 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 SummarizeSqlPlanBaselinesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeSqlPlanBaselinesRequest) 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 SummarizeSqlPlanBaselinesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SummarizeSqlPlanBaselinesResponse wrapper for the SummarizeSqlPlanBaselines operation +type SummarizeSqlPlanBaselinesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SqlPlanBaselineAggregationCollection instances + SqlPlanBaselineAggregationCollection `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 SummarizeSqlPlanBaselinesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeSqlPlanBaselinesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/top_sql_cpu_activity.go b/databasemanagement/top_sql_cpu_activity.go index 7b54005329..f3d38125ba 100644 --- a/databasemanagement/top_sql_cpu_activity.go +++ b/databasemanagement/top_sql_cpu_activity.go @@ -20,7 +20,7 @@ import ( // TopSqlCpuActivity A list of SQL IDs with most CPU activity. type TopSqlCpuActivity struct { - // A list of sql cpu activity. + // A list of sql CPU activity. Activity []SqlCpuActivity `mandatory:"true" json:"activity"` } diff --git a/databasemanagement/update_external_exadata_infrastructure_details.go b/databasemanagement/update_external_exadata_infrastructure_details.go index d9b0ca5bc8..ebb8bb7fce 100644 --- a/databasemanagement/update_external_exadata_infrastructure_details.go +++ b/databasemanagement/update_external_exadata_infrastructure_details.go @@ -17,10 +17,10 @@ import ( "strings" ) -// UpdateExternalExadataInfrastructureDetails The details of updating external Exadata infrastructure. +// UpdateExternalExadataInfrastructureDetails The details required to update the external Exadata infrastructure. type UpdateExternalExadataInfrastructureDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The unique key of the discovery request. @@ -32,10 +32,10 @@ type UpdateExternalExadataInfrastructureDetails struct { // The name of the Exadata infrastructure. DisplayName *string `mandatory:"false" json:"displayName"` - // The list of all the rac database system OCIDs. If not specified, it keeps the existing database systems + // The list of all the DB systems OCIDs. DbSystemIds []string `mandatory:"false" json:"dbSystemIds"` - // The list of the names of the storage servers to be monitored. If not specified, it includes all the storage servers associated with the monitored database systems. + // The list of the names of Exadata storage servers to be monitored. If not specified, it includes all Exadata storage servers associated with the monitored DB systems. StorageServerNames []string `mandatory:"false" json:"storageServerNames"` } diff --git a/databasemanagement/update_external_exadata_storage_connector_details.go b/databasemanagement/update_external_exadata_storage_connector_details.go index 1f340e9d48..26f022e1ae 100644 --- a/databasemanagement/update_external_exadata_storage_connector_details.go +++ b/databasemanagement/update_external_exadata_storage_connector_details.go @@ -17,13 +17,13 @@ import ( "strings" ) -// UpdateExternalExadataStorageConnectorDetails The connector details of the storage server to be updated. +// UpdateExternalExadataStorageConnectorDetails The connector details of the Exadata storage server to be updated. type UpdateExternalExadataStorageConnectorDetails struct { - // The connector name if OCI connector is created. + // The name of the Exadata storage server connector. ConnectorName *string `mandatory:"false" json:"connectorName"` - // The unique connection string of the connection. For example, "https://slcm21celadm02.us.oracle.com:443/MS/RESTService/". + // The unique string of the connection. For example, "https:///MS/RESTService/". ConnectionUri *string `mandatory:"false" json:"connectionUri"` CredentialInfo *RestCredential `mandatory:"false" json:"credentialInfo"` diff --git a/databasemanagement/update_external_exadata_storage_connector_request_response.go b/databasemanagement/update_external_exadata_storage_connector_request_response.go index 24d110440d..2a37bee8df 100644 --- a/databasemanagement/update_external_exadata_storage_connector_request_response.go +++ b/databasemanagement/update_external_exadata_storage_connector_request_response.go @@ -21,7 +21,7 @@ type UpdateExternalExadataStorageConnectorRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the connector to the Exadata storage server. ExternalExadataStorageConnectorId *string `mandatory:"true" contributesTo:"path" name:"externalExadataStorageConnectorId"` - // The details required to add connections to the storage servers. + // The details required to update connections to the Exadata storage servers. UpdateExternalExadataStorageConnectorDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call diff --git a/databasemanagement/update_sql_job_details.go b/databasemanagement/update_sql_job_details.go index afb8ad5c38..f25e98d277 100644 --- a/databasemanagement/update_sql_job_details.go +++ b/databasemanagement/update_sql_job_details.go @@ -34,6 +34,10 @@ type UpdateSqlJobDetails struct { // The SQL text to be executed as part of the job. SqlText *string `mandatory:"false" json:"sqlText"` + InBinds *JobInBindsDetails `mandatory:"false" json:"inBinds"` + + OutBinds *JobOutBindsDetails `mandatory:"false" json:"outBinds"` + // The database user name used to execute the SQL job. If the job is being executed on a // Managed Database Group, then the user name should exist on all the databases in the // group with the same password. @@ -115,6 +119,8 @@ func (m *UpdateSqlJobDetails) UnmarshalJSON(data []byte) (e error) { ResultLocation jobexecutionresultlocation `json:"resultLocation"` ScheduleDetails *JobScheduleDetails `json:"scheduleDetails"` SqlText *string `json:"sqlText"` + InBinds *JobInBindsDetails `json:"inBinds"` + OutBinds *JobOutBindsDetails `json:"outBinds"` SqlType SqlJobSqlTypeEnum `json:"sqlType"` UserName *string `json:"userName"` Password *string `json:"password"` @@ -145,6 +151,10 @@ func (m *UpdateSqlJobDetails) UnmarshalJSON(data []byte) (e error) { m.SqlText = model.SqlText + m.InBinds = model.InBinds + + m.OutBinds = model.OutBinds + m.SqlType = model.SqlType m.UserName = model.UserName diff --git a/dataflow/change_sql_endpoint_compartment_details.go b/dataflow/change_sql_endpoint_compartment_details.go new file mode 100644 index 0000000000..895cbb23c7 --- /dev/null +++ b/dataflow/change_sql_endpoint_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeSqlEndpointCompartmentDetails Details for changing the compartment of a SQL Endpoint. +type ChangeSqlEndpointCompartmentDetails struct { + + // The OCID of the compartment into which the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeSqlEndpointCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeSqlEndpointCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/dataflow/change_sql_endpoint_compartment_request_response.go b/dataflow/change_sql_endpoint_compartment_request_response.go new file mode 100644 index 0000000000..1b05e627a9 --- /dev/null +++ b/dataflow/change_sql_endpoint_compartment_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeSqlEndpointCompartmentRequest wrapper for the ChangeSqlEndpointCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/ChangeSqlEndpointCompartment.go.html to see an example of how to use ChangeSqlEndpointCompartmentRequest. +type ChangeSqlEndpointCompartmentRequest struct { + + // The unique id of the SQL Endpoint. + SqlEndpointId *string `mandatory:"true" contributesTo:"path" name:"sqlEndpointId"` + + // The details to change the compartment of the Sql Endpoint. + ChangeSqlEndpointCompartmentDetails `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. + // For example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeSqlEndpointCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeSqlEndpointCompartmentRequest) 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 ChangeSqlEndpointCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeSqlEndpointCompartmentRequest) 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 ChangeSqlEndpointCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeSqlEndpointCompartmentResponse wrapper for the ChangeSqlEndpointCompartment operation +type ChangeSqlEndpointCompartmentResponse 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 a work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response ChangeSqlEndpointCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeSqlEndpointCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/dataflow/create_sql_endpoint_details.go b/dataflow/create_sql_endpoint_details.go new file mode 100644 index 0000000000..a0a7f25763 --- /dev/null +++ b/dataflow/create_sql_endpoint_details.go @@ -0,0 +1,164 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSqlEndpointDetails The information about a new SQL Endpoint. +type CreateSqlEndpointDetails struct { + + // The identifier of the compartment used with the SQL Endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The SQL Endpoint name, which can be changed. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The version of the SQL Endpoint. + SqlEndpointVersion *string `mandatory:"true" json:"sqlEndpointVersion"` + + // The shape of the SQL Endpoint driver instance. + DriverShape *string `mandatory:"true" json:"driverShape"` + + // The shape of the SQL Endpoint worker instance. + ExecutorShape *string `mandatory:"true" json:"executorShape"` + + // The minimum number of executors. + MinExecutorCount *int `mandatory:"true" json:"minExecutorCount"` + + // The maximum number of executors. + MaxExecutorCount *int `mandatory:"true" json:"maxExecutorCount"` + + // Metastore OCID + MetastoreId *string `mandatory:"true" json:"metastoreId"` + + // OCI lake OCID + LakeId *string `mandatory:"true" json:"lakeId"` + + // The warehouse bucket URI. It is a Oracle Cloud Infrastructure Object Storage bucket URI as defined here https://docs.oracle.com/en/cloud/paas/atp-cloud/atpud/object-storage-uris.html + WarehouseBucketUri *string `mandatory:"true" json:"warehouseBucketUri"` + + NetworkConfiguration SqlEndpointNetworkConfiguration `mandatory:"true" json:"networkConfiguration"` + + // The description of CreateSQLEndpointDetails. + Description *string `mandatory:"false" json:"description"` + + DriverShapeConfig *ShapeConfig `mandatory:"false" json:"driverShapeConfig"` + + ExecutorShapeConfig *ShapeConfig `mandatory:"false" json:"executorShapeConfig"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Spark configuration passed to the running process. + // See https://spark.apache.org/docs/latest/configuration.html#available-properties. + // Example: { "spark.app.name" : "My App Name", "spark.shuffle.io.maxRetries" : "4" } + // Note: Not all Spark properties are permitted to be set. Attempting to set a property that is + // not allowed to be overwritten will cause a 400 status to be returned. + SparkAdvancedConfigurations map[string]string `mandatory:"false" json:"sparkAdvancedConfigurations"` +} + +func (m CreateSqlEndpointDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateSqlEndpointDetails) 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 *CreateSqlEndpointDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Description *string `json:"description"` + DriverShapeConfig *ShapeConfig `json:"driverShapeConfig"` + ExecutorShapeConfig *ShapeConfig `json:"executorShapeConfig"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SparkAdvancedConfigurations map[string]string `json:"sparkAdvancedConfigurations"` + CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + SqlEndpointVersion *string `json:"sqlEndpointVersion"` + DriverShape *string `json:"driverShape"` + ExecutorShape *string `json:"executorShape"` + MinExecutorCount *int `json:"minExecutorCount"` + MaxExecutorCount *int `json:"maxExecutorCount"` + MetastoreId *string `json:"metastoreId"` + LakeId *string `json:"lakeId"` + WarehouseBucketUri *string `json:"warehouseBucketUri"` + NetworkConfiguration sqlendpointnetworkconfiguration `json:"networkConfiguration"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Description = model.Description + + m.DriverShapeConfig = model.DriverShapeConfig + + m.ExecutorShapeConfig = model.ExecutorShapeConfig + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SparkAdvancedConfigurations = model.SparkAdvancedConfigurations + + m.CompartmentId = model.CompartmentId + + m.DisplayName = model.DisplayName + + m.SqlEndpointVersion = model.SqlEndpointVersion + + m.DriverShape = model.DriverShape + + m.ExecutorShape = model.ExecutorShape + + m.MinExecutorCount = model.MinExecutorCount + + m.MaxExecutorCount = model.MaxExecutorCount + + m.MetastoreId = model.MetastoreId + + m.LakeId = model.LakeId + + m.WarehouseBucketUri = model.WarehouseBucketUri + + nn, e = model.NetworkConfiguration.UnmarshalPolymorphicJSON(model.NetworkConfiguration.JsonData) + if e != nil { + return + } + if nn != nil { + m.NetworkConfiguration = nn.(SqlEndpointNetworkConfiguration) + } else { + m.NetworkConfiguration = nil + } + + return +} diff --git a/dataflow/create_sql_endpoint_request_response.go b/dataflow/create_sql_endpoint_request_response.go new file mode 100644 index 0000000000..e190b1b371 --- /dev/null +++ b/dataflow/create_sql_endpoint_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateSqlEndpointRequest wrapper for the CreateSqlEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/CreateSqlEndpoint.go.html to see an example of how to use CreateSqlEndpointRequest. +type CreateSqlEndpointRequest struct { + + // Details of the new Sql Endpoint. + CreateSqlEndpointDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error + // without risk of executing that same action again. Retry tokens expire after 24 hours, + // but can be invalidated before then due to conflicting operations. + // For example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. 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 CreateSqlEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSqlEndpointRequest) 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 CreateSqlEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSqlEndpointRequest) 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 CreateSqlEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSqlEndpointResponse wrapper for the CreateSqlEndpoint operation +type CreateSqlEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SqlEndpoint instance + SqlEndpoint `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"` + + // Unique Oracle assigned identifier for a work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // For optimistic concurrency control. + // See ETags for Optimistic Concurrency Control (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#eleven). + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateSqlEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSqlEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/dataflow/dataflow_client.go b/dataflow/dataflow_client.go index 4665d39fff..5e099accc2 100644 --- a/dataflow/dataflow_client.go +++ b/dataflow/dataflow_client.go @@ -339,6 +339,68 @@ func (client DataFlowClient) changeRunCompartment(ctx context.Context, request c return response, err } +// ChangeSqlEndpointCompartment Moves an Sql Endpoint from one compartment to another. When provided, If-Match is checked against ETag values of the Sql Endpoint. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/ChangeSqlEndpointCompartment.go.html to see an example of how to use ChangeSqlEndpointCompartment API. +func (client DataFlowClient) ChangeSqlEndpointCompartment(ctx context.Context, request ChangeSqlEndpointCompartmentRequest) (response ChangeSqlEndpointCompartmentResponse, 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.changeSqlEndpointCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeSqlEndpointCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeSqlEndpointCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeSqlEndpointCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeSqlEndpointCompartmentResponse") + } + return +} + +// changeSqlEndpointCompartment implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) changeSqlEndpointCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/sqlEndpoints/{sqlEndpointId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeSqlEndpointCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-flow/20200129/SqlEndpoint/ChangeSqlEndpointCompartment" + err = common.PostProcessServiceError(err, "DataFlow", "ChangeSqlEndpointCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateApplication Creates an application. // // See also @@ -588,6 +650,68 @@ func (client DataFlowClient) createRun(ctx context.Context, request common.OCIRe return response, err } +// CreateSqlEndpoint Create a new Sql Endpoint. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/CreateSqlEndpoint.go.html to see an example of how to use CreateSqlEndpoint API. +func (client DataFlowClient) CreateSqlEndpoint(ctx context.Context, request CreateSqlEndpointRequest) (response CreateSqlEndpointResponse, 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.createSqlEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateSqlEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateSqlEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateSqlEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSqlEndpointResponse") + } + return +} + +// createSqlEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) createSqlEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/sqlEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateSqlEndpointResponse + 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, "DataFlow", "CreateSqlEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateStatement Executes a statement for a Session run. // // See also @@ -874,6 +998,63 @@ func (client DataFlowClient) deleteRun(ctx context.Context, request common.OCIRe return response, err } +// DeleteSqlEndpoint Delete a Sql Endpoint resource, identified by the SqlEndpoint id. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/DeleteSqlEndpoint.go.html to see an example of how to use DeleteSqlEndpoint API. +func (client DataFlowClient) DeleteSqlEndpoint(ctx context.Context, request DeleteSqlEndpointRequest) (response DeleteSqlEndpointResponse, 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.deleteSqlEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteSqlEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteSqlEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteSqlEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSqlEndpointResponse") + } + return +} + +// deleteSqlEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) deleteSqlEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/sqlEndpoints/{sqlEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteSqlEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-flow/20200129/SqlEndpoint/DeleteSqlEndpoint" + err = common.PostProcessServiceError(err, "DataFlow", "DeleteSqlEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteStatement Cancels the specified statement for a Session run. // // See also @@ -1221,6 +1402,64 @@ func (client DataFlowClient) getRunLog(ctx context.Context, request common.OCIRe return response, err } +// GetSqlEndpoint Retrieves a SQL Endpoint using a sqlEndpointId. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/GetSqlEndpoint.go.html to see an example of how to use GetSqlEndpoint API. +// A default retry strategy applies to this operation GetSqlEndpoint() +func (client DataFlowClient) GetSqlEndpoint(ctx context.Context, request GetSqlEndpointRequest) (response GetSqlEndpointResponse, 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.getSqlEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetSqlEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetSqlEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetSqlEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSqlEndpointResponse") + } + return +} + +// getSqlEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) getSqlEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/sqlEndpoints/{sqlEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetSqlEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-flow/20200129/SqlEndpoint/GetSqlEndpoint" + err = common.PostProcessServiceError(err, "DataFlow", "GetSqlEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetStatement Retrieves the statement corresponding to the `statementId` for a Session run specified by `runId`. // // See also @@ -1627,6 +1866,66 @@ func (client DataFlowClient) listRuns(ctx context.Context, request common.OCIReq return response, err } +// ListSqlEndpoints Lists all Sql Endpoints in the specified compartment. +// The query must include compartmentId or sqlEndpointId. +// If the query does not include either compartmentId or sqlEndpointId, an error is returned. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/ListSqlEndpoints.go.html to see an example of how to use ListSqlEndpoints API. +// A default retry strategy applies to this operation ListSqlEndpoints() +func (client DataFlowClient) ListSqlEndpoints(ctx context.Context, request ListSqlEndpointsRequest) (response ListSqlEndpointsResponse, 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.listSqlEndpoints, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListSqlEndpointsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListSqlEndpointsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListSqlEndpointsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSqlEndpointsResponse") + } + return +} + +// listSqlEndpoints implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) listSqlEndpoints(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/sqlEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListSqlEndpointsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-flow/20200129/SqlEndpointCollection/ListSqlEndpoints" + err = common.PostProcessServiceError(err, "DataFlow", "ListSqlEndpoints", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListStatements Lists all statements for a Session run. // // See also @@ -2216,3 +2515,60 @@ func (client DataFlowClient) updateRun(ctx context.Context, request common.OCIRe err = common.UnmarshalResponse(httpResponse, &response) return response, err } + +// UpdateSqlEndpoint Update a Sql Endpoint resource, identified by the SqlEndpoint id. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/UpdateSqlEndpoint.go.html to see an example of how to use UpdateSqlEndpoint API. +func (client DataFlowClient) UpdateSqlEndpoint(ctx context.Context, request UpdateSqlEndpointRequest) (response UpdateSqlEndpointResponse, 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.updateSqlEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateSqlEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateSqlEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSqlEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSqlEndpointResponse") + } + return +} + +// updateSqlEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) updateSqlEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/sqlEndpoints/{sqlEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateSqlEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-flow/20200129/SqlEndpoint/UpdateSqlEndpoint" + err = common.PostProcessServiceError(err, "DataFlow", "UpdateSqlEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/dataflow/delete_sql_endpoint_request_response.go b/dataflow/delete_sql_endpoint_request_response.go new file mode 100644 index 0000000000..b53980d7ff --- /dev/null +++ b/dataflow/delete_sql_endpoint_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteSqlEndpointRequest wrapper for the DeleteSqlEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/DeleteSqlEndpoint.go.html to see an example of how to use DeleteSqlEndpointRequest. +type DeleteSqlEndpointRequest struct { + + // The unique id of the SQL Endpoint. + SqlEndpointId *string `mandatory:"true" contributesTo:"path" name:"sqlEndpointId"` + + // 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 DeleteSqlEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSqlEndpointRequest) 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 DeleteSqlEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSqlEndpointRequest) 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 DeleteSqlEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteSqlEndpointResponse wrapper for the DeleteSqlEndpoint operation +type DeleteSqlEndpointResponse 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 a work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteSqlEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSqlEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/dataflow/get_sql_endpoint_request_response.go b/dataflow/get_sql_endpoint_request_response.go new file mode 100644 index 0000000000..98bfe2d3e6 --- /dev/null +++ b/dataflow/get_sql_endpoint_request_response.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSqlEndpointRequest wrapper for the GetSqlEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/GetSqlEndpoint.go.html to see an example of how to use GetSqlEndpointRequest. +type GetSqlEndpointRequest struct { + + // The unique id of the SQL Endpoint. + SqlEndpointId *string `mandatory:"true" contributesTo:"path" name:"sqlEndpointId"` + + // 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 GetSqlEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSqlEndpointRequest) 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 GetSqlEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSqlEndpointRequest) 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 GetSqlEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSqlEndpointResponse wrapper for the GetSqlEndpoint operation +type GetSqlEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SqlEndpoint instance + SqlEndpoint `presentIn:"body"` + + // For optimistic concurrency control. + // See ETags for Optimistic Concurrency Control (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#eleven). + 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 GetSqlEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSqlEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/dataflow/ip_notation_type.go b/dataflow/ip_notation_type.go new file mode 100644 index 0000000000..d16388ce67 --- /dev/null +++ b/dataflow/ip_notation_type.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "strings" +) + +// IpNotationTypeEnum Enum with underlying type: string +type IpNotationTypeEnum string + +// Set of constants representing the allowable values for IpNotationTypeEnum +const ( + IpNotationTypeIpAddress IpNotationTypeEnum = "IP_ADDRESS" + IpNotationTypeCidr IpNotationTypeEnum = "CIDR" + IpNotationTypeVcn IpNotationTypeEnum = "VCN" + IpNotationTypeVcnOcid IpNotationTypeEnum = "VCN_OCID" +) + +var mappingIpNotationTypeEnum = map[string]IpNotationTypeEnum{ + "IP_ADDRESS": IpNotationTypeIpAddress, + "CIDR": IpNotationTypeCidr, + "VCN": IpNotationTypeVcn, + "VCN_OCID": IpNotationTypeVcnOcid, +} + +var mappingIpNotationTypeEnumLowerCase = map[string]IpNotationTypeEnum{ + "ip_address": IpNotationTypeIpAddress, + "cidr": IpNotationTypeCidr, + "vcn": IpNotationTypeVcn, + "vcn_ocid": IpNotationTypeVcnOcid, +} + +// GetIpNotationTypeEnumValues Enumerates the set of values for IpNotationTypeEnum +func GetIpNotationTypeEnumValues() []IpNotationTypeEnum { + values := make([]IpNotationTypeEnum, 0) + for _, v := range mappingIpNotationTypeEnum { + values = append(values, v) + } + return values +} + +// GetIpNotationTypeEnumStringValues Enumerates the set of values in String for IpNotationTypeEnum +func GetIpNotationTypeEnumStringValues() []string { + return []string{ + "IP_ADDRESS", + "CIDR", + "VCN", + "VCN_OCID", + } +} + +// GetMappingIpNotationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingIpNotationTypeEnum(val string) (IpNotationTypeEnum, bool) { + enum, ok := mappingIpNotationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/dataflow/list_sql_endpoints_request_response.go b/dataflow/list_sql_endpoints_request_response.go new file mode 100644 index 0000000000..0159ff92d4 --- /dev/null +++ b/dataflow/list_sql_endpoints_request_response.go @@ -0,0 +1,267 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSqlEndpointsRequest wrapper for the ListSqlEndpoints operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/ListSqlEndpoints.go.html to see an example of how to use ListSqlEndpointsRequest. +type ListSqlEndpointsRequest struct { + + // The OCID of the compartment in which to query resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The unique id of the SQL Endpoint. + SqlEndpointId *string `mandatory:"false" contributesTo:"query" name:"sqlEndpointId"` + + // A filter to return only those resources whose sqlEndpointLifecycleState matches the given sqlEndpointLifecycleState. + LifecycleState ListSqlEndpointsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The query parameter for the Spark application name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The maximum number of items that can be returned. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The ordering of results in ascending or descending order. + SortOrder ListSqlEndpointsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. The default order for timeCreated is descending. The default order for displayName is ascending. If no value is specified timeCreated is used by default. + SortBy ListSqlEndpointsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // 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 ListSqlEndpointsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSqlEndpointsRequest) 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 ListSqlEndpointsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSqlEndpointsRequest) 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 ListSqlEndpointsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSqlEndpointsLifecycleStateEnum(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(GetListSqlEndpointsLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListSqlEndpointsSortOrderEnum(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(GetListSqlEndpointsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListSqlEndpointsSortByEnum(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(GetListSqlEndpointsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSqlEndpointsResponse wrapper for the ListSqlEndpoints operation +type ListSqlEndpointsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SqlEndpointCollection instances + SqlEndpointCollection `presentIn:"body"` + + // Retrieves the next page of results. When this header appears in the response, + // additional pages of results remain. See List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListSqlEndpointsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSqlEndpointsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSqlEndpointsLifecycleStateEnum Enum with underlying type: string +type ListSqlEndpointsLifecycleStateEnum string + +// Set of constants representing the allowable values for ListSqlEndpointsLifecycleStateEnum +const ( + ListSqlEndpointsLifecycleStateCreating ListSqlEndpointsLifecycleStateEnum = "CREATING" + ListSqlEndpointsLifecycleStateActive ListSqlEndpointsLifecycleStateEnum = "ACTIVE" + ListSqlEndpointsLifecycleStateDeleting ListSqlEndpointsLifecycleStateEnum = "DELETING" + ListSqlEndpointsLifecycleStateDeleted ListSqlEndpointsLifecycleStateEnum = "DELETED" + ListSqlEndpointsLifecycleStateFailed ListSqlEndpointsLifecycleStateEnum = "FAILED" +) + +var mappingListSqlEndpointsLifecycleStateEnum = map[string]ListSqlEndpointsLifecycleStateEnum{ + "CREATING": ListSqlEndpointsLifecycleStateCreating, + "ACTIVE": ListSqlEndpointsLifecycleStateActive, + "DELETING": ListSqlEndpointsLifecycleStateDeleting, + "DELETED": ListSqlEndpointsLifecycleStateDeleted, + "FAILED": ListSqlEndpointsLifecycleStateFailed, +} + +var mappingListSqlEndpointsLifecycleStateEnumLowerCase = map[string]ListSqlEndpointsLifecycleStateEnum{ + "creating": ListSqlEndpointsLifecycleStateCreating, + "active": ListSqlEndpointsLifecycleStateActive, + "deleting": ListSqlEndpointsLifecycleStateDeleting, + "deleted": ListSqlEndpointsLifecycleStateDeleted, + "failed": ListSqlEndpointsLifecycleStateFailed, +} + +// GetListSqlEndpointsLifecycleStateEnumValues Enumerates the set of values for ListSqlEndpointsLifecycleStateEnum +func GetListSqlEndpointsLifecycleStateEnumValues() []ListSqlEndpointsLifecycleStateEnum { + values := make([]ListSqlEndpointsLifecycleStateEnum, 0) + for _, v := range mappingListSqlEndpointsLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListSqlEndpointsLifecycleStateEnumStringValues Enumerates the set of values in String for ListSqlEndpointsLifecycleStateEnum +func GetListSqlEndpointsLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListSqlEndpointsLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlEndpointsLifecycleStateEnum(val string) (ListSqlEndpointsLifecycleStateEnum, bool) { + enum, ok := mappingListSqlEndpointsLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSqlEndpointsSortOrderEnum Enum with underlying type: string +type ListSqlEndpointsSortOrderEnum string + +// Set of constants representing the allowable values for ListSqlEndpointsSortOrderEnum +const ( + ListSqlEndpointsSortOrderAsc ListSqlEndpointsSortOrderEnum = "ASC" + ListSqlEndpointsSortOrderDesc ListSqlEndpointsSortOrderEnum = "DESC" +) + +var mappingListSqlEndpointsSortOrderEnum = map[string]ListSqlEndpointsSortOrderEnum{ + "ASC": ListSqlEndpointsSortOrderAsc, + "DESC": ListSqlEndpointsSortOrderDesc, +} + +var mappingListSqlEndpointsSortOrderEnumLowerCase = map[string]ListSqlEndpointsSortOrderEnum{ + "asc": ListSqlEndpointsSortOrderAsc, + "desc": ListSqlEndpointsSortOrderDesc, +} + +// GetListSqlEndpointsSortOrderEnumValues Enumerates the set of values for ListSqlEndpointsSortOrderEnum +func GetListSqlEndpointsSortOrderEnumValues() []ListSqlEndpointsSortOrderEnum { + values := make([]ListSqlEndpointsSortOrderEnum, 0) + for _, v := range mappingListSqlEndpointsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSqlEndpointsSortOrderEnumStringValues Enumerates the set of values in String for ListSqlEndpointsSortOrderEnum +func GetListSqlEndpointsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSqlEndpointsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlEndpointsSortOrderEnum(val string) (ListSqlEndpointsSortOrderEnum, bool) { + enum, ok := mappingListSqlEndpointsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSqlEndpointsSortByEnum Enum with underlying type: string +type ListSqlEndpointsSortByEnum string + +// Set of constants representing the allowable values for ListSqlEndpointsSortByEnum +const ( + ListSqlEndpointsSortById ListSqlEndpointsSortByEnum = "id" + ListSqlEndpointsSortByTimecreated ListSqlEndpointsSortByEnum = "timeCreated" + ListSqlEndpointsSortByDisplayname ListSqlEndpointsSortByEnum = "displayName" +) + +var mappingListSqlEndpointsSortByEnum = map[string]ListSqlEndpointsSortByEnum{ + "id": ListSqlEndpointsSortById, + "timeCreated": ListSqlEndpointsSortByTimecreated, + "displayName": ListSqlEndpointsSortByDisplayname, +} + +var mappingListSqlEndpointsSortByEnumLowerCase = map[string]ListSqlEndpointsSortByEnum{ + "id": ListSqlEndpointsSortById, + "timecreated": ListSqlEndpointsSortByTimecreated, + "displayname": ListSqlEndpointsSortByDisplayname, +} + +// GetListSqlEndpointsSortByEnumValues Enumerates the set of values for ListSqlEndpointsSortByEnum +func GetListSqlEndpointsSortByEnumValues() []ListSqlEndpointsSortByEnum { + values := make([]ListSqlEndpointsSortByEnum, 0) + for _, v := range mappingListSqlEndpointsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSqlEndpointsSortByEnumStringValues Enumerates the set of values in String for ListSqlEndpointsSortByEnum +func GetListSqlEndpointsSortByEnumStringValues() []string { + return []string{ + "id", + "timeCreated", + "displayName", + } +} + +// GetMappingListSqlEndpointsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSqlEndpointsSortByEnum(val string) (ListSqlEndpointsSortByEnum, bool) { + enum, ok := mappingListSqlEndpointsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/dataflow/network_type.go b/dataflow/network_type.go new file mode 100644 index 0000000000..fdbaace0fa --- /dev/null +++ b/dataflow/network_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "strings" +) + +// NetworkTypeEnum Enum with underlying type: string +type NetworkTypeEnum string + +// Set of constants representing the allowable values for NetworkTypeEnum +const ( + NetworkTypeVcn NetworkTypeEnum = "VCN" + NetworkTypeSecureAccess NetworkTypeEnum = "SECURE_ACCESS" +) + +var mappingNetworkTypeEnum = map[string]NetworkTypeEnum{ + "VCN": NetworkTypeVcn, + "SECURE_ACCESS": NetworkTypeSecureAccess, +} + +var mappingNetworkTypeEnumLowerCase = map[string]NetworkTypeEnum{ + "vcn": NetworkTypeVcn, + "secure_access": NetworkTypeSecureAccess, +} + +// GetNetworkTypeEnumValues Enumerates the set of values for NetworkTypeEnum +func GetNetworkTypeEnumValues() []NetworkTypeEnum { + values := make([]NetworkTypeEnum, 0) + for _, v := range mappingNetworkTypeEnum { + values = append(values, v) + } + return values +} + +// GetNetworkTypeEnumStringValues Enumerates the set of values in String for NetworkTypeEnum +func GetNetworkTypeEnumStringValues() []string { + return []string{ + "VCN", + "SECURE_ACCESS", + } +} + +// GetMappingNetworkTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNetworkTypeEnum(val string) (NetworkTypeEnum, bool) { + enum, ok := mappingNetworkTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/dataflow/secure_access_control_rule.go b/dataflow/secure_access_control_rule.go new file mode 100644 index 0000000000..315b06dda1 --- /dev/null +++ b/dataflow/secure_access_control_rule.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SecureAccessControlRule The access control rule for SECURE_ACCESS network type selection. +type SecureAccessControlRule struct { + + // The type of IP notation. + IpNotation IpNotationTypeEnum `mandatory:"true" json:"ipNotation"` + + // The associated value of the selected IP notation. + Value *string `mandatory:"true" json:"value"` + + // A comma-separated IP or CIDR address for VCN OCID IP notation selection. + VcnIps *string `mandatory:"false" json:"vcnIps"` +} + +func (m SecureAccessControlRule) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SecureAccessControlRule) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingIpNotationTypeEnum(string(m.IpNotation)); !ok && m.IpNotation != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for IpNotation: %s. Supported values are: %s.", m.IpNotation, strings.Join(GetIpNotationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/dataflow/sql_endpoint.go b/dataflow/sql_endpoint.go new file mode 100644 index 0000000000..c282a912e9 --- /dev/null +++ b/dataflow/sql_endpoint.go @@ -0,0 +1,217 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlEndpoint The description of a SQL Endpoint. +type SqlEndpoint struct { + + // The provision identifier that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The SQL Endpoint name, which can be changed. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of a compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The version of SQL Endpoint. + SqlEndpointVersion *string `mandatory:"true" json:"sqlEndpointVersion"` + + // The shape of the SQL Endpoint driver instance. + DriverShape *string `mandatory:"true" json:"driverShape"` + + // The shape of the SQL Endpoint executor instance. + ExecutorShape *string `mandatory:"true" json:"executorShape"` + + // The minimum number of executors. + MinExecutorCount *int `mandatory:"true" json:"minExecutorCount"` + + // The maximum number of executors. + MaxExecutorCount *int `mandatory:"true" json:"maxExecutorCount"` + + // The OCID of OCI Hive Metastore. + MetastoreId *string `mandatory:"true" json:"metastoreId"` + + // The OCID of OCI Lake. + LakeId *string `mandatory:"true" json:"lakeId"` + + // The warehouse bucket URI. It is a Oracle Cloud Infrastructure Object Storage bucket URI as defined here https://docs.oracle.com/en/cloud/paas/atp-cloud/atpud/object-storage-uris.html + WarehouseBucketUri *string `mandatory:"true" json:"warehouseBucketUri"` + + // The description of the SQL Endpoint. + Description *string `mandatory:"true" json:"description"` + + // The JDBC URL field. For example, jdbc:spark://{serviceFQDN}:443/default;SparkServerType=DFI + JdbcEndpointUrl *string `mandatory:"false" json:"jdbcEndpointUrl"` + + // The time the Sql Endpoint was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the Sql Endpoint was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The current state of the Sql Endpoint. + LifecycleState SqlEndpointLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // A message describing the reason why the resource is in it's current state. Helps bubble up errors in state changes. For example, it can be used to provide actionable information for a resource in the Failed state. + StateMessage *string `mandatory:"false" json:"stateMessage"` + + DriverShapeConfig *ShapeConfig `mandatory:"false" json:"driverShapeConfig"` + + ExecutorShapeConfig *ShapeConfig `mandatory:"false" json:"executorShapeConfig"` + + // This token is used by Splat, and indicates that the service accepts the request, and that the request is currently being processed. + LastAcceptedRequestToken *string `mandatory:"false" json:"lastAcceptedRequestToken"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The Spark configuration passed to the running process. + // See https://spark.apache.org/docs/latest/configuration.html#available-properties. + // Example: { "spark.app.name" : "My App Name", "spark.shuffle.io.maxRetries" : "4" } + // Note: Not all Spark properties are permitted to be set. Attempting to set a property that is + // not allowed to be overwritten will cause a 400 status to be returned. + SparkAdvancedConfigurations map[string]string `mandatory:"false" json:"sparkAdvancedConfigurations"` + + NetworkConfiguration SqlEndpointNetworkConfiguration `mandatory:"false" json:"networkConfiguration"` +} + +func (m SqlEndpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlEndpoint) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSqlEndpointLifecycleStateEnum(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(GetSqlEndpointLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *SqlEndpoint) UnmarshalJSON(data []byte) (e error) { + model := struct { + JdbcEndpointUrl *string `json:"jdbcEndpointUrl"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleState SqlEndpointLifecycleStateEnum `json:"lifecycleState"` + StateMessage *string `json:"stateMessage"` + DriverShapeConfig *ShapeConfig `json:"driverShapeConfig"` + ExecutorShapeConfig *ShapeConfig `json:"executorShapeConfig"` + LastAcceptedRequestToken *string `json:"lastAcceptedRequestToken"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + SparkAdvancedConfigurations map[string]string `json:"sparkAdvancedConfigurations"` + NetworkConfiguration sqlendpointnetworkconfiguration `json:"networkConfiguration"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + CompartmentId *string `json:"compartmentId"` + SqlEndpointVersion *string `json:"sqlEndpointVersion"` + DriverShape *string `json:"driverShape"` + ExecutorShape *string `json:"executorShape"` + MinExecutorCount *int `json:"minExecutorCount"` + MaxExecutorCount *int `json:"maxExecutorCount"` + MetastoreId *string `json:"metastoreId"` + LakeId *string `json:"lakeId"` + WarehouseBucketUri *string `json:"warehouseBucketUri"` + Description *string `json:"description"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.JdbcEndpointUrl = model.JdbcEndpointUrl + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.LifecycleState = model.LifecycleState + + m.StateMessage = model.StateMessage + + m.DriverShapeConfig = model.DriverShapeConfig + + m.ExecutorShapeConfig = model.ExecutorShapeConfig + + m.LastAcceptedRequestToken = model.LastAcceptedRequestToken + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.SparkAdvancedConfigurations = model.SparkAdvancedConfigurations + + nn, e = model.NetworkConfiguration.UnmarshalPolymorphicJSON(model.NetworkConfiguration.JsonData) + if e != nil { + return + } + if nn != nil { + m.NetworkConfiguration = nn.(SqlEndpointNetworkConfiguration) + } else { + m.NetworkConfiguration = nil + } + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.CompartmentId = model.CompartmentId + + m.SqlEndpointVersion = model.SqlEndpointVersion + + m.DriverShape = model.DriverShape + + m.ExecutorShape = model.ExecutorShape + + m.MinExecutorCount = model.MinExecutorCount + + m.MaxExecutorCount = model.MaxExecutorCount + + m.MetastoreId = model.MetastoreId + + m.LakeId = model.LakeId + + m.WarehouseBucketUri = model.WarehouseBucketUri + + m.Description = model.Description + + return +} diff --git a/dataflow/sql_endpoint_collection.go b/dataflow/sql_endpoint_collection.go new file mode 100644 index 0000000000..b91d2f7ce1 --- /dev/null +++ b/dataflow/sql_endpoint_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlEndpointCollection The results of a Sql Endpoint search. It contains the objects in a SqlEndpointSummary. +type SqlEndpointCollection struct { + + // The collection of SqlEndpointSummary objects. + Items []SqlEndpointSummary `mandatory:"true" json:"items"` +} + +func (m SqlEndpointCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlEndpointCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/dataflow/sql_endpoint_lifecycle_state.go b/dataflow/sql_endpoint_lifecycle_state.go new file mode 100644 index 0000000000..5fcc5470e1 --- /dev/null +++ b/dataflow/sql_endpoint_lifecycle_state.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "strings" +) + +// SqlEndpointLifecycleStateEnum Enum with underlying type: string +type SqlEndpointLifecycleStateEnum string + +// Set of constants representing the allowable values for SqlEndpointLifecycleStateEnum +const ( + SqlEndpointLifecycleStateCreating SqlEndpointLifecycleStateEnum = "CREATING" + SqlEndpointLifecycleStateActive SqlEndpointLifecycleStateEnum = "ACTIVE" + SqlEndpointLifecycleStateDeleting SqlEndpointLifecycleStateEnum = "DELETING" + SqlEndpointLifecycleStateDeleted SqlEndpointLifecycleStateEnum = "DELETED" + SqlEndpointLifecycleStateFailed SqlEndpointLifecycleStateEnum = "FAILED" +) + +var mappingSqlEndpointLifecycleStateEnum = map[string]SqlEndpointLifecycleStateEnum{ + "CREATING": SqlEndpointLifecycleStateCreating, + "ACTIVE": SqlEndpointLifecycleStateActive, + "DELETING": SqlEndpointLifecycleStateDeleting, + "DELETED": SqlEndpointLifecycleStateDeleted, + "FAILED": SqlEndpointLifecycleStateFailed, +} + +var mappingSqlEndpointLifecycleStateEnumLowerCase = map[string]SqlEndpointLifecycleStateEnum{ + "creating": SqlEndpointLifecycleStateCreating, + "active": SqlEndpointLifecycleStateActive, + "deleting": SqlEndpointLifecycleStateDeleting, + "deleted": SqlEndpointLifecycleStateDeleted, + "failed": SqlEndpointLifecycleStateFailed, +} + +// GetSqlEndpointLifecycleStateEnumValues Enumerates the set of values for SqlEndpointLifecycleStateEnum +func GetSqlEndpointLifecycleStateEnumValues() []SqlEndpointLifecycleStateEnum { + values := make([]SqlEndpointLifecycleStateEnum, 0) + for _, v := range mappingSqlEndpointLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSqlEndpointLifecycleStateEnumStringValues Enumerates the set of values in String for SqlEndpointLifecycleStateEnum +func GetSqlEndpointLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingSqlEndpointLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSqlEndpointLifecycleStateEnum(val string) (SqlEndpointLifecycleStateEnum, bool) { + enum, ok := mappingSqlEndpointLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/dataflow/sql_endpoint_network_configuration.go b/dataflow/sql_endpoint_network_configuration.go new file mode 100644 index 0000000000..d310f6ee65 --- /dev/null +++ b/dataflow/sql_endpoint_network_configuration.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlEndpointNetworkConfiguration The network configuration of a SQL Endpoint. +type SqlEndpointNetworkConfiguration interface { +} + +type sqlendpointnetworkconfiguration struct { + JsonData []byte + NetworkType string `json:"networkType"` +} + +// UnmarshalJSON unmarshals json +func (m *sqlendpointnetworkconfiguration) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersqlendpointnetworkconfiguration sqlendpointnetworkconfiguration + s := struct { + Model Unmarshalersqlendpointnetworkconfiguration + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.NetworkType = s.Model.NetworkType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *sqlendpointnetworkconfiguration) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.NetworkType { + case "VCN": + mm := SqlEndpointVcnConfig{} + err = json.Unmarshal(data, &mm) + return mm, err + case "SECURE_ACCESS": + mm := SqlEndpointSecureAccessConfig{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for SqlEndpointNetworkConfiguration: %s.", m.NetworkType) + return *m, nil + } +} + +func (m sqlendpointnetworkconfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m sqlendpointnetworkconfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/dataflow/sql_endpoint_secure_access_config.go b/dataflow/sql_endpoint_secure_access_config.go new file mode 100644 index 0000000000..1d4d4404d8 --- /dev/null +++ b/dataflow/sql_endpoint_secure_access_config.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlEndpointSecureAccessConfig Access control rules for secure access selection. +type SqlEndpointSecureAccessConfig struct { + + // A list of SecureAccessControlRule's to which access is limited to + AccessControlRules []SecureAccessControlRule `mandatory:"false" json:"accessControlRules"` + + // Ip Address of public endpoint + PublicEndpointIp *string `mandatory:"false" json:"publicEndpointIp"` +} + +func (m SqlEndpointSecureAccessConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlEndpointSecureAccessConfig) 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 SqlEndpointSecureAccessConfig) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSqlEndpointSecureAccessConfig SqlEndpointSecureAccessConfig + s := struct { + DiscriminatorParam string `json:"networkType"` + MarshalTypeSqlEndpointSecureAccessConfig + }{ + "SECURE_ACCESS", + (MarshalTypeSqlEndpointSecureAccessConfig)(m), + } + + return json.Marshal(&s) +} diff --git a/dataflow/sql_endpoint_summary.go b/dataflow/sql_endpoint_summary.go new file mode 100644 index 0000000000..fc24648134 --- /dev/null +++ b/dataflow/sql_endpoint_summary.go @@ -0,0 +1,223 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlEndpointSummary A summary of the Sql Endpoint. +type SqlEndpointSummary struct { + + // The provision identifier that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The SQL Endpoint name, which can be changed. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of a compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The version of SQL Endpoint. + SqlEndpointVersion *string `mandatory:"true" json:"sqlEndpointVersion"` + + // The shape of the SQL Endpoint driver instance. + DriverShape *string `mandatory:"true" json:"driverShape"` + + // The shape of the SQL Endpoint executor instance. + ExecutorShape *string `mandatory:"true" json:"executorShape"` + + // The minimum number of executors. + MinExecutorCount *int `mandatory:"true" json:"minExecutorCount"` + + // The maximum number of executors. + MaxExecutorCount *int `mandatory:"true" json:"maxExecutorCount"` + + // The OCID of OCI Hive Metastore. + MetastoreId *string `mandatory:"true" json:"metastoreId"` + + // The OCID of OCI Lake. + LakeId *string `mandatory:"true" json:"lakeId"` + + // The warehouse bucket URI. It is a Oracle Cloud Infrastructure Object Storage bucket URI as defined here https://docs.oracle.com/en/cloud/paas/atp-cloud/atpud/object-storage-uris.html + WarehouseBucketUri *string `mandatory:"true" json:"warehouseBucketUri"` + + // The description of the SQL Endpoint. + Description *string `mandatory:"true" json:"description"` + + // The JDBC URL field. For example, jdbc:spark://{serviceFQDN}:443/default;SparkServerType=DFI + JdbcEndpointUrl *string `mandatory:"false" json:"jdbcEndpointUrl"` + + // The time the Sql Endpoint was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the Sql Endpoint was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The current state of the Sql Endpoint. + LifecycleState SqlEndpointLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // A message describing the reason why the resource is in it's current state. Helps bubble up errors in state changes. For example, it can be used to provide actionable information for a resource in the Failed state. + StateMessage *string `mandatory:"false" json:"stateMessage"` + + DriverShapeConfig *ShapeConfig `mandatory:"false" json:"driverShapeConfig"` + + ExecutorShapeConfig *ShapeConfig `mandatory:"false" json:"executorShapeConfig"` + + // The OCID of the user who created the resource. + OwnerPrincipalId *string `mandatory:"false" json:"ownerPrincipalId"` + + // This token is used by Splat, and indicates that the service accepts the request, and that the request is currently being processed. + LastAcceptedRequestToken *string `mandatory:"false" json:"lastAcceptedRequestToken"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The Spark configuration passed to the running process. + // See https://spark.apache.org/docs/latest/configuration.html#available-properties. + // Example: { "spark.app.name" : "My App Name", "spark.shuffle.io.maxRetries" : "4" } + // Note: Not all Spark properties are permitted to be set. Attempting to set a property that is + // not allowed to be overwritten will cause a 400 status to be returned. + SparkAdvancedConfigurations map[string]string `mandatory:"false" json:"sparkAdvancedConfigurations"` + + NetworkConfiguration SqlEndpointNetworkConfiguration `mandatory:"false" json:"networkConfiguration"` +} + +func (m SqlEndpointSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlEndpointSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSqlEndpointLifecycleStateEnum(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(GetSqlEndpointLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *SqlEndpointSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + JdbcEndpointUrl *string `json:"jdbcEndpointUrl"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleState SqlEndpointLifecycleStateEnum `json:"lifecycleState"` + StateMessage *string `json:"stateMessage"` + DriverShapeConfig *ShapeConfig `json:"driverShapeConfig"` + ExecutorShapeConfig *ShapeConfig `json:"executorShapeConfig"` + OwnerPrincipalId *string `json:"ownerPrincipalId"` + LastAcceptedRequestToken *string `json:"lastAcceptedRequestToken"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + SparkAdvancedConfigurations map[string]string `json:"sparkAdvancedConfigurations"` + NetworkConfiguration sqlendpointnetworkconfiguration `json:"networkConfiguration"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + CompartmentId *string `json:"compartmentId"` + SqlEndpointVersion *string `json:"sqlEndpointVersion"` + DriverShape *string `json:"driverShape"` + ExecutorShape *string `json:"executorShape"` + MinExecutorCount *int `json:"minExecutorCount"` + MaxExecutorCount *int `json:"maxExecutorCount"` + MetastoreId *string `json:"metastoreId"` + LakeId *string `json:"lakeId"` + WarehouseBucketUri *string `json:"warehouseBucketUri"` + Description *string `json:"description"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.JdbcEndpointUrl = model.JdbcEndpointUrl + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.LifecycleState = model.LifecycleState + + m.StateMessage = model.StateMessage + + m.DriverShapeConfig = model.DriverShapeConfig + + m.ExecutorShapeConfig = model.ExecutorShapeConfig + + m.OwnerPrincipalId = model.OwnerPrincipalId + + m.LastAcceptedRequestToken = model.LastAcceptedRequestToken + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.SparkAdvancedConfigurations = model.SparkAdvancedConfigurations + + nn, e = model.NetworkConfiguration.UnmarshalPolymorphicJSON(model.NetworkConfiguration.JsonData) + if e != nil { + return + } + if nn != nil { + m.NetworkConfiguration = nn.(SqlEndpointNetworkConfiguration) + } else { + m.NetworkConfiguration = nil + } + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.CompartmentId = model.CompartmentId + + m.SqlEndpointVersion = model.SqlEndpointVersion + + m.DriverShape = model.DriverShape + + m.ExecutorShape = model.ExecutorShape + + m.MinExecutorCount = model.MinExecutorCount + + m.MaxExecutorCount = model.MaxExecutorCount + + m.MetastoreId = model.MetastoreId + + m.LakeId = model.LakeId + + m.WarehouseBucketUri = model.WarehouseBucketUri + + m.Description = model.Description + + return +} diff --git a/dataflow/sql_endpoint_vcn_config.go b/dataflow/sql_endpoint_vcn_config.go new file mode 100644 index 0000000000..2874d1e7a6 --- /dev/null +++ b/dataflow/sql_endpoint_vcn_config.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SqlEndpointVcnConfig The VCN configuration for VCN network type selection. +type SqlEndpointVcnConfig struct { + + // The VCN OCID. + VcnId *string `mandatory:"true" json:"vcnId"` + + // The VCN Subnet OCID. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The host name prefix. + HostNamePrefix *string `mandatory:"false" json:"hostNamePrefix"` + + // The OCIDs of Network Security Groups (NSGs). + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // Ip Address of private endpoint + PrivateEndpointIp *string `mandatory:"false" json:"privateEndpointIp"` +} + +func (m SqlEndpointVcnConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SqlEndpointVcnConfig) 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 SqlEndpointVcnConfig) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSqlEndpointVcnConfig SqlEndpointVcnConfig + s := struct { + DiscriminatorParam string `json:"networkType"` + MarshalTypeSqlEndpointVcnConfig + }{ + "VCN", + (MarshalTypeSqlEndpointVcnConfig)(m), + } + + return json.Marshal(&s) +} diff --git a/dataflow/update_sql_endpoint_details.go b/dataflow/update_sql_endpoint_details.go new file mode 100644 index 0000000000..a6b912fa25 --- /dev/null +++ b/dataflow/update_sql_endpoint_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Flow API +// +// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure. +// + +package dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateSqlEndpointDetails Currently only the tags of a SQL Endpoint can be updated. +type UpdateSqlEndpointDetails 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/iaas/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/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateSqlEndpointDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateSqlEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/dataflow/update_sql_endpoint_request_response.go b/dataflow/update_sql_endpoint_request_response.go new file mode 100644 index 0000000000..2bdc23e551 --- /dev/null +++ b/dataflow/update_sql_endpoint_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateSqlEndpointRequest wrapper for the UpdateSqlEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/UpdateSqlEndpoint.go.html to see an example of how to use UpdateSqlEndpointRequest. +type UpdateSqlEndpointRequest struct { + + // Details of the Sql Endpoint to be updated. + UpdateSqlEndpointDetails `contributesTo:"body"` + + // The unique id of the SQL Endpoint. + SqlEndpointId *string `mandatory:"true" contributesTo:"path" name:"sqlEndpointId"` + + // 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 UpdateSqlEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSqlEndpointRequest) 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 UpdateSqlEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSqlEndpointRequest) 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 UpdateSqlEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateSqlEndpointResponse wrapper for the UpdateSqlEndpoint operation +type UpdateSqlEndpointResponse 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 a work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateSqlEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSqlEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/go.mod b/go.mod index e76f22dba9..3e7ed44719 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,6 @@ go 1.13 require ( github.com/gofrs/flock v0.8.1 github.com/sony/gobreaker v0.5.0 - github.com/stretchr/testify v1.6.1 - golang.org/x/sys v0.6.0 // indirect + github.com/stretchr/testify v1.8.4 + golang.org/x/sys v0.8.0 // indirect ) diff --git a/go.sum b/go.sum index 41fe24e57d..6c3da40078 100644 --- a/go.sum +++ b/go.sum @@ -1,19 +1,25 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/licensemanager/list_top_utilized_resources_request_response.go b/licensemanager/list_top_utilized_resources_request_response.go index 4a3f512305..5f54e74422 100644 --- a/licensemanager/list_top_utilized_resources_request_response.go +++ b/licensemanager/list_top_utilized_resources_request_response.go @@ -130,14 +130,17 @@ type ListTopUtilizedResourcesResourceUnitTypeEnum string // Set of constants representing the allowable values for ListTopUtilizedResourcesResourceUnitTypeEnum const ( ListTopUtilizedResourcesResourceUnitTypeOcpu ListTopUtilizedResourcesResourceUnitTypeEnum = "OCPU" + ListTopUtilizedResourcesResourceUnitTypeEcpu ListTopUtilizedResourcesResourceUnitTypeEnum = "ECPU" ) var mappingListTopUtilizedResourcesResourceUnitTypeEnum = map[string]ListTopUtilizedResourcesResourceUnitTypeEnum{ "OCPU": ListTopUtilizedResourcesResourceUnitTypeOcpu, + "ECPU": ListTopUtilizedResourcesResourceUnitTypeEcpu, } var mappingListTopUtilizedResourcesResourceUnitTypeEnumLowerCase = map[string]ListTopUtilizedResourcesResourceUnitTypeEnum{ "ocpu": ListTopUtilizedResourcesResourceUnitTypeOcpu, + "ecpu": ListTopUtilizedResourcesResourceUnitTypeEcpu, } // GetListTopUtilizedResourcesResourceUnitTypeEnumValues Enumerates the set of values for ListTopUtilizedResourcesResourceUnitTypeEnum @@ -153,6 +156,7 @@ func GetListTopUtilizedResourcesResourceUnitTypeEnumValues() []ListTopUtilizedRe func GetListTopUtilizedResourcesResourceUnitTypeEnumStringValues() []string { return []string{ "OCPU", + "ECPU", } } diff --git a/licensemanager/resource_unit.go b/licensemanager/resource_unit.go index c2410e9937..8278d100c8 100644 --- a/licensemanager/resource_unit.go +++ b/licensemanager/resource_unit.go @@ -19,14 +19,17 @@ type ResourceUnitEnum string // Set of constants representing the allowable values for ResourceUnitEnum const ( ResourceUnitOcpu ResourceUnitEnum = "OCPU" + ResourceUnitEcpu ResourceUnitEnum = "ECPU" ) var mappingResourceUnitEnum = map[string]ResourceUnitEnum{ "OCPU": ResourceUnitOcpu, + "ECPU": ResourceUnitEcpu, } var mappingResourceUnitEnumLowerCase = map[string]ResourceUnitEnum{ "ocpu": ResourceUnitOcpu, + "ecpu": ResourceUnitEcpu, } // GetResourceUnitEnumValues Enumerates the set of values for ResourceUnitEnum @@ -42,6 +45,7 @@ func GetResourceUnitEnumValues() []ResourceUnitEnum { func GetResourceUnitEnumStringValues() []string { return []string{ "OCPU", + "ECPU", } } diff --git a/marketplace/image_listing_package.go b/marketplace/image_listing_package.go index f2ad4572f3..eb806c85ed 100644 --- a/marketplace/image_listing_package.go +++ b/marketplace/image_listing_package.go @@ -40,6 +40,9 @@ type ImageListingPackage struct { OperatingSystem *OperatingSystem `mandatory:"false" json:"operatingSystem"` + // The regions where you can deploy the listing package. (Some packages have restrictions that limit their deployment to United States regions only.) + Regions []Region `mandatory:"false" json:"regions"` + // The ID of the listing resource associated with this listing package. For more information, see AppCatalogListing (https://docs.cloud.oracle.com/en-us/iaas/api/#/en/iaas/latest/AppCatalogListing/) in the Core Services API. AppCatalogListingId *string `mandatory:"false" json:"appCatalogListingId"` @@ -48,9 +51,6 @@ type ImageListingPackage struct { // The ID of the image corresponding to the package. ImageId *string `mandatory:"false" json:"imageId"` - - // The regions where you can deploy the listing package. (Some packages have restrictions that limit their deployment to United States regions only.) - Regions []Region `mandatory:"false" json:"regions"` } //GetDescription returns Description @@ -88,6 +88,11 @@ func (m ImageListingPackage) GetOperatingSystem() *OperatingSystem { return m.OperatingSystem } +//GetRegions returns Regions +func (m ImageListingPackage) GetRegions() []Region { + return m.Regions +} + func (m ImageListingPackage) String() string { return common.PointerString(m) } diff --git a/marketplace/ineligibility_reason_enum.go b/marketplace/ineligibility_reason_enum.go index 2a36e8f645..11ba23420c 100644 --- a/marketplace/ineligibility_reason_enum.go +++ b/marketplace/ineligibility_reason_enum.go @@ -18,42 +18,63 @@ type IneligibilityReasonEnumEnum string // Set of constants representing the allowable values for IneligibilityReasonEnumEnum const ( - IneligibilityReasonEnumIneligibleAccountCountry IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_COUNTRY" - IneligibilityReasonEnumIneligibleRegion IneligibilityReasonEnumEnum = "INELIGIBLE_REGION" - IneligibilityReasonEnumIneligibleAccountBlacklisted IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_BLACKLISTED" - IneligibilityReasonEnumIneligibleAccountFeatureDisabled IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_FEATURE_DISABLED" - IneligibilityReasonEnumIneligibleAccountCurrency IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_CURRENCY" - IneligibilityReasonEnumIneligibleAccountNotPaid IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_NOT_PAID" - IneligibilityReasonEnumIneligibleAccountInternal IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_INTERNAL" - IneligibilityReasonEnumIneligibleAccountGovSubscription IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_GOV_SUBSCRIPTION" - IneligibilityReasonEnumIneligiblePaidListingThrottled IneligibilityReasonEnumEnum = "INELIGIBLE_PAID_LISTING_THROTTLED" - IneligibilityReasonEnumNotAuthorized IneligibilityReasonEnumEnum = "NOT_AUTHORIZED" + IneligibilityReasonEnumIneligibleAccountCountry IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_COUNTRY" + IneligibilityReasonEnumIneligibleRegion IneligibilityReasonEnumEnum = "INELIGIBLE_REGION" + IneligibilityReasonEnumIneligibleAccountBlacklisted IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_BLACKLISTED" + IneligibilityReasonEnumIneligibleAccountFeatureDisabled IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_FEATURE_DISABLED" + IneligibilityReasonEnumIneligibleAccountCurrency IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_CURRENCY" + IneligibilityReasonEnumIneligibleAccountNotPaid IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_NOT_PAID" + IneligibilityReasonEnumIneligibleAccountInternal IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_INTERNAL" + IneligibilityReasonEnumIneligibleAccountGovSubscription IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_GOV_SUBSCRIPTION" + IneligibilityReasonEnumIneligiblePaidListingThrottled IneligibilityReasonEnumEnum = "INELIGIBLE_PAID_LISTING_THROTTLED" + IneligibilityReasonEnumIneligibleAccountNotAvailable IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_NOT_AVAILABLE" + IneligibilityReasonEnumIneligibleAccountNotMonthlyInclusive IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_NOT_MONTHLY_INCLUSIVE" + IneligibilityReasonEnumImageMetaDataSo IneligibilityReasonEnumEnum = "IMAGE_META_DATA_SO" + IneligibilityReasonEnumIneligibleAccountTenancyNotAllowedAccessImage IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_TENANCY_NOT_ALLOWED_ACCESS_IMAGE" + IneligibilityReasonEnumIneligibleAccountGovLaunchNonGovListing IneligibilityReasonEnumEnum = "INELIGIBLE_ACCOUNT_GOV_LAUNCH_NON_GOV_LISTING" + IneligibilityReasonEnumAgreementNotAccepted IneligibilityReasonEnumEnum = "AGREEMENT_NOT_ACCEPTED" + IneligibilityReasonEnumNotAuthorized IneligibilityReasonEnumEnum = "NOT_AUTHORIZED" + IneligibilityReasonEnumEligible IneligibilityReasonEnumEnum = "ELIGIBLE" ) var mappingIneligibilityReasonEnumEnum = map[string]IneligibilityReasonEnumEnum{ - "INELIGIBLE_ACCOUNT_COUNTRY": IneligibilityReasonEnumIneligibleAccountCountry, - "INELIGIBLE_REGION": IneligibilityReasonEnumIneligibleRegion, - "INELIGIBLE_ACCOUNT_BLACKLISTED": IneligibilityReasonEnumIneligibleAccountBlacklisted, - "INELIGIBLE_ACCOUNT_FEATURE_DISABLED": IneligibilityReasonEnumIneligibleAccountFeatureDisabled, - "INELIGIBLE_ACCOUNT_CURRENCY": IneligibilityReasonEnumIneligibleAccountCurrency, - "INELIGIBLE_ACCOUNT_NOT_PAID": IneligibilityReasonEnumIneligibleAccountNotPaid, - "INELIGIBLE_ACCOUNT_INTERNAL": IneligibilityReasonEnumIneligibleAccountInternal, - "INELIGIBLE_ACCOUNT_GOV_SUBSCRIPTION": IneligibilityReasonEnumIneligibleAccountGovSubscription, - "INELIGIBLE_PAID_LISTING_THROTTLED": IneligibilityReasonEnumIneligiblePaidListingThrottled, - "NOT_AUTHORIZED": IneligibilityReasonEnumNotAuthorized, + "INELIGIBLE_ACCOUNT_COUNTRY": IneligibilityReasonEnumIneligibleAccountCountry, + "INELIGIBLE_REGION": IneligibilityReasonEnumIneligibleRegion, + "INELIGIBLE_ACCOUNT_BLACKLISTED": IneligibilityReasonEnumIneligibleAccountBlacklisted, + "INELIGIBLE_ACCOUNT_FEATURE_DISABLED": IneligibilityReasonEnumIneligibleAccountFeatureDisabled, + "INELIGIBLE_ACCOUNT_CURRENCY": IneligibilityReasonEnumIneligibleAccountCurrency, + "INELIGIBLE_ACCOUNT_NOT_PAID": IneligibilityReasonEnumIneligibleAccountNotPaid, + "INELIGIBLE_ACCOUNT_INTERNAL": IneligibilityReasonEnumIneligibleAccountInternal, + "INELIGIBLE_ACCOUNT_GOV_SUBSCRIPTION": IneligibilityReasonEnumIneligibleAccountGovSubscription, + "INELIGIBLE_PAID_LISTING_THROTTLED": IneligibilityReasonEnumIneligiblePaidListingThrottled, + "INELIGIBLE_ACCOUNT_NOT_AVAILABLE": IneligibilityReasonEnumIneligibleAccountNotAvailable, + "INELIGIBLE_ACCOUNT_NOT_MONTHLY_INCLUSIVE": IneligibilityReasonEnumIneligibleAccountNotMonthlyInclusive, + "IMAGE_META_DATA_SO": IneligibilityReasonEnumImageMetaDataSo, + "INELIGIBLE_ACCOUNT_TENANCY_NOT_ALLOWED_ACCESS_IMAGE": IneligibilityReasonEnumIneligibleAccountTenancyNotAllowedAccessImage, + "INELIGIBLE_ACCOUNT_GOV_LAUNCH_NON_GOV_LISTING": IneligibilityReasonEnumIneligibleAccountGovLaunchNonGovListing, + "AGREEMENT_NOT_ACCEPTED": IneligibilityReasonEnumAgreementNotAccepted, + "NOT_AUTHORIZED": IneligibilityReasonEnumNotAuthorized, + "ELIGIBLE": IneligibilityReasonEnumEligible, } var mappingIneligibilityReasonEnumEnumLowerCase = map[string]IneligibilityReasonEnumEnum{ - "ineligible_account_country": IneligibilityReasonEnumIneligibleAccountCountry, - "ineligible_region": IneligibilityReasonEnumIneligibleRegion, - "ineligible_account_blacklisted": IneligibilityReasonEnumIneligibleAccountBlacklisted, - "ineligible_account_feature_disabled": IneligibilityReasonEnumIneligibleAccountFeatureDisabled, - "ineligible_account_currency": IneligibilityReasonEnumIneligibleAccountCurrency, - "ineligible_account_not_paid": IneligibilityReasonEnumIneligibleAccountNotPaid, - "ineligible_account_internal": IneligibilityReasonEnumIneligibleAccountInternal, - "ineligible_account_gov_subscription": IneligibilityReasonEnumIneligibleAccountGovSubscription, - "ineligible_paid_listing_throttled": IneligibilityReasonEnumIneligiblePaidListingThrottled, - "not_authorized": IneligibilityReasonEnumNotAuthorized, + "ineligible_account_country": IneligibilityReasonEnumIneligibleAccountCountry, + "ineligible_region": IneligibilityReasonEnumIneligibleRegion, + "ineligible_account_blacklisted": IneligibilityReasonEnumIneligibleAccountBlacklisted, + "ineligible_account_feature_disabled": IneligibilityReasonEnumIneligibleAccountFeatureDisabled, + "ineligible_account_currency": IneligibilityReasonEnumIneligibleAccountCurrency, + "ineligible_account_not_paid": IneligibilityReasonEnumIneligibleAccountNotPaid, + "ineligible_account_internal": IneligibilityReasonEnumIneligibleAccountInternal, + "ineligible_account_gov_subscription": IneligibilityReasonEnumIneligibleAccountGovSubscription, + "ineligible_paid_listing_throttled": IneligibilityReasonEnumIneligiblePaidListingThrottled, + "ineligible_account_not_available": IneligibilityReasonEnumIneligibleAccountNotAvailable, + "ineligible_account_not_monthly_inclusive": IneligibilityReasonEnumIneligibleAccountNotMonthlyInclusive, + "image_meta_data_so": IneligibilityReasonEnumImageMetaDataSo, + "ineligible_account_tenancy_not_allowed_access_image": IneligibilityReasonEnumIneligibleAccountTenancyNotAllowedAccessImage, + "ineligible_account_gov_launch_non_gov_listing": IneligibilityReasonEnumIneligibleAccountGovLaunchNonGovListing, + "agreement_not_accepted": IneligibilityReasonEnumAgreementNotAccepted, + "not_authorized": IneligibilityReasonEnumNotAuthorized, + "eligible": IneligibilityReasonEnumEligible, } // GetIneligibilityReasonEnumEnumValues Enumerates the set of values for IneligibilityReasonEnumEnum @@ -77,7 +98,14 @@ func GetIneligibilityReasonEnumEnumStringValues() []string { "INELIGIBLE_ACCOUNT_INTERNAL", "INELIGIBLE_ACCOUNT_GOV_SUBSCRIPTION", "INELIGIBLE_PAID_LISTING_THROTTLED", + "INELIGIBLE_ACCOUNT_NOT_AVAILABLE", + "INELIGIBLE_ACCOUNT_NOT_MONTHLY_INCLUSIVE", + "IMAGE_META_DATA_SO", + "INELIGIBLE_ACCOUNT_TENANCY_NOT_ALLOWED_ACCESS_IMAGE", + "INELIGIBLE_ACCOUNT_GOV_LAUNCH_NON_GOV_LISTING", + "AGREEMENT_NOT_ACCEPTED", "NOT_AUTHORIZED", + "ELIGIBLE", } } diff --git a/marketplace/listing_package.go b/marketplace/listing_package.go index bc570f0875..f8cfd28af1 100644 --- a/marketplace/listing_package.go +++ b/marketplace/listing_package.go @@ -39,6 +39,9 @@ type ListingPackage interface { GetTimeCreated() *common.SDKTime GetOperatingSystem() *OperatingSystem + + // The regions where you can deploy the listing package. (Some packages have restrictions that limit their deployment to United States regions only.) + GetRegions() []Region } type listingpackage struct { @@ -50,6 +53,7 @@ type listingpackage struct { ResourceId *string `mandatory:"false" json:"resourceId"` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` OperatingSystem *OperatingSystem `mandatory:"false" json:"operatingSystem"` + Regions []Region `mandatory:"false" json:"regions"` PackageType string `json:"packageType"` } @@ -71,6 +75,7 @@ func (m *listingpackage) UnmarshalJSON(data []byte) error { m.ResourceId = s.Model.ResourceId m.TimeCreated = s.Model.TimeCreated m.OperatingSystem = s.Model.OperatingSystem + m.Regions = s.Model.Regions m.PackageType = s.Model.PackageType return err @@ -134,6 +139,11 @@ func (m listingpackage) GetOperatingSystem() *OperatingSystem { return m.OperatingSystem } +//GetRegions returns Regions +func (m listingpackage) GetRegions() []Region { + return m.Regions +} + func (m listingpackage) String() string { return common.PointerString(m) } diff --git a/marketplace/orchestration_listing_package.go b/marketplace/orchestration_listing_package.go index 048deae6fb..597078cce4 100644 --- a/marketplace/orchestration_listing_package.go +++ b/marketplace/orchestration_listing_package.go @@ -40,14 +40,14 @@ type OrchestrationListingPackage struct { OperatingSystem *OperatingSystem `mandatory:"false" json:"operatingSystem"` + // The regions where you can deploy the listing package. (Some packages have restrictions that limit their deployment to United States regions only.) + Regions []Region `mandatory:"false" json:"regions"` + // Link to the orchestration resource. ResourceLink *string `mandatory:"false" json:"resourceLink"` // List of variables for the orchestration resource. Variables []OrchestrationVariable `mandatory:"false" json:"variables"` - - // The regions where you can deploy this listing package. (Some packages have restrictions that limit their deployment to United States regions only.) - Regions []Region `mandatory:"false" json:"regions"` } //GetDescription returns Description @@ -85,6 +85,11 @@ func (m OrchestrationListingPackage) GetOperatingSystem() *OperatingSystem { return m.OperatingSystem } +//GetRegions returns Regions +func (m OrchestrationListingPackage) GetRegions() []Region { + return m.Regions +} + func (m OrchestrationListingPackage) String() string { return common.PointerString(m) } diff --git a/marketplace/pricing_currency_enum.go b/marketplace/pricing_currency_enum.go index f5ee7c266c..53531c838a 100644 --- a/marketplace/pricing_currency_enum.go +++ b/marketplace/pricing_currency_enum.go @@ -25,6 +25,10 @@ const ( PricingCurrencyEnumBrl PricingCurrencyEnumEnum = "BRL" PricingCurrencyEnumJpy PricingCurrencyEnumEnum = "JPY" PricingCurrencyEnumOmr PricingCurrencyEnumEnum = "OMR" + PricingCurrencyEnumEur PricingCurrencyEnumEnum = "EUR" + PricingCurrencyEnumChf PricingCurrencyEnumEnum = "CHF" + PricingCurrencyEnumMxn PricingCurrencyEnumEnum = "MXN" + PricingCurrencyEnumClp PricingCurrencyEnumEnum = "CLP" ) var mappingPricingCurrencyEnumEnum = map[string]PricingCurrencyEnumEnum{ @@ -35,6 +39,10 @@ var mappingPricingCurrencyEnumEnum = map[string]PricingCurrencyEnumEnum{ "BRL": PricingCurrencyEnumBrl, "JPY": PricingCurrencyEnumJpy, "OMR": PricingCurrencyEnumOmr, + "EUR": PricingCurrencyEnumEur, + "CHF": PricingCurrencyEnumChf, + "MXN": PricingCurrencyEnumMxn, + "CLP": PricingCurrencyEnumClp, } var mappingPricingCurrencyEnumEnumLowerCase = map[string]PricingCurrencyEnumEnum{ @@ -45,6 +53,10 @@ var mappingPricingCurrencyEnumEnumLowerCase = map[string]PricingCurrencyEnumEnum "brl": PricingCurrencyEnumBrl, "jpy": PricingCurrencyEnumJpy, "omr": PricingCurrencyEnumOmr, + "eur": PricingCurrencyEnumEur, + "chf": PricingCurrencyEnumChf, + "mxn": PricingCurrencyEnumMxn, + "clp": PricingCurrencyEnumClp, } // GetPricingCurrencyEnumEnumValues Enumerates the set of values for PricingCurrencyEnumEnum @@ -66,6 +78,10 @@ func GetPricingCurrencyEnumEnumStringValues() []string { "BRL", "JPY", "OMR", + "EUR", + "CHF", + "MXN", + "CLP", } } diff --git a/mysql/channel_target_db_system.go b/mysql/channel_target_db_system.go index 5dfeafa8b0..41ccc893a0 100644 --- a/mysql/channel_target_db_system.go +++ b/mysql/channel_target_db_system.go @@ -30,8 +30,16 @@ type ChannelTargetDbSystem struct { // The username for the replication applier of the target MySQL DB System. ApplierUsername *string `mandatory:"true" json:"applierUsername"` + // Specifies the amount of time, in seconds, that the channel waits before + // applying a transaction received from the source. + DelayInSeconds *int `mandatory:"true" json:"delayInSeconds"` + // Replication filter rules to be applied at the DB System Channel target. Filters []ChannelFilter `mandatory:"false" json:"filters"` + + // Specifies how a replication channel handles the creation and alteration of tables + // that do not have a primary key. + TablesWithoutPrimaryKeyHandling ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum `mandatory:"true" json:"tablesWithoutPrimaryKeyHandling"` } func (m ChannelTargetDbSystem) String() string { @@ -43,6 +51,9 @@ func (m ChannelTargetDbSystem) String() string { // Not recommended for calling this function directly func (m ChannelTargetDbSystem) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum(string(m.TablesWithoutPrimaryKeyHandling)); !ok && m.TablesWithoutPrimaryKeyHandling != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TablesWithoutPrimaryKeyHandling: %s. Supported values are: %s.", m.TablesWithoutPrimaryKeyHandling, strings.Join(GetChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -63,3 +74,49 @@ func (m ChannelTargetDbSystem) MarshalJSON() (buff []byte, e error) { return json.Marshal(&s) } + +// ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum Enum with underlying type: string +type ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum string + +// Set of constants representing the allowable values for ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum +const ( + ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingRaiseError ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum = "RAISE_ERROR" + ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingAllow ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum = "ALLOW" + ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingGenerateImplicitPrimaryKey ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum = "GENERATE_IMPLICIT_PRIMARY_KEY" +) + +var mappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum = map[string]ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum{ + "RAISE_ERROR": ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingRaiseError, + "ALLOW": ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingAllow, + "GENERATE_IMPLICIT_PRIMARY_KEY": ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingGenerateImplicitPrimaryKey, +} + +var mappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumLowerCase = map[string]ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum{ + "raise_error": ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingRaiseError, + "allow": ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingAllow, + "generate_implicit_primary_key": ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingGenerateImplicitPrimaryKey, +} + +// GetChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumValues Enumerates the set of values for ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum +func GetChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumValues() []ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum { + values := make([]ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum, 0) + for _, v := range mappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum { + values = append(values, v) + } + return values +} + +// GetChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumStringValues Enumerates the set of values in String for ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum +func GetChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumStringValues() []string { + return []string{ + "RAISE_ERROR", + "ALLOW", + "GENERATE_IMPLICIT_PRIMARY_KEY", + } +} + +// GetMappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum(val string) (ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum, bool) { + enum, ok := mappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/create_channel_target_from_db_system_details.go b/mysql/create_channel_target_from_db_system_details.go index 1c84f5f98f..0d6557f3c7 100644 --- a/mysql/create_channel_target_from_db_system_details.go +++ b/mysql/create_channel_target_from_db_system_details.go @@ -32,6 +32,14 @@ type CreateChannelTargetFromDbSystemDetails struct { // Replication filter rules to be applied at the DB System Channel target. Filters []ChannelFilter `mandatory:"false" json:"filters"` + + // Specifies the amount of time, in seconds, that the channel waits before + // applying a transaction received from the source. + DelayInSeconds *int `mandatory:"false" json:"delayInSeconds"` + + // Specifies how a replication channel handles the creation and alteration of tables + // that do not have a primary key. The default value is set to ALLOW. + TablesWithoutPrimaryKeyHandling ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum `mandatory:"false" json:"tablesWithoutPrimaryKeyHandling,omitempty"` } func (m CreateChannelTargetFromDbSystemDetails) String() string { @@ -44,6 +52,9 @@ func (m CreateChannelTargetFromDbSystemDetails) String() string { func (m CreateChannelTargetFromDbSystemDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum(string(m.TablesWithoutPrimaryKeyHandling)); !ok && m.TablesWithoutPrimaryKeyHandling != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TablesWithoutPrimaryKeyHandling: %s. Supported values are: %s.", m.TablesWithoutPrimaryKeyHandling, strings.Join(GetChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/mysql/update_channel_target_from_db_system_details.go b/mysql/update_channel_target_from_db_system_details.go index 25fb004a2c..a202245884 100644 --- a/mysql/update_channel_target_from_db_system_details.go +++ b/mysql/update_channel_target_from_db_system_details.go @@ -29,6 +29,14 @@ type UpdateChannelTargetFromDbSystemDetails struct { // Replication filter rules to be applied at the DB System Channel target. Filters []ChannelFilter `mandatory:"false" json:"filters"` + + // Specifies the amount of time, in seconds, that the channel waits before + // applying a transaction received from the source. + DelayInSeconds *int `mandatory:"false" json:"delayInSeconds"` + + // Specifies how a replication channel handles the creation and alteration of tables + // that do not have a primary key. + TablesWithoutPrimaryKeyHandling ChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum `mandatory:"false" json:"tablesWithoutPrimaryKeyHandling,omitempty"` } func (m UpdateChannelTargetFromDbSystemDetails) String() string { @@ -41,6 +49,9 @@ func (m UpdateChannelTargetFromDbSystemDetails) String() string { func (m UpdateChannelTargetFromDbSystemDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnum(string(m.TablesWithoutPrimaryKeyHandling)); !ok && m.TablesWithoutPrimaryKeyHandling != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TablesWithoutPrimaryKeyHandling: %s. Supported values are: %s.", m.TablesWithoutPrimaryKeyHandling, strings.Join(GetChannelTargetDbSystemTablesWithoutPrimaryKeyHandlingEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/oci.go b/oci.go index 6d98dd62fe..a3c021d380 100644 --- a/oci.go +++ b/oci.go @@ -83,6 +83,24 @@ functions that return a pointer for a given value. For example: } +Dedicated Endpoints + +Dedicated endpoints are the endpoint templates defined by the service for a specific realm at client level. OCI Go SDK +allows you to enable the use of these realm-specific endpoint templates feature at application level and at client level. +The value set at client level takes precedence over the value set at the application level. This feature is disabled by default. + +1. To opt-in the realm-specific endpoint templates feature at application level, set the environment variable + OCI_REALM_SPECIFIC_SERVICE_ENDPOINT_TEMPLATE_ENABLED to true. The boolean value is case insensitive + +2. To opt-in the realm-specific endpoint templates feature at client level, set the flag in code as shown below + c, clerr := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.DefaultConfigProvider()) + c.SetCustomClientConfiguration(common.CustomClientConfiguration{ + RealmSpecificServiceEndpointTemplateEnabled: common.Bool(true), + }) + +For reference, please refer https://github.com/oracle/oci-go-sdk/blob/master/example/example_objectstorage_test.go#L222-L251 + + Customizing Requests The SDK exposes functionality that allows the user to customize any http request before is sent to the service. diff --git a/ocicontrolcenter/ocicontrolcenter_occmetrics_client.go b/ocicontrolcenter/ocicontrolcenter_occmetrics_client.go index ed01593988..723700f2be 100644 --- a/ocicontrolcenter/ocicontrolcenter_occmetrics_client.go +++ b/ocicontrolcenter/ocicontrolcenter_occmetrics_client.go @@ -137,7 +137,7 @@ func (client OccMetricsClient) listMetricProperties(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/occ/20230515/MetricPropertyCollection/ListMetricProperties" err = common.PostProcessServiceError(err, "OccMetrics", "ListMetricProperties", apiReferenceLink) return response, err } @@ -195,7 +195,7 @@ func (client OccMetricsClient) listNamespaces(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/occ/20230515/NamespaceCollection/ListNamespaces" err = common.PostProcessServiceError(err, "OccMetrics", "ListNamespaces", apiReferenceLink) return response, err } @@ -255,7 +255,7 @@ func (client OccMetricsClient) requestSummarizedMetricData(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/occ/20230515/SummarizedMetricDataCollection/RequestSummarizedMetricData" err = common.PostProcessServiceError(err, "OccMetrics", "RequestSummarizedMetricData", apiReferenceLink) return response, err } diff --git a/osmanagementhub/action_type.go b/osmanagementhub/action_type.go new file mode 100644 index 0000000000..bcee180378 --- /dev/null +++ b/osmanagementhub/action_type.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +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/osmanagementhub/advisory_severity.go b/osmanagementhub/advisory_severity.go new file mode 100644 index 0000000000..9701240ead --- /dev/null +++ b/osmanagementhub/advisory_severity.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// AdvisorySeverityEnum Enum with underlying type: string +type AdvisorySeverityEnum string + +// Set of constants representing the allowable values for AdvisorySeverityEnum +const ( + AdvisorySeverityLow AdvisorySeverityEnum = "LOW" + AdvisorySeverityModerate AdvisorySeverityEnum = "MODERATE" + AdvisorySeverityImportant AdvisorySeverityEnum = "IMPORTANT" + AdvisorySeverityCritical AdvisorySeverityEnum = "CRITICAL" +) + +var mappingAdvisorySeverityEnum = map[string]AdvisorySeverityEnum{ + "LOW": AdvisorySeverityLow, + "MODERATE": AdvisorySeverityModerate, + "IMPORTANT": AdvisorySeverityImportant, + "CRITICAL": AdvisorySeverityCritical, +} + +var mappingAdvisorySeverityEnumLowerCase = map[string]AdvisorySeverityEnum{ + "low": AdvisorySeverityLow, + "moderate": AdvisorySeverityModerate, + "important": AdvisorySeverityImportant, + "critical": AdvisorySeverityCritical, +} + +// GetAdvisorySeverityEnumValues Enumerates the set of values for AdvisorySeverityEnum +func GetAdvisorySeverityEnumValues() []AdvisorySeverityEnum { + values := make([]AdvisorySeverityEnum, 0) + for _, v := range mappingAdvisorySeverityEnum { + values = append(values, v) + } + return values +} + +// GetAdvisorySeverityEnumStringValues Enumerates the set of values in String for AdvisorySeverityEnum +func GetAdvisorySeverityEnumStringValues() []string { + return []string{ + "LOW", + "MODERATE", + "IMPORTANT", + "CRITICAL", + } +} + +// GetMappingAdvisorySeverityEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAdvisorySeverityEnum(val string) (AdvisorySeverityEnum, bool) { + enum, ok := mappingAdvisorySeverityEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/arch_type.go b/osmanagementhub/arch_type.go new file mode 100644 index 0000000000..0e5ebbf5c2 --- /dev/null +++ b/osmanagementhub/arch_type.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ArchTypeEnum Enum with underlying type: string +type ArchTypeEnum string + +// Set of constants representing the allowable values for ArchTypeEnum +const ( + ArchTypeX8664 ArchTypeEnum = "X86_64" + ArchTypeAarch64 ArchTypeEnum = "AARCH64" + ArchTypeI686 ArchTypeEnum = "I686" + ArchTypeNoarch ArchTypeEnum = "NOARCH" + ArchTypeSrc ArchTypeEnum = "SRC" +) + +var mappingArchTypeEnum = map[string]ArchTypeEnum{ + "X86_64": ArchTypeX8664, + "AARCH64": ArchTypeAarch64, + "I686": ArchTypeI686, + "NOARCH": ArchTypeNoarch, + "SRC": ArchTypeSrc, +} + +var mappingArchTypeEnumLowerCase = map[string]ArchTypeEnum{ + "x86_64": ArchTypeX8664, + "aarch64": ArchTypeAarch64, + "i686": ArchTypeI686, + "noarch": ArchTypeNoarch, + "src": ArchTypeSrc, +} + +// GetArchTypeEnumValues Enumerates the set of values for ArchTypeEnum +func GetArchTypeEnumValues() []ArchTypeEnum { + values := make([]ArchTypeEnum, 0) + for _, v := range mappingArchTypeEnum { + values = append(values, v) + } + return values +} + +// GetArchTypeEnumStringValues Enumerates the set of values in String for ArchTypeEnum +func GetArchTypeEnumStringValues() []string { + return []string{ + "X86_64", + "AARCH64", + "I686", + "NOARCH", + "SRC", + } +} + +// GetMappingArchTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingArchTypeEnum(val string) (ArchTypeEnum, bool) { + enum, ok := mappingArchTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/attach_managed_instances_to_lifecycle_stage_details.go b/osmanagementhub/attach_managed_instances_to_lifecycle_stage_details.go new file mode 100644 index 0000000000..402a84ad66 --- /dev/null +++ b/osmanagementhub/attach_managed_instances_to_lifecycle_stage_details.go @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttachManagedInstancesToLifecycleStageDetails The managed instances to attach to the lifecycle stage. +type AttachManagedInstancesToLifecycleStageDetails struct { + ManagedInstanceDetails *ManagedInstancesDetails `mandatory:"false" json:"managedInstanceDetails"` +} + +func (m AttachManagedInstancesToLifecycleStageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttachManagedInstancesToLifecycleStageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/attach_managed_instances_to_lifecycle_stage_request_response.go b/osmanagementhub/attach_managed_instances_to_lifecycle_stage_request_response.go new file mode 100644 index 0000000000..3fc5d59827 --- /dev/null +++ b/osmanagementhub/attach_managed_instances_to_lifecycle_stage_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AttachManagedInstancesToLifecycleStageRequest wrapper for the AttachManagedInstancesToLifecycleStage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachManagedInstancesToLifecycleStage.go.html to see an example of how to use AttachManagedInstancesToLifecycleStageRequest. +type AttachManagedInstancesToLifecycleStageRequest struct { + + // The OCID of the lifecycle stage. + LifecycleStageId *string `mandatory:"true" contributesTo:"path" name:"lifecycleStageId"` + + // Details for managed instances to attach to the lifecycle stage. + AttachManagedInstancesToLifecycleStageDetails `contributesTo:"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 `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 AttachManagedInstancesToLifecycleStageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachManagedInstancesToLifecycleStageRequest) 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 AttachManagedInstancesToLifecycleStageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachManagedInstancesToLifecycleStageRequest) 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 AttachManagedInstancesToLifecycleStageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttachManagedInstancesToLifecycleStageResponse wrapper for the AttachManagedInstancesToLifecycleStage operation +type AttachManagedInstancesToLifecycleStageResponse 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 AttachManagedInstancesToLifecycleStageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachManagedInstancesToLifecycleStageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/attach_managed_instances_to_managed_instance_group_details.go b/osmanagementhub/attach_managed_instances_to_managed_instance_group_details.go new file mode 100644 index 0000000000..0c32e47211 --- /dev/null +++ b/osmanagementhub/attach_managed_instances_to_managed_instance_group_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttachManagedInstancesToManagedInstanceGroupDetails The managed instance OCIDs to attach to the managed instance group. +type AttachManagedInstancesToManagedInstanceGroupDetails struct { + + // The list of managed instance OCIDs to be attached. + ManagedInstances []string `mandatory:"false" json:"managedInstances"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m AttachManagedInstancesToManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttachManagedInstancesToManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/attach_managed_instances_to_managed_instance_group_request_response.go b/osmanagementhub/attach_managed_instances_to_managed_instance_group_request_response.go new file mode 100644 index 0000000000..673dbd58d8 --- /dev/null +++ b/osmanagementhub/attach_managed_instances_to_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AttachManagedInstancesToManagedInstanceGroupRequest wrapper for the AttachManagedInstancesToManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachManagedInstancesToManagedInstanceGroup.go.html to see an example of how to use AttachManagedInstancesToManagedInstanceGroupRequest. +type AttachManagedInstancesToManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for managed instances to attach to the managed instance group. + AttachManagedInstancesToManagedInstanceGroupDetails `contributesTo:"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 `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 AttachManagedInstancesToManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachManagedInstancesToManagedInstanceGroupRequest) 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 AttachManagedInstancesToManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachManagedInstancesToManagedInstanceGroupRequest) 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 AttachManagedInstancesToManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttachManagedInstancesToManagedInstanceGroupResponse wrapper for the AttachManagedInstancesToManagedInstanceGroup operation +type AttachManagedInstancesToManagedInstanceGroupResponse 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 AttachManagedInstancesToManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachManagedInstancesToManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/attach_software_sources_to_managed_instance_details.go b/osmanagementhub/attach_software_sources_to_managed_instance_details.go new file mode 100644 index 0000000000..a9c87b9de8 --- /dev/null +++ b/osmanagementhub/attach_software_sources_to_managed_instance_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttachSoftwareSourcesToManagedInstanceDetails The details about the software sources to be attached. +type AttachSoftwareSourcesToManagedInstanceDetails struct { + + // The list of software source OCIDs to be attached/detached. + SoftwareSources []string `mandatory:"true" json:"softwareSources"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m AttachSoftwareSourcesToManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttachSoftwareSourcesToManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/attach_software_sources_to_managed_instance_group_details.go b/osmanagementhub/attach_software_sources_to_managed_instance_group_details.go new file mode 100644 index 0000000000..968e431228 --- /dev/null +++ b/osmanagementhub/attach_software_sources_to_managed_instance_group_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttachSoftwareSourcesToManagedInstanceGroupDetails The software sources OCIDs to attach to the managed instance group. +type AttachSoftwareSourcesToManagedInstanceGroupDetails struct { + + // The list of software sources OCIDs to be attached. + SoftwareSources []string `mandatory:"false" json:"softwareSources"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m AttachSoftwareSourcesToManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttachSoftwareSourcesToManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/attach_software_sources_to_managed_instance_group_request_response.go b/osmanagementhub/attach_software_sources_to_managed_instance_group_request_response.go new file mode 100644 index 0000000000..649c91437e --- /dev/null +++ b/osmanagementhub/attach_software_sources_to_managed_instance_group_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AttachSoftwareSourcesToManagedInstanceGroupRequest wrapper for the AttachSoftwareSourcesToManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachSoftwareSourcesToManagedInstanceGroup.go.html to see an example of how to use AttachSoftwareSourcesToManagedInstanceGroupRequest. +type AttachSoftwareSourcesToManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for software sources to attach to the managed instance group. + AttachSoftwareSourcesToManagedInstanceGroupDetails `contributesTo:"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 `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 AttachSoftwareSourcesToManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachSoftwareSourcesToManagedInstanceGroupRequest) 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 AttachSoftwareSourcesToManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachSoftwareSourcesToManagedInstanceGroupRequest) 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 AttachSoftwareSourcesToManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttachSoftwareSourcesToManagedInstanceGroupResponse wrapper for the AttachSoftwareSourcesToManagedInstanceGroup operation +type AttachSoftwareSourcesToManagedInstanceGroupResponse 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 AttachSoftwareSourcesToManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachSoftwareSourcesToManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/attach_software_sources_to_managed_instance_request_response.go b/osmanagementhub/attach_software_sources_to_managed_instance_request_response.go new file mode 100644 index 0000000000..eb5688ca4c --- /dev/null +++ b/osmanagementhub/attach_software_sources_to_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AttachSoftwareSourcesToManagedInstanceRequest wrapper for the AttachSoftwareSourcesToManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachSoftwareSourcesToManagedInstance.go.html to see an example of how to use AttachSoftwareSourcesToManagedInstanceRequest. +type AttachSoftwareSourcesToManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // Details of software sources to be attached to a managed instance. + AttachSoftwareSourcesToManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AttachSoftwareSourcesToManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachSoftwareSourcesToManagedInstanceRequest) 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 AttachSoftwareSourcesToManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachSoftwareSourcesToManagedInstanceRequest) 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 AttachSoftwareSourcesToManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttachSoftwareSourcesToManagedInstanceResponse wrapper for the AttachSoftwareSourcesToManagedInstance operation +type AttachSoftwareSourcesToManagedInstanceResponse 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 AttachSoftwareSourcesToManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachSoftwareSourcesToManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/availability.go b/osmanagementhub/availability.go new file mode 100644 index 0000000000..a8eedf5376 --- /dev/null +++ b/osmanagementhub/availability.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// AvailabilityEnum Enum with underlying type: string +type AvailabilityEnum string + +// Set of constants representing the allowable values for AvailabilityEnum +const ( + AvailabilityAvailable AvailabilityEnum = "AVAILABLE" + AvailabilitySelected AvailabilityEnum = "SELECTED" + AvailabilityRestricted AvailabilityEnum = "RESTRICTED" +) + +var mappingAvailabilityEnum = map[string]AvailabilityEnum{ + "AVAILABLE": AvailabilityAvailable, + "SELECTED": AvailabilitySelected, + "RESTRICTED": AvailabilityRestricted, +} + +var mappingAvailabilityEnumLowerCase = map[string]AvailabilityEnum{ + "available": AvailabilityAvailable, + "selected": AvailabilitySelected, + "restricted": AvailabilityRestricted, +} + +// GetAvailabilityEnumValues Enumerates the set of values for AvailabilityEnum +func GetAvailabilityEnumValues() []AvailabilityEnum { + values := make([]AvailabilityEnum, 0) + for _, v := range mappingAvailabilityEnum { + values = append(values, v) + } + return values +} + +// GetAvailabilityEnumStringValues Enumerates the set of values in String for AvailabilityEnum +func GetAvailabilityEnumStringValues() []string { + return []string{ + "AVAILABLE", + "SELECTED", + "RESTRICTED", + } +} + +// GetMappingAvailabilityEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAvailabilityEnum(val string) (AvailabilityEnum, bool) { + enum, ok := mappingAvailabilityEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/available_package_collection.go b/osmanagementhub/available_package_collection.go new file mode 100644 index 0000000000..a8848738ae --- /dev/null +++ b/osmanagementhub/available_package_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AvailablePackageCollection Results of an available package search on a managed instance. +type AvailablePackageCollection struct { + + // List of available packages. + Items []AvailablePackageSummary `mandatory:"true" json:"items"` +} + +func (m AvailablePackageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AvailablePackageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/available_package_summary.go b/osmanagementhub/available_package_summary.go new file mode 100644 index 0000000000..de14565103 --- /dev/null +++ b/osmanagementhub/available_package_summary.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AvailablePackageSummary A software package available for install on a managed instance. +type AvailablePackageSummary struct { + + // Package name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Unique identifier for the package. + Name *string `mandatory:"true" json:"name"` + + // Type of the package. + Type *string `mandatory:"true" json:"type"` + + // Version of the installed package. + Version *string `mandatory:"true" json:"version"` + + // list of software sources that provide the software package. + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` + + // The architecture for which this package was built. + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` +} + +//GetDisplayName returns DisplayName +func (m AvailablePackageSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetName returns Name +func (m AvailablePackageSummary) GetName() *string { + return m.Name +} + +//GetType returns Type +func (m AvailablePackageSummary) GetType() *string { + return m.Type +} + +//GetVersion returns Version +func (m AvailablePackageSummary) GetVersion() *string { + return m.Version +} + +//GetArchitecture returns Architecture +func (m AvailablePackageSummary) GetArchitecture() ArchTypeEnum { + return m.Architecture +} + +//GetSoftwareSources returns SoftwareSources +func (m AvailablePackageSummary) GetSoftwareSources() []SoftwareSourceDetails { + return m.SoftwareSources +} + +func (m AvailablePackageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AvailablePackageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m AvailablePackageSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAvailablePackageSummary AvailablePackageSummary + s := struct { + DiscriminatorParam string `json:"packageClassification"` + MarshalTypeAvailablePackageSummary + }{ + "AVAILABLE", + (MarshalTypeAvailablePackageSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/available_software_source_collection.go b/osmanagementhub/available_software_source_collection.go new file mode 100644 index 0000000000..4dbcf49397 --- /dev/null +++ b/osmanagementhub/available_software_source_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AvailableSoftwareSourceCollection Results of searching for available software sources for a managed instance. +type AvailableSoftwareSourceCollection struct { + + // List of available software sources. + Items []AvailableSoftwareSourceSummary `mandatory:"true" json:"items"` +} + +func (m AvailableSoftwareSourceCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AvailableSoftwareSourceCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/available_software_source_summary.go b/osmanagementhub/available_software_source_summary.go new file mode 100644 index 0000000000..c9b18a03c6 --- /dev/null +++ b/osmanagementhub/available_software_source_summary.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AvailableSoftwareSourceSummary A software source which can be added to a managed instance. Once a software source is added, packages from that software source can be installed on that managed instance. +type AvailableSoftwareSourceSummary struct { + + // unique identifier that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` +} + +func (m AvailableSoftwareSourceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AvailableSoftwareSourceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/change_availability_of_software_sources_details.go b/osmanagementhub/change_availability_of_software_sources_details.go new file mode 100644 index 0000000000..332d0bf7af --- /dev/null +++ b/osmanagementhub/change_availability_of_software_sources_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeAvailabilityOfSoftwareSourcesDetails Request body that contains a list of software sources whose availability needs to be updated. +type ChangeAvailabilityOfSoftwareSourcesDetails struct { + + // List of objects containing software source ids and its availability. + SoftwareSourceAvailabilities []SoftwareSourceAvailability `mandatory:"false" json:"softwareSourceAvailabilities"` +} + +func (m ChangeAvailabilityOfSoftwareSourcesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeAvailabilityOfSoftwareSourcesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/change_availability_of_software_sources_request_response.go b/osmanagementhub/change_availability_of_software_sources_request_response.go new file mode 100644 index 0000000000..3f18976917 --- /dev/null +++ b/osmanagementhub/change_availability_of_software_sources_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeAvailabilityOfSoftwareSourcesRequest wrapper for the ChangeAvailabilityOfSoftwareSources operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ChangeAvailabilityOfSoftwareSources.go.html to see an example of how to use ChangeAvailabilityOfSoftwareSourcesRequest. +type ChangeAvailabilityOfSoftwareSourcesRequest struct { + + // Request body that contains a list of software sources whose availability needs to be updated. + ChangeAvailabilityOfSoftwareSourcesDetails `contributesTo:"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 `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeAvailabilityOfSoftwareSourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeAvailabilityOfSoftwareSourcesRequest) 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 ChangeAvailabilityOfSoftwareSourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeAvailabilityOfSoftwareSourcesRequest) 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 ChangeAvailabilityOfSoftwareSourcesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeAvailabilityOfSoftwareSourcesResponse wrapper for the ChangeAvailabilityOfSoftwareSources operation +type ChangeAvailabilityOfSoftwareSourcesResponse 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 ChangeAvailabilityOfSoftwareSourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeAvailabilityOfSoftwareSourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/checksum_type.go b/osmanagementhub/checksum_type.go new file mode 100644 index 0000000000..b81230edfc --- /dev/null +++ b/osmanagementhub/checksum_type.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ChecksumTypeEnum Enum with underlying type: string +type ChecksumTypeEnum string + +// Set of constants representing the allowable values for ChecksumTypeEnum +const ( + ChecksumTypeSha1 ChecksumTypeEnum = "SHA1" + ChecksumTypeSha256 ChecksumTypeEnum = "SHA256" + ChecksumTypeSha384 ChecksumTypeEnum = "SHA384" + ChecksumTypeSha512 ChecksumTypeEnum = "SHA512" +) + +var mappingChecksumTypeEnum = map[string]ChecksumTypeEnum{ + "SHA1": ChecksumTypeSha1, + "SHA256": ChecksumTypeSha256, + "SHA384": ChecksumTypeSha384, + "SHA512": ChecksumTypeSha512, +} + +var mappingChecksumTypeEnumLowerCase = map[string]ChecksumTypeEnum{ + "sha1": ChecksumTypeSha1, + "sha256": ChecksumTypeSha256, + "sha384": ChecksumTypeSha384, + "sha512": ChecksumTypeSha512, +} + +// GetChecksumTypeEnumValues Enumerates the set of values for ChecksumTypeEnum +func GetChecksumTypeEnumValues() []ChecksumTypeEnum { + values := make([]ChecksumTypeEnum, 0) + for _, v := range mappingChecksumTypeEnum { + values = append(values, v) + } + return values +} + +// GetChecksumTypeEnumStringValues Enumerates the set of values in String for ChecksumTypeEnum +func GetChecksumTypeEnumStringValues() []string { + return []string{ + "SHA1", + "SHA256", + "SHA384", + "SHA512", + } +} + +// GetMappingChecksumTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingChecksumTypeEnum(val string) (ChecksumTypeEnum, bool) { + enum, ok := mappingChecksumTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/classification_types.go b/osmanagementhub/classification_types.go new file mode 100644 index 0000000000..f2e7cbc6aa --- /dev/null +++ b/osmanagementhub/classification_types.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ClassificationTypesEnum Enum with underlying type: string +type ClassificationTypesEnum string + +// Set of constants representing the allowable values for ClassificationTypesEnum +const ( + ClassificationTypesSecurity ClassificationTypesEnum = "SECURITY" + ClassificationTypesBugfix ClassificationTypesEnum = "BUGFIX" + ClassificationTypesEnhancement ClassificationTypesEnum = "ENHANCEMENT" + ClassificationTypesOther ClassificationTypesEnum = "OTHER" +) + +var mappingClassificationTypesEnum = map[string]ClassificationTypesEnum{ + "SECURITY": ClassificationTypesSecurity, + "BUGFIX": ClassificationTypesBugfix, + "ENHANCEMENT": ClassificationTypesEnhancement, + "OTHER": ClassificationTypesOther, +} + +var mappingClassificationTypesEnumLowerCase = map[string]ClassificationTypesEnum{ + "security": ClassificationTypesSecurity, + "bugfix": ClassificationTypesBugfix, + "enhancement": ClassificationTypesEnhancement, + "other": ClassificationTypesOther, +} + +// GetClassificationTypesEnumValues Enumerates the set of values for ClassificationTypesEnum +func GetClassificationTypesEnumValues() []ClassificationTypesEnum { + values := make([]ClassificationTypesEnum, 0) + for _, v := range mappingClassificationTypesEnum { + values = append(values, v) + } + return values +} + +// GetClassificationTypesEnumStringValues Enumerates the set of values in String for ClassificationTypesEnum +func GetClassificationTypesEnumStringValues() []string { + return []string{ + "SECURITY", + "BUGFIX", + "ENHANCEMENT", + "OTHER", + } +} + +// GetMappingClassificationTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingClassificationTypesEnum(val string) (ClassificationTypesEnum, bool) { + enum, ok := mappingClassificationTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/create_custom_software_source_details.go b/osmanagementhub/create_custom_software_source_details.go new file mode 100644 index 0000000000..aa6ffe4342 --- /dev/null +++ b/osmanagementhub/create_custom_software_source_details.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCustomSoftwareSourceDetails Description of a custom software source to be created. +type CreateCustomSoftwareSourceDetails struct { + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // List of vendor software sources. + VendorSoftwareSources []Id `mandatory:"true" json:"vendorSoftwareSources"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + CustomSoftwareSourceFilter *CustomSoftwareSourceFilter `mandatory:"false" json:"customSoftwareSourceFilter"` + + // Indicates whether service should automatically update the custom software source for the user. + IsAutomaticallyUpdated *bool `mandatory:"false" json:"isAutomaticallyUpdated"` +} + +//GetCompartmentId returns CompartmentId +func (m CreateCustomSoftwareSourceDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m CreateCustomSoftwareSourceDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m CreateCustomSoftwareSourceDetails) GetDescription() *string { + return m.Description +} + +//GetFreeformTags returns FreeformTags +func (m CreateCustomSoftwareSourceDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateCustomSoftwareSourceDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateCustomSoftwareSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateCustomSoftwareSourceDetails) 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 CreateCustomSoftwareSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateCustomSoftwareSourceDetails CreateCustomSoftwareSourceDetails + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeCreateCustomSoftwareSourceDetails + }{ + "CUSTOM", + (MarshalTypeCreateCustomSoftwareSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/create_entitlement_details.go b/osmanagementhub/create_entitlement_details.go new file mode 100644 index 0000000000..4c956b2209 --- /dev/null +++ b/osmanagementhub/create_entitlement_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateEntitlementDetails Creates an entitlement for the specified compartment OCID and CSI. +type CreateEntitlementDetails struct { + + // The OCID of the tenancy containing the entitlement. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A Customer Support Identifier (CSI) is a unique key given to a customer to unlock software sources. It uniquely identifies the entitlement. + Csi *string `mandatory:"true" json:"csi"` +} + +func (m CreateEntitlementDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateEntitlementDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_entitlement_request_response.go b/osmanagementhub/create_entitlement_request_response.go new file mode 100644 index 0000000000..c649b3a41b --- /dev/null +++ b/osmanagementhub/create_entitlement_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateEntitlementRequest wrapper for the CreateEntitlement operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateEntitlement.go.html to see an example of how to use CreateEntitlementRequest. +type CreateEntitlementRequest struct { + + // Details for creating entitlements. + CreateEntitlementDetails `contributesTo:"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 `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateEntitlementRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateEntitlementRequest) 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 CreateEntitlementRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateEntitlementRequest) 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 CreateEntitlementRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateEntitlementResponse wrapper for the CreateEntitlement operation +type CreateEntitlementResponse 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 CreateEntitlementResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateEntitlementResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/create_group_profile_details.go b/osmanagementhub/create_group_profile_details.go new file mode 100644 index 0000000000..ab9ae12ed8 --- /dev/null +++ b/osmanagementhub/create_group_profile_details.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateGroupProfileDetails Description of a group registration profile to be created. +type CreateGroupProfileDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the managed instance group from which the registration profile will inherit its software sources. + ManagedInstanceGroupId *string `mandatory:"true" json:"managedInstanceGroupId"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +//GetDisplayName returns DisplayName +func (m CreateGroupProfileDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetCompartmentId returns CompartmentId +func (m CreateGroupProfileDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDescription returns Description +func (m CreateGroupProfileDetails) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m CreateGroupProfileDetails) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetFreeformTags returns FreeformTags +func (m CreateGroupProfileDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateGroupProfileDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateGroupProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateGroupProfileDetails) 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 CreateGroupProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateGroupProfileDetails CreateGroupProfileDetails + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeCreateGroupProfileDetails + }{ + "GROUP", + (MarshalTypeCreateGroupProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/create_lifecycle_environment_details.go b/osmanagementhub/create_lifecycle_environment_details.go new file mode 100644 index 0000000000..e7316afb31 --- /dev/null +++ b/osmanagementhub/create_lifecycle_environment_details.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateLifecycleEnvironmentDetails Creates a lifecycle environment. +// A lifecycle environment is a user-defined pipeline to deliver curated, +// versioned content in a prescribed, methodical manner. +type CreateLifecycleEnvironmentDetails struct { + + // The OCID of the tenancy containing the lifecycle environment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // User specified list of ranked lifecycle stages to be created for the lifecycle environment. + Stages []CreateLifecycleStageDetails `mandatory:"true" json:"stages"` + + // The CPU architecture of the managed instance(s) in the lifecycle environment. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The operating system type of the managed instance(s) in the lifecycle environment. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // User specified information about the lifecycle environment. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateLifecycleEnvironmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateLifecycleEnvironmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_lifecycle_environment_request_response.go b/osmanagementhub/create_lifecycle_environment_request_response.go new file mode 100644 index 0000000000..cad075a2c9 --- /dev/null +++ b/osmanagementhub/create_lifecycle_environment_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateLifecycleEnvironmentRequest wrapper for the CreateLifecycleEnvironment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateLifecycleEnvironment.go.html to see an example of how to use CreateLifecycleEnvironmentRequest. +type CreateLifecycleEnvironmentRequest struct { + + // Details for the new lifecycle environment. + CreateLifecycleEnvironmentDetails `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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateLifecycleEnvironmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateLifecycleEnvironmentRequest) 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 CreateLifecycleEnvironmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateLifecycleEnvironmentRequest) 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 CreateLifecycleEnvironmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateLifecycleEnvironmentResponse wrapper for the CreateLifecycleEnvironment operation +type CreateLifecycleEnvironmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The LifecycleEnvironment instance + LifecycleEnvironment `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 CreateLifecycleEnvironmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateLifecycleEnvironmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/create_lifecycle_profile_details.go b/osmanagementhub/create_lifecycle_profile_details.go new file mode 100644 index 0000000000..1e02491f52 --- /dev/null +++ b/osmanagementhub/create_lifecycle_profile_details.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateLifecycleProfileDetails Description of a lifecycle registration profile to be created. +type CreateLifecycleProfileDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the lifecycle stage from which the registration profile will inherit its software source. + LifecycleStageId *string `mandatory:"true" json:"lifecycleStageId"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +//GetDisplayName returns DisplayName +func (m CreateLifecycleProfileDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetCompartmentId returns CompartmentId +func (m CreateLifecycleProfileDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDescription returns Description +func (m CreateLifecycleProfileDetails) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m CreateLifecycleProfileDetails) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetFreeformTags returns FreeformTags +func (m CreateLifecycleProfileDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateLifecycleProfileDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateLifecycleProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateLifecycleProfileDetails) 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 CreateLifecycleProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateLifecycleProfileDetails CreateLifecycleProfileDetails + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeCreateLifecycleProfileDetails + }{ + "LIFECYCLE", + (MarshalTypeCreateLifecycleProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/create_lifecycle_stage_details.go b/osmanagementhub/create_lifecycle_stage_details.go new file mode 100644 index 0000000000..56160d1b6d --- /dev/null +++ b/osmanagementhub/create_lifecycle_stage_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateLifecycleStageDetails The information about a lifecycle stage. +type CreateLifecycleStageDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // User specified rank for the lifecycle stage. + // Rank determines the hierarchy of the lifecycle stages for a given lifecycle environment. + Rank *int `mandatory:"true" json:"rank"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateLifecycleStageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateLifecycleStageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_managed_instance_group_details.go b/osmanagementhub/create_managed_instance_group_details.go new file mode 100644 index 0000000000..cea2070d02 --- /dev/null +++ b/osmanagementhub/create_managed_instance_group_details.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateManagedInstanceGroupDetails The information about new managed instance group. +type CreateManagedInstanceGroupDetails struct { + + // A user-friendly name for the managed instance group. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the tenancy containing the managed instance group. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The operating system type of the managed instance(s) that this managed instance group will contain. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The CPU architecture type of the managed instance(s) that this managed instance group will contain. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The list of software source OCIDs available to the managed instances in the managed instance group. + SoftwareSourceIds []string `mandatory:"true" json:"softwareSourceIds"` + + // Details about the managed instance group. + Description *string `mandatory:"false" json:"description"` + + // The list of managed instance OCIDs to be added to the managed instance group. + ManagedInstanceIds []string `mandatory:"false" json:"managedInstanceIds"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_managed_instance_group_request_response.go b/osmanagementhub/create_managed_instance_group_request_response.go new file mode 100644 index 0000000000..c24a150c0a --- /dev/null +++ b/osmanagementhub/create_managed_instance_group_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateManagedInstanceGroupRequest wrapper for the CreateManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateManagedInstanceGroup.go.html to see an example of how to use CreateManagedInstanceGroupRequest. +type CreateManagedInstanceGroupRequest struct { + + // Details for the new managed instance group. + CreateManagedInstanceGroupDetails `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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateManagedInstanceGroupRequest) 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 CreateManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateManagedInstanceGroupRequest) 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 CreateManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateManagedInstanceGroupResponse wrapper for the CreateManagedInstanceGroup operation +type CreateManagedInstanceGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagedInstanceGroup instance + ManagedInstanceGroup `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 CreateManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/create_management_station_details.go b/osmanagementhub/create_management_station_details.go new file mode 100644 index 0000000000..2cbfad829a --- /dev/null +++ b/osmanagementhub/create_management_station_details.go @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateManagementStationDetails Information for creating an ManagementStation +type CreateManagementStationDetails struct { + + // The OCID of the tenancy containing the Management Station. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Management Station name + DisplayName *string `mandatory:"true" json:"displayName"` + + // Name of the host + Hostname *string `mandatory:"true" json:"hostname"` + + Proxy *CreateProxyConfigurationDetails `mandatory:"true" json:"proxy"` + + Mirror *CreateMirrorConfigurationDetails `mandatory:"true" json:"mirror"` + + // Details describing the Management Station config. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateManagementStationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateManagementStationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_management_station_request_response.go b/osmanagementhub/create_management_station_request_response.go new file mode 100644 index 0000000000..019145155d --- /dev/null +++ b/osmanagementhub/create_management_station_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateManagementStationRequest wrapper for the CreateManagementStation operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateManagementStation.go.html to see an example of how to use CreateManagementStationRequest. +type CreateManagementStationRequest struct { + + // Details for the new ManagementStation. + CreateManagementStationDetails `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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateManagementStationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateManagementStationRequest) 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 CreateManagementStationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateManagementStationRequest) 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 CreateManagementStationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateManagementStationResponse wrapper for the CreateManagementStation operation +type CreateManagementStationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagementStation instance + ManagementStation `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 CreateManagementStationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateManagementStationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/create_mirror_configuration_details.go b/osmanagementhub/create_mirror_configuration_details.go new file mode 100644 index 0000000000..13ea1afb18 --- /dev/null +++ b/osmanagementhub/create_mirror_configuration_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateMirrorConfigurationDetails Information for creating a mirror configuration +type CreateMirrorConfigurationDetails struct { + + // Directory for the mirroring + Directory *string `mandatory:"true" json:"directory"` + + // Default port for the mirror + Port *string `mandatory:"true" json:"port"` + + // Default sslport for the mirror + Sslport *string `mandatory:"true" json:"sslport"` + + // Local path for the sslcert + Sslcert *string `mandatory:"false" json:"sslcert"` +} + +func (m CreateMirrorConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateMirrorConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_profile_details.go b/osmanagementhub/create_profile_details.go new file mode 100644 index 0000000000..e0dc150e35 --- /dev/null +++ b/osmanagementhub/create_profile_details.go @@ -0,0 +1,154 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateProfileDetails The information about new registration profile. +type CreateProfileDetails interface { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + GetDisplayName() *string + + // The OCID of the tenancy containing the registration profile. + GetCompartmentId() *string + + // The description of the registration profile. + GetDescription() *string + + // The OCID of the management station. + GetManagementStationId() *string + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type createprofiledetails struct { + JsonData []byte + DisplayName *string `mandatory:"true" json:"displayName"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + Description *string `mandatory:"false" json:"description"` + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + ProfileType string `json:"profileType"` +} + +// UnmarshalJSON unmarshals json +func (m *createprofiledetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateprofiledetails createprofiledetails + s := struct { + Model Unmarshalercreateprofiledetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DisplayName = s.Model.DisplayName + m.CompartmentId = s.Model.CompartmentId + m.Description = s.Model.Description + m.ManagementStationId = s.Model.ManagementStationId + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.ProfileType = s.Model.ProfileType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createprofiledetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ProfileType { + case "GROUP": + mm := CreateGroupProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "STATION": + mm := CreateStationProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "SOFTWARESOURCE": + mm := CreateSoftwareSourceProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "LIFECYCLE": + mm := CreateLifecycleProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateProfileDetails: %s.", m.ProfileType) + return *m, nil + } +} + +//GetDisplayName returns DisplayName +func (m createprofiledetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetCompartmentId returns CompartmentId +func (m createprofiledetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDescription returns Description +func (m createprofiledetails) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m createprofiledetails) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetFreeformTags returns FreeformTags +func (m createprofiledetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m createprofiledetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m createprofiledetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createprofiledetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_profile_request_response.go b/osmanagementhub/create_profile_request_response.go new file mode 100644 index 0000000000..1a0fea1944 --- /dev/null +++ b/osmanagementhub/create_profile_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateProfileRequest wrapper for the CreateProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateProfile.go.html to see an example of how to use CreateProfileRequest. +type CreateProfileRequest struct { + + // Details for the new registration profile. + CreateProfileDetails `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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateProfileRequest) 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 CreateProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateProfileRequest) 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 CreateProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateProfileResponse wrapper for the CreateProfile operation +type CreateProfileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Profile instance + Profile `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 CreateProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/create_proxy_configuration_details.go b/osmanagementhub/create_proxy_configuration_details.go new file mode 100644 index 0000000000..6bef075091 --- /dev/null +++ b/osmanagementhub/create_proxy_configuration_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateProxyConfigurationDetails Information for creating a proxy configuration +type CreateProxyConfigurationDetails struct { + + // To enable or disable the proxy (default true) + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // List of hosts + Hosts []string `mandatory:"false" json:"hosts"` + + // Port that the proxy will use + Port *string `mandatory:"false" json:"port"` + + // URL that the proxy will forward to + Forward *string `mandatory:"false" json:"forward"` +} + +func (m CreateProxyConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateProxyConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_scheduled_job_details.go b/osmanagementhub/create_scheduled_job_details.go new file mode 100644 index 0000000000..7bf59d84bd --- /dev/null +++ b/osmanagementhub/create_scheduled_job_details.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateScheduledJobDetails Information for creating a scheduled job. +type CreateScheduledJobDetails struct { + + // The OCID of the compartment containing the scheduled job. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The type of scheduling this scheduled job follows. + ScheduleType ScheduleTypesEnum `mandatory:"true" json:"scheduleType"` + + // The desired time for the next execution of this scheduled job. + TimeNextExecution *common.SDKTime `mandatory:"true" json:"timeNextExecution"` + + // The list of operations this scheduled job needs to perform (can only support one operation if the operationType is not UPDATE_PACKAGES/UPDATE_ALL/UPDATE_SECURITY/UPDATE_BUGFIX/UPDATE_ENHANCEMENT/UPDATE_OTHER/UPDATE_KSPLICE_USERSPACE/UPDATE_KSPLICE_KERNEL). + Operations []ScheduledJobOperation `mandatory:"true" json:"operations"` + + // Scheduled job name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Details describing the scheduled job. + Description *string `mandatory:"false" json:"description"` + + // The recurring rule for a recurring scheduled job. + RecurringRule *string `mandatory:"false" json:"recurringRule"` + + // The list of managed instance OCIDs this scheduled job operates on. Either this or + // managedInstanceGroupIds, or managedCompartmentIds, or lifecycleStageIds must be supplied. + ManagedInstanceIds []string `mandatory:"false" json:"managedInstanceIds"` + + // The list of managed instance group OCIDs this scheduled job operates on. Either this or + // managedInstanceIds, or managedCompartmentIds, or lifecycleStageIds must be supplied. + ManagedInstanceGroupIds []string `mandatory:"false" json:"managedInstanceGroupIds"` + + // The list of target compartment OCIDs if this scheduled job operates on a compartment level. + // Either this or managedInstanceIds, or managedInstanceGroupIds, or lifecycleStageIds must be supplied. + ManagedCompartmentIds []string `mandatory:"false" json:"managedCompartmentIds"` + + // The list of lifecycle stage OCIDs this scheduled job operates on. Either this or + // managedInstanceIds, or managedInstanceGroupIds, or managedCompartmentIds must be supplied. + LifecycleStageIds []string `mandatory:"false" json:"lifecycleStageIds"` + + // Whether to create jobs for all compartments in the tenancy when managedCompartmentIds specifies the tenancy OCID. + IsSubcompartmentIncluded *bool `mandatory:"false" json:"isSubcompartmentIncluded"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateScheduledJobDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateScheduledJobDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduleTypesEnum(string(m.ScheduleType)); !ok && m.ScheduleType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduleType: %s. Supported values are: %s.", m.ScheduleType, strings.Join(GetScheduleTypesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_scheduled_job_request_response.go b/osmanagementhub/create_scheduled_job_request_response.go new file mode 100644 index 0000000000..9f0a191ba4 --- /dev/null +++ b/osmanagementhub/create_scheduled_job_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateScheduledJobRequest wrapper for the CreateScheduledJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateScheduledJob.go.html to see an example of how to use CreateScheduledJobRequest. +type CreateScheduledJobRequest struct { + + // Details for the new scheduled job. + CreateScheduledJobDetails `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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateScheduledJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateScheduledJobRequest) 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 CreateScheduledJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateScheduledJobRequest) 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 CreateScheduledJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateScheduledJobResponse wrapper for the CreateScheduledJob operation +type CreateScheduledJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ScheduledJob instance + ScheduledJob `presentIn:"body"` + + // A link to the created scheduled job. + Location *string `presentIn:"header" name:"location"` + + // 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 CreateScheduledJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateScheduledJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/create_software_source_details.go b/osmanagementhub/create_software_source_details.go new file mode 100644 index 0000000000..e40e97f33a --- /dev/null +++ b/osmanagementhub/create_software_source_details.go @@ -0,0 +1,136 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSoftwareSourceDetails Description of a software source to be created. +type CreateSoftwareSourceDetails interface { + + // The OCID of the tenancy containing the software source. + GetCompartmentId() *string + + // User friendly name for the software source. + GetDisplayName() *string + + // Information specified by the user about the software source. + GetDescription() *string + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type createsoftwaresourcedetails struct { + JsonData []byte + CompartmentId *string `mandatory:"true" json:"compartmentId"` + DisplayName *string `mandatory:"true" json:"displayName"` + Description *string `mandatory:"false" json:"description"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SoftwareSourceType string `json:"softwareSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *createsoftwaresourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatesoftwaresourcedetails createsoftwaresourcedetails + s := struct { + Model Unmarshalercreatesoftwaresourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.DisplayName = s.Model.DisplayName + m.Description = s.Model.Description + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SoftwareSourceType = s.Model.SoftwareSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createsoftwaresourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SoftwareSourceType { + case "CUSTOM": + mm := CreateCustomSoftwareSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VERSIONED": + mm := CreateVersionedCustomSoftwareSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateSoftwareSourceDetails: %s.", m.SoftwareSourceType) + return *m, nil + } +} + +//GetCompartmentId returns CompartmentId +func (m createsoftwaresourcedetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m createsoftwaresourcedetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m createsoftwaresourcedetails) GetDescription() *string { + return m.Description +} + +//GetFreeformTags returns FreeformTags +func (m createsoftwaresourcedetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m createsoftwaresourcedetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m createsoftwaresourcedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createsoftwaresourcedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/create_software_source_profile_details.go b/osmanagementhub/create_software_source_profile_details.go new file mode 100644 index 0000000000..0fb55c69ab --- /dev/null +++ b/osmanagementhub/create_software_source_profile_details.go @@ -0,0 +1,125 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSoftwareSourceProfileDetails Description of a software source registration profile to be created. +type CreateSoftwareSourceProfileDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The list of software source OCIDs that the registration profile will use. + SoftwareSourceIds []string `mandatory:"true" json:"softwareSourceIds"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The operating system family. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` +} + +//GetDisplayName returns DisplayName +func (m CreateSoftwareSourceProfileDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetCompartmentId returns CompartmentId +func (m CreateSoftwareSourceProfileDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDescription returns Description +func (m CreateSoftwareSourceProfileDetails) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m CreateSoftwareSourceProfileDetails) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetFreeformTags returns FreeformTags +func (m CreateSoftwareSourceProfileDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateSoftwareSourceProfileDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateSoftwareSourceProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateSoftwareSourceProfileDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateSoftwareSourceProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateSoftwareSourceProfileDetails CreateSoftwareSourceProfileDetails + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeCreateSoftwareSourceProfileDetails + }{ + "SOFTWARESOURCE", + (MarshalTypeCreateSoftwareSourceProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/create_software_source_request_response.go b/osmanagementhub/create_software_source_request_response.go new file mode 100644 index 0000000000..e15b63ea16 --- /dev/null +++ b/osmanagementhub/create_software_source_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateSoftwareSourceRequest wrapper for the CreateSoftwareSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateSoftwareSource.go.html to see an example of how to use CreateSoftwareSourceRequest. +type CreateSoftwareSourceRequest struct { + + // Details for the new software source. + CreateSoftwareSourceDetails `contributesTo:"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 `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSoftwareSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSoftwareSourceRequest) 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 CreateSoftwareSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSoftwareSourceRequest) 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 CreateSoftwareSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSoftwareSourceResponse wrapper for the CreateSoftwareSource operation +type CreateSoftwareSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SoftwareSource instance + SoftwareSource `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"` + + // URL for the created software source, the software source OCID will be generated after this request is sent. + Location *string `presentIn:"header" name:"location"` + + // 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 CreateSoftwareSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSoftwareSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/create_station_profile_details.go b/osmanagementhub/create_station_profile_details.go new file mode 100644 index 0000000000..a42043d5d5 --- /dev/null +++ b/osmanagementhub/create_station_profile_details.go @@ -0,0 +1,122 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateStationProfileDetails Description of a group registration profile to be created. +type CreateStationProfileDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"false" json:"vendorName,omitempty"` + + // The operating system family. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The architecture type. + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` +} + +//GetDisplayName returns DisplayName +func (m CreateStationProfileDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetCompartmentId returns CompartmentId +func (m CreateStationProfileDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDescription returns Description +func (m CreateStationProfileDetails) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m CreateStationProfileDetails) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetFreeformTags returns FreeformTags +func (m CreateStationProfileDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateStationProfileDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateStationProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateStationProfileDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateStationProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateStationProfileDetails CreateStationProfileDetails + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeCreateStationProfileDetails + }{ + "STATION", + (MarshalTypeCreateStationProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/create_versioned_custom_software_source_details.go b/osmanagementhub/create_versioned_custom_software_source_details.go new file mode 100644 index 0000000000..1801383f09 --- /dev/null +++ b/osmanagementhub/create_versioned_custom_software_source_details.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateVersionedCustomSoftwareSourceDetails Description of a versioned custom software source to be created. +type CreateVersionedCustomSoftwareSourceDetails struct { + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // List of vendor software sources. + VendorSoftwareSources []Id `mandatory:"true" json:"vendorSoftwareSources"` + + // The version to assign to this custom software source. + SoftwareSourceVersion *string `mandatory:"true" json:"softwareSourceVersion"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + CustomSoftwareSourceFilter *CustomSoftwareSourceFilter `mandatory:"false" json:"customSoftwareSourceFilter"` +} + +//GetCompartmentId returns CompartmentId +func (m CreateVersionedCustomSoftwareSourceDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m CreateVersionedCustomSoftwareSourceDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m CreateVersionedCustomSoftwareSourceDetails) GetDescription() *string { + return m.Description +} + +//GetFreeformTags returns FreeformTags +func (m CreateVersionedCustomSoftwareSourceDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateVersionedCustomSoftwareSourceDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateVersionedCustomSoftwareSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateVersionedCustomSoftwareSourceDetails) 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 CreateVersionedCustomSoftwareSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateVersionedCustomSoftwareSourceDetails CreateVersionedCustomSoftwareSourceDetails + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeCreateVersionedCustomSoftwareSourceDetails + }{ + "VERSIONED", + (MarshalTypeCreateVersionedCustomSoftwareSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/custom_software_source.go b/osmanagementhub/custom_software_source.go new file mode 100644 index 0000000000..dea3b2d181 --- /dev/null +++ b/osmanagementhub/custom_software_source.go @@ -0,0 +1,233 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CustomSoftwareSource A custom software source contains a custom collection of packages. +type CustomSoftwareSource struct { + + // OCID for the software source. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The Repo ID for the software source. + RepoId *string `mandatory:"true" json:"repoId"` + + // URL for the repository. + Url *string `mandatory:"true" json:"url"` + + // List of vendor software sources. + VendorSoftwareSources []Id `mandatory:"true" json:"vendorSoftwareSources"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Number of packages. + PackageCount *int64 `mandatory:"false" json:"packageCount"` + + // URL of the GPG key for this software source. + GpgKeyUrl *string `mandatory:"false" json:"gpgKeyUrl"` + + // ID of the GPG key for this software source. + GpgKeyId *string `mandatory:"false" json:"gpgKeyId"` + + // Fingerprint of the GPG key for this software source. + GpgKeyFingerprint *string `mandatory:"false" json:"gpgKeyFingerprint"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + CustomSoftwareSourceFilter *CustomSoftwareSourceFilter `mandatory:"false" json:"customSoftwareSourceFilter"` + + // Indicates whether service should automatically update the custom software source for the user. + IsAutomaticallyUpdated *bool `mandatory:"false" json:"isAutomaticallyUpdated"` + + // Possible availabilities of a software source. + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + + // The OS family the software source belongs to. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type supported by the software source. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The current state of the software source. + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The yum repository checksum type used by this software source. + ChecksumType ChecksumTypeEnum `mandatory:"false" json:"checksumType,omitempty"` +} + +//GetId returns Id +func (m CustomSoftwareSource) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m CustomSoftwareSource) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m CustomSoftwareSource) GetDisplayName() *string { + return m.DisplayName +} + +//GetTimeCreated returns TimeCreated +func (m CustomSoftwareSource) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetDescription returns Description +func (m CustomSoftwareSource) GetDescription() *string { + return m.Description +} + +//GetAvailability returns Availability +func (m CustomSoftwareSource) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetRepoId returns RepoId +func (m CustomSoftwareSource) GetRepoId() *string { + return m.RepoId +} + +//GetOsFamily returns OsFamily +func (m CustomSoftwareSource) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m CustomSoftwareSource) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetLifecycleState returns LifecycleState +func (m CustomSoftwareSource) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetPackageCount returns PackageCount +func (m CustomSoftwareSource) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetUrl returns Url +func (m CustomSoftwareSource) GetUrl() *string { + return m.Url +} + +//GetChecksumType returns ChecksumType +func (m CustomSoftwareSource) GetChecksumType() ChecksumTypeEnum { + return m.ChecksumType +} + +//GetGpgKeyUrl returns GpgKeyUrl +func (m CustomSoftwareSource) GetGpgKeyUrl() *string { + return m.GpgKeyUrl +} + +//GetGpgKeyId returns GpgKeyId +func (m CustomSoftwareSource) GetGpgKeyId() *string { + return m.GpgKeyId +} + +//GetGpgKeyFingerprint returns GpgKeyFingerprint +func (m CustomSoftwareSource) GetGpgKeyFingerprint() *string { + return m.GpgKeyFingerprint +} + +//GetFreeformTags returns FreeformTags +func (m CustomSoftwareSource) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CustomSoftwareSource) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m CustomSoftwareSource) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m CustomSoftwareSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CustomSoftwareSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingChecksumTypeEnum(string(m.ChecksumType)); !ok && m.ChecksumType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ChecksumType: %s. Supported values are: %s.", m.ChecksumType, strings.Join(GetChecksumTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CustomSoftwareSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCustomSoftwareSource CustomSoftwareSource + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeCustomSoftwareSource + }{ + "CUSTOM", + (MarshalTypeCustomSoftwareSource)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/custom_software_source_filter.go b/osmanagementhub/custom_software_source_filter.go new file mode 100644 index 0000000000..05cb4fe4f8 --- /dev/null +++ b/osmanagementhub/custom_software_source_filter.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CustomSoftwareSourceFilter Used to apply filters to a VendorSoftwareSource to create/update CustomSoftwareSources. +type CustomSoftwareSourceFilter struct { + + // The list of package filters. + PackageFilters []PackageFilter `mandatory:"false" json:"packageFilters"` + + // The list of module stream/profile filters. + ModuleStreamProfileFilters []ModuleStreamProfileFilter `mandatory:"false" json:"moduleStreamProfileFilters"` + + // The list of group filters. + PackageGroupFilters []PackageGroupFilter `mandatory:"false" json:"packageGroupFilters"` +} + +func (m CustomSoftwareSourceFilter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CustomSoftwareSourceFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/custom_software_source_summary.go b/osmanagementhub/custom_software_source_summary.go new file mode 100644 index 0000000000..8e6ee71220 --- /dev/null +++ b/osmanagementhub/custom_software_source_summary.go @@ -0,0 +1,202 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CustomSoftwareSourceSummary A custom software source contains a custom collection of packages. +type CustomSoftwareSourceSummary struct { + + // The OCID for the software source. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The Repo ID for the software source. + RepoId *string `mandatory:"true" json:"repoId"` + + // URL for the repository. + Url *string `mandatory:"true" json:"url"` + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time of when the software source was updated as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // List of vendor software sources. + VendorSoftwareSources []Id `mandatory:"true" json:"vendorSoftwareSources"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Number of packages. + PackageCount *int64 `mandatory:"false" json:"packageCount"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The current state of the software source. + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Possible availabilities of a software source. + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + + // The OS family the software source belongs to. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type supported by the software source. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` +} + +//GetId returns Id +func (m CustomSoftwareSourceSummary) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m CustomSoftwareSourceSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m CustomSoftwareSourceSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetRepoId returns RepoId +func (m CustomSoftwareSourceSummary) GetRepoId() *string { + return m.RepoId +} + +//GetUrl returns Url +func (m CustomSoftwareSourceSummary) GetUrl() *string { + return m.Url +} + +//GetTimeCreated returns TimeCreated +func (m CustomSoftwareSourceSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m CustomSoftwareSourceSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +//GetDescription returns Description +func (m CustomSoftwareSourceSummary) GetDescription() *string { + return m.Description +} + +//GetAvailability returns Availability +func (m CustomSoftwareSourceSummary) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetOsFamily returns OsFamily +func (m CustomSoftwareSourceSummary) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m CustomSoftwareSourceSummary) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetPackageCount returns PackageCount +func (m CustomSoftwareSourceSummary) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetLifecycleState returns LifecycleState +func (m CustomSoftwareSourceSummary) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m CustomSoftwareSourceSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CustomSoftwareSourceSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m CustomSoftwareSourceSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m CustomSoftwareSourceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CustomSoftwareSourceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CustomSoftwareSourceSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCustomSoftwareSourceSummary CustomSoftwareSourceSummary + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeCustomSoftwareSourceSummary + }{ + "CUSTOM", + (MarshalTypeCustomSoftwareSourceSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/delete_lifecycle_environment_request_response.go b/osmanagementhub/delete_lifecycle_environment_request_response.go new file mode 100644 index 0000000000..6cd4919619 --- /dev/null +++ b/osmanagementhub/delete_lifecycle_environment_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteLifecycleEnvironmentRequest wrapper for the DeleteLifecycleEnvironment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteLifecycleEnvironment.go.html to see an example of how to use DeleteLifecycleEnvironmentRequest. +type DeleteLifecycleEnvironmentRequest struct { + + // The OCID of the lifecycle environment. + LifecycleEnvironmentId *string `mandatory:"true" contributesTo:"path" name:"lifecycleEnvironmentId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 DeleteLifecycleEnvironmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteLifecycleEnvironmentRequest) 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 DeleteLifecycleEnvironmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteLifecycleEnvironmentRequest) 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 DeleteLifecycleEnvironmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteLifecycleEnvironmentResponse wrapper for the DeleteLifecycleEnvironment operation +type DeleteLifecycleEnvironmentResponse 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 DeleteLifecycleEnvironmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteLifecycleEnvironmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/delete_managed_instance_group_request_response.go b/osmanagementhub/delete_managed_instance_group_request_response.go new file mode 100644 index 0000000000..5ffbe76ca9 --- /dev/null +++ b/osmanagementhub/delete_managed_instance_group_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteManagedInstanceGroupRequest wrapper for the DeleteManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteManagedInstanceGroup.go.html to see an example of how to use DeleteManagedInstanceGroupRequest. +type DeleteManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 DeleteManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteManagedInstanceGroupRequest) 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 DeleteManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteManagedInstanceGroupRequest) 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 DeleteManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteManagedInstanceGroupResponse wrapper for the DeleteManagedInstanceGroup operation +type DeleteManagedInstanceGroupResponse 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 DeleteManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/delete_management_station_request_response.go b/osmanagementhub/delete_management_station_request_response.go new file mode 100644 index 0000000000..2ebbb442cb --- /dev/null +++ b/osmanagementhub/delete_management_station_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteManagementStationRequest wrapper for the DeleteManagementStation operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteManagementStation.go.html to see an example of how to use DeleteManagementStationRequest. +type DeleteManagementStationRequest struct { + + // The OCID of the management station. + ManagementStationId *string `mandatory:"true" contributesTo:"path" name:"managementStationId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 DeleteManagementStationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteManagementStationRequest) 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 DeleteManagementStationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteManagementStationRequest) 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 DeleteManagementStationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteManagementStationResponse wrapper for the DeleteManagementStation operation +type DeleteManagementStationResponse 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 DeleteManagementStationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteManagementStationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/delete_profile_request_response.go b/osmanagementhub/delete_profile_request_response.go new file mode 100644 index 0000000000..be0addc139 --- /dev/null +++ b/osmanagementhub/delete_profile_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteProfileRequest wrapper for the DeleteProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteProfile.go.html to see an example of how to use DeleteProfileRequest. +type DeleteProfileRequest struct { + + // The OCID of the registration profile. + ProfileId *string `mandatory:"true" contributesTo:"path" name:"profileId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 DeleteProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteProfileRequest) 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 DeleteProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteProfileRequest) 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 DeleteProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteProfileResponse wrapper for the DeleteProfile operation +type DeleteProfileResponse 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 DeleteProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/delete_scheduled_job_request_response.go b/osmanagementhub/delete_scheduled_job_request_response.go new file mode 100644 index 0000000000..53d85c44ad --- /dev/null +++ b/osmanagementhub/delete_scheduled_job_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteScheduledJobRequest wrapper for the DeleteScheduledJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteScheduledJob.go.html to see an example of how to use DeleteScheduledJobRequest. +type DeleteScheduledJobRequest struct { + + // The OCID of the scheduled job. + ScheduledJobId *string `mandatory:"true" contributesTo:"path" name:"scheduledJobId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 DeleteScheduledJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteScheduledJobRequest) 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 DeleteScheduledJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteScheduledJobRequest) 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 DeleteScheduledJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteScheduledJobResponse wrapper for the DeleteScheduledJob operation +type DeleteScheduledJobResponse 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 DeleteScheduledJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteScheduledJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/delete_software_source_request_response.go b/osmanagementhub/delete_software_source_request_response.go new file mode 100644 index 0000000000..93eb68f667 --- /dev/null +++ b/osmanagementhub/delete_software_source_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteSoftwareSourceRequest wrapper for the DeleteSoftwareSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteSoftwareSource.go.html to see an example of how to use DeleteSoftwareSourceRequest. +type DeleteSoftwareSourceRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteSoftwareSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSoftwareSourceRequest) 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 DeleteSoftwareSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSoftwareSourceRequest) 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 DeleteSoftwareSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteSoftwareSourceResponse wrapper for the DeleteSoftwareSource operation +type DeleteSoftwareSourceResponse 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 DeleteSoftwareSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSoftwareSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/detach_managed_instances_from_lifecycle_stage_details.go b/osmanagementhub/detach_managed_instances_from_lifecycle_stage_details.go new file mode 100644 index 0000000000..1199f5c9d1 --- /dev/null +++ b/osmanagementhub/detach_managed_instances_from_lifecycle_stage_details.go @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DetachManagedInstancesFromLifecycleStageDetails The managed instances to detach from the lifecycle stage. +type DetachManagedInstancesFromLifecycleStageDetails struct { + ManagedInstanceDetails *ManagedInstancesDetails `mandatory:"false" json:"managedInstanceDetails"` +} + +func (m DetachManagedInstancesFromLifecycleStageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DetachManagedInstancesFromLifecycleStageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/detach_managed_instances_from_lifecycle_stage_request_response.go b/osmanagementhub/detach_managed_instances_from_lifecycle_stage_request_response.go new file mode 100644 index 0000000000..3fa8013f05 --- /dev/null +++ b/osmanagementhub/detach_managed_instances_from_lifecycle_stage_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DetachManagedInstancesFromLifecycleStageRequest wrapper for the DetachManagedInstancesFromLifecycleStage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachManagedInstancesFromLifecycleStage.go.html to see an example of how to use DetachManagedInstancesFromLifecycleStageRequest. +type DetachManagedInstancesFromLifecycleStageRequest struct { + + // The OCID of the lifecycle stage. + LifecycleStageId *string `mandatory:"true" contributesTo:"path" name:"lifecycleStageId"` + + // Details for managed instances to detach from the lifecycle stage. + DetachManagedInstancesFromLifecycleStageDetails `contributesTo:"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 `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 DetachManagedInstancesFromLifecycleStageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachManagedInstancesFromLifecycleStageRequest) 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 DetachManagedInstancesFromLifecycleStageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachManagedInstancesFromLifecycleStageRequest) 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 DetachManagedInstancesFromLifecycleStageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DetachManagedInstancesFromLifecycleStageResponse wrapper for the DetachManagedInstancesFromLifecycleStage operation +type DetachManagedInstancesFromLifecycleStageResponse 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 DetachManagedInstancesFromLifecycleStageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachManagedInstancesFromLifecycleStageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/detach_managed_instances_from_managed_instance_group_details.go b/osmanagementhub/detach_managed_instances_from_managed_instance_group_details.go new file mode 100644 index 0000000000..534928f081 --- /dev/null +++ b/osmanagementhub/detach_managed_instances_from_managed_instance_group_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DetachManagedInstancesFromManagedInstanceGroupDetails The managed instance OCIDs to detach from the managed instance group. +type DetachManagedInstancesFromManagedInstanceGroupDetails struct { + + // The list of managed instance OCIDs to be detached. + ManagedInstances []string `mandatory:"false" json:"managedInstances"` +} + +func (m DetachManagedInstancesFromManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DetachManagedInstancesFromManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/detach_managed_instances_from_managed_instance_group_request_response.go b/osmanagementhub/detach_managed_instances_from_managed_instance_group_request_response.go new file mode 100644 index 0000000000..4422f47d5f --- /dev/null +++ b/osmanagementhub/detach_managed_instances_from_managed_instance_group_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DetachManagedInstancesFromManagedInstanceGroupRequest wrapper for the DetachManagedInstancesFromManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachManagedInstancesFromManagedInstanceGroup.go.html to see an example of how to use DetachManagedInstancesFromManagedInstanceGroupRequest. +type DetachManagedInstancesFromManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for managed instances to detach from the managed instance group. + DetachManagedInstancesFromManagedInstanceGroupDetails `contributesTo:"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 `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 DetachManagedInstancesFromManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachManagedInstancesFromManagedInstanceGroupRequest) 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 DetachManagedInstancesFromManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachManagedInstancesFromManagedInstanceGroupRequest) 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 DetachManagedInstancesFromManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DetachManagedInstancesFromManagedInstanceGroupResponse wrapper for the DetachManagedInstancesFromManagedInstanceGroup operation +type DetachManagedInstancesFromManagedInstanceGroupResponse 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 DetachManagedInstancesFromManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachManagedInstancesFromManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/detach_software_sources_from_managed_instance_details.go b/osmanagementhub/detach_software_sources_from_managed_instance_details.go new file mode 100644 index 0000000000..761d1e03de --- /dev/null +++ b/osmanagementhub/detach_software_sources_from_managed_instance_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DetachSoftwareSourcesFromManagedInstanceDetails The details about the software sources to be detached. +type DetachSoftwareSourcesFromManagedInstanceDetails struct { + + // The list of software source OCIDs to be attached/detached. + SoftwareSources []string `mandatory:"true" json:"softwareSources"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m DetachSoftwareSourcesFromManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DetachSoftwareSourcesFromManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/detach_software_sources_from_managed_instance_group_details.go b/osmanagementhub/detach_software_sources_from_managed_instance_group_details.go new file mode 100644 index 0000000000..f819d9fc2a --- /dev/null +++ b/osmanagementhub/detach_software_sources_from_managed_instance_group_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DetachSoftwareSourcesFromManagedInstanceGroupDetails The software sources OCIDs to detach from the managed instance group. +type DetachSoftwareSourcesFromManagedInstanceGroupDetails struct { + + // The list of software sources OCIDs to be detached. + SoftwareSources []string `mandatory:"false" json:"softwareSources"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m DetachSoftwareSourcesFromManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DetachSoftwareSourcesFromManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/detach_software_sources_from_managed_instance_group_request_response.go b/osmanagementhub/detach_software_sources_from_managed_instance_group_request_response.go new file mode 100644 index 0000000000..d8986741b9 --- /dev/null +++ b/osmanagementhub/detach_software_sources_from_managed_instance_group_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DetachSoftwareSourcesFromManagedInstanceGroupRequest wrapper for the DetachSoftwareSourcesFromManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachSoftwareSourcesFromManagedInstanceGroup.go.html to see an example of how to use DetachSoftwareSourcesFromManagedInstanceGroupRequest. +type DetachSoftwareSourcesFromManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for software sources to attach to the specified managed instance group. + DetachSoftwareSourcesFromManagedInstanceGroupDetails `contributesTo:"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 `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 DetachSoftwareSourcesFromManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachSoftwareSourcesFromManagedInstanceGroupRequest) 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 DetachSoftwareSourcesFromManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachSoftwareSourcesFromManagedInstanceGroupRequest) 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 DetachSoftwareSourcesFromManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DetachSoftwareSourcesFromManagedInstanceGroupResponse wrapper for the DetachSoftwareSourcesFromManagedInstanceGroup operation +type DetachSoftwareSourcesFromManagedInstanceGroupResponse 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 DetachSoftwareSourcesFromManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachSoftwareSourcesFromManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/detach_software_sources_from_managed_instance_request_response.go b/osmanagementhub/detach_software_sources_from_managed_instance_request_response.go new file mode 100644 index 0000000000..02ac0a6a56 --- /dev/null +++ b/osmanagementhub/detach_software_sources_from_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DetachSoftwareSourcesFromManagedInstanceRequest wrapper for the DetachSoftwareSourcesFromManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachSoftwareSourcesFromManagedInstance.go.html to see an example of how to use DetachSoftwareSourcesFromManagedInstanceRequest. +type DetachSoftwareSourcesFromManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // Details of software sources to be detached from a managed instance. + DetachSoftwareSourcesFromManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DetachSoftwareSourcesFromManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachSoftwareSourcesFromManagedInstanceRequest) 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 DetachSoftwareSourcesFromManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachSoftwareSourcesFromManagedInstanceRequest) 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 DetachSoftwareSourcesFromManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DetachSoftwareSourcesFromManagedInstanceResponse wrapper for the DetachSoftwareSourcesFromManagedInstance operation +type DetachSoftwareSourcesFromManagedInstanceResponse 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 DetachSoftwareSourcesFromManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachSoftwareSourcesFromManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/disable_module_stream_on_managed_instance_details.go b/osmanagementhub/disable_module_stream_on_managed_instance_details.go new file mode 100644 index 0000000000..72d18492ed --- /dev/null +++ b/osmanagementhub/disable_module_stream_on_managed_instance_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DisableModuleStreamOnManagedInstanceDetails The details of the module stream to be disabled on a managed instance. +type DisableModuleStreamOnManagedInstanceDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m DisableModuleStreamOnManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DisableModuleStreamOnManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/disable_module_stream_on_managed_instance_group_details.go b/osmanagementhub/disable_module_stream_on_managed_instance_group_details.go new file mode 100644 index 0000000000..d668961ff6 --- /dev/null +++ b/osmanagementhub/disable_module_stream_on_managed_instance_group_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DisableModuleStreamOnManagedInstanceGroupDetails The work request details for the module stream operation on the managed instance group. +type DisableModuleStreamOnManagedInstanceGroupDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"false" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m DisableModuleStreamOnManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DisableModuleStreamOnManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/disable_module_stream_on_managed_instance_group_request_response.go b/osmanagementhub/disable_module_stream_on_managed_instance_group_request_response.go new file mode 100644 index 0000000000..a0b5abc7aa --- /dev/null +++ b/osmanagementhub/disable_module_stream_on_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableModuleStreamOnManagedInstanceGroupRequest wrapper for the DisableModuleStreamOnManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DisableModuleStreamOnManagedInstanceGroup.go.html to see an example of how to use DisableModuleStreamOnManagedInstanceGroupRequest. +type DisableModuleStreamOnManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for modules to disable on the managed instance group. + DisableModuleStreamOnManagedInstanceGroupDetails `contributesTo:"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 `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 DisableModuleStreamOnManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableModuleStreamOnManagedInstanceGroupRequest) 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 DisableModuleStreamOnManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableModuleStreamOnManagedInstanceGroupRequest) 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 DisableModuleStreamOnManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableModuleStreamOnManagedInstanceGroupResponse wrapper for the DisableModuleStreamOnManagedInstanceGroup operation +type DisableModuleStreamOnManagedInstanceGroupResponse 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 DisableModuleStreamOnManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableModuleStreamOnManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/disable_module_stream_on_managed_instance_request_response.go b/osmanagementhub/disable_module_stream_on_managed_instance_request_response.go new file mode 100644 index 0000000000..91585548df --- /dev/null +++ b/osmanagementhub/disable_module_stream_on_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableModuleStreamOnManagedInstanceRequest wrapper for the DisableModuleStreamOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DisableModuleStreamOnManagedInstance.go.html to see an example of how to use DisableModuleStreamOnManagedInstanceRequest. +type DisableModuleStreamOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // The details of the module stream to be disabled on a managed instance. + DisableModuleStreamOnManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DisableModuleStreamOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableModuleStreamOnManagedInstanceRequest) 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 DisableModuleStreamOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableModuleStreamOnManagedInstanceRequest) 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 DisableModuleStreamOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableModuleStreamOnManagedInstanceResponse wrapper for the DisableModuleStreamOnManagedInstance operation +type DisableModuleStreamOnManagedInstanceResponse 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 DisableModuleStreamOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableModuleStreamOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/enable_module_stream_on_managed_instance_details.go b/osmanagementhub/enable_module_stream_on_managed_instance_details.go new file mode 100644 index 0000000000..9635311596 --- /dev/null +++ b/osmanagementhub/enable_module_stream_on_managed_instance_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableModuleStreamOnManagedInstanceDetails The details of the module stream to be enabled on a managed instance. +type EnableModuleStreamOnManagedInstanceDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m EnableModuleStreamOnManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnableModuleStreamOnManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/enable_module_stream_on_managed_instance_group_details.go b/osmanagementhub/enable_module_stream_on_managed_instance_group_details.go new file mode 100644 index 0000000000..4532c7e848 --- /dev/null +++ b/osmanagementhub/enable_module_stream_on_managed_instance_group_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableModuleStreamOnManagedInstanceGroupDetails The work request details for the module stream operation on the managed instance group. +type EnableModuleStreamOnManagedInstanceGroupDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"false" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m EnableModuleStreamOnManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnableModuleStreamOnManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/enable_module_stream_on_managed_instance_group_request_response.go b/osmanagementhub/enable_module_stream_on_managed_instance_group_request_response.go new file mode 100644 index 0000000000..8b1ca66414 --- /dev/null +++ b/osmanagementhub/enable_module_stream_on_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableModuleStreamOnManagedInstanceGroupRequest wrapper for the EnableModuleStreamOnManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/EnableModuleStreamOnManagedInstanceGroup.go.html to see an example of how to use EnableModuleStreamOnManagedInstanceGroupRequest. +type EnableModuleStreamOnManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for modules to enable on the managed instance group. + EnableModuleStreamOnManagedInstanceGroupDetails `contributesTo:"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 `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 EnableModuleStreamOnManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableModuleStreamOnManagedInstanceGroupRequest) 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 EnableModuleStreamOnManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableModuleStreamOnManagedInstanceGroupRequest) 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 EnableModuleStreamOnManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableModuleStreamOnManagedInstanceGroupResponse wrapper for the EnableModuleStreamOnManagedInstanceGroup operation +type EnableModuleStreamOnManagedInstanceGroupResponse 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 EnableModuleStreamOnManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableModuleStreamOnManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/enable_module_stream_on_managed_instance_request_response.go b/osmanagementhub/enable_module_stream_on_managed_instance_request_response.go new file mode 100644 index 0000000000..d62ccd512b --- /dev/null +++ b/osmanagementhub/enable_module_stream_on_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableModuleStreamOnManagedInstanceRequest wrapper for the EnableModuleStreamOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/EnableModuleStreamOnManagedInstance.go.html to see an example of how to use EnableModuleStreamOnManagedInstanceRequest. +type EnableModuleStreamOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // The details of the module stream to be enabled on a managed instance. + EnableModuleStreamOnManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EnableModuleStreamOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableModuleStreamOnManagedInstanceRequest) 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 EnableModuleStreamOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableModuleStreamOnManagedInstanceRequest) 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 EnableModuleStreamOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableModuleStreamOnManagedInstanceResponse wrapper for the EnableModuleStreamOnManagedInstance operation +type EnableModuleStreamOnManagedInstanceResponse 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 EnableModuleStreamOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableModuleStreamOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/entitlement_collection.go b/osmanagementhub/entitlement_collection.go new file mode 100644 index 0000000000..a943cb84e8 --- /dev/null +++ b/osmanagementhub/entitlement_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EntitlementCollection Results of a Entitlement search. Contains boh EntitlementSummary items and other information, such as metadata. +type EntitlementCollection struct { + + // List of Entitlement. + Items []EntitlementSummary `mandatory:"true" json:"items"` +} + +func (m EntitlementCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EntitlementCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/entitlement_summary.go b/osmanagementhub/entitlement_summary.go new file mode 100644 index 0000000000..ea52e68ebf --- /dev/null +++ b/osmanagementhub/entitlement_summary.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EntitlementSummary A summary of an entitlement. +type EntitlementSummary struct { + + // The OCID of the tenancy containing the entitlement. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The Customer Support Identifier (CSI). CSI is a unique key given to a customer to unlock software sources. It uniquely identifies the entitlement. + Csi *string `mandatory:"true" json:"csi"` + + // The vendor for the entitlement. + VendorName *string `mandatory:"true" json:"vendorName"` +} + +func (m EntitlementSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EntitlementSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/erratum.go b/osmanagementhub/erratum.go new file mode 100644 index 0000000000..cba9bb90cf --- /dev/null +++ b/osmanagementhub/erratum.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Erratum Details about the erratum. +type Erratum struct { + + // Advisory name. + Name *string `mandatory:"true" json:"name"` + + // Summary description of the erratum. + Synopsis *string `mandatory:"false" json:"synopsis"` + + // Date the erratum was issued, as described + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeIssued *common.SDKTime `mandatory:"false" json:"timeIssued"` + + // Details describing the erratum. + Description *string `mandatory:"false" json:"description"` + + // Most recent date the erratum was updated, as described + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Type of the erratum. + ClassificationType ClassificationTypesEnum `mandatory:"false" json:"classificationType,omitempty"` + + // Information specifying from where the erratum was release. + From *string `mandatory:"false" json:"from"` + + // Information describing how the erratum can be resolved. + Solution *string `mandatory:"false" json:"solution"` + + // Information describing how to find more information about. the erratum. + References *string `mandatory:"false" json:"references"` + + // List of CVEs applicable to this erratum. + RelatedCves []string `mandatory:"false" json:"relatedCves"` + + // List of repository identifiers. + Repositories []string `mandatory:"false" json:"repositories"` + + // List of Packages affected by this erratum. + Packages []SoftwarePackageSummary `mandatory:"false" json:"packages"` + + // List of affected OS families. + OsFamilies []OsFamilyEnum `mandatory:"false" json:"osFamilies"` + + // The severity for a security advisory, otherwise, null. + AdvisorySeverity AdvisorySeverityEnum `mandatory:"false" json:"advisorySeverity,omitempty"` +} + +func (m Erratum) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Erratum) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingClassificationTypesEnum(string(m.ClassificationType)); !ok && m.ClassificationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ClassificationType: %s. Supported values are: %s.", m.ClassificationType, strings.Join(GetClassificationTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingAdvisorySeverityEnum(string(m.AdvisorySeverity)); !ok && m.AdvisorySeverity != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdvisorySeverity: %s. Supported values are: %s.", m.AdvisorySeverity, strings.Join(GetAdvisorySeverityEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/erratum_collection.go b/osmanagementhub/erratum_collection.go new file mode 100644 index 0000000000..0a73c1567e --- /dev/null +++ b/osmanagementhub/erratum_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ErratumCollection Results of a Erratum search. Contains boh ErratumSummary items and other information, such as metadata. +type ErratumCollection struct { + + // List of Errata. + Items []ErratumSummary `mandatory:"true" json:"items"` +} + +func (m ErratumCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ErratumCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/erratum_summary.go b/osmanagementhub/erratum_summary.go new file mode 100644 index 0000000000..67e95aaa76 --- /dev/null +++ b/osmanagementhub/erratum_summary.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ErratumSummary Important changes for software. This can include security advisories, bug fixes, or enhancements. +type ErratumSummary struct { + + // Advisory name. + Name *string `mandatory:"true" json:"name"` + + // Summary description of the erratum. + Synopsis *string `mandatory:"false" json:"synopsis"` + + // Date the erratum was issued, as described + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeIssued *common.SDKTime `mandatory:"false" json:"timeIssued"` + + // Most recent date the erratum was updated, as described + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Type of the erratum. + ClassificationType ClassificationTypesEnum `mandatory:"false" json:"classificationType,omitempty"` + + // List of CVEs applicable to this erratum. + RelatedCves []string `mandatory:"false" json:"relatedCves"` + + // List of affected OS families. + OsFamilies []OsFamilyEnum `mandatory:"false" json:"osFamilies"` + + // The severity advisory. Only valid for security type advisories. + AdvisorySeverity AdvisorySeverityEnum `mandatory:"false" json:"advisorySeverity,omitempty"` +} + +func (m ErratumSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ErratumSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingClassificationTypesEnum(string(m.ClassificationType)); !ok && m.ClassificationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ClassificationType: %s. Supported values are: %s.", m.ClassificationType, strings.Join(GetClassificationTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingAdvisorySeverityEnum(string(m.AdvisorySeverity)); !ok && m.AdvisorySeverity != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdvisorySeverity: %s. Supported values are: %s.", m.AdvisorySeverity, strings.Join(GetAdvisorySeverityEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/filter_type.go b/osmanagementhub/filter_type.go new file mode 100644 index 0000000000..063f77d531 --- /dev/null +++ b/osmanagementhub/filter_type.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// FilterTypeEnum Enum with underlying type: string +type FilterTypeEnum string + +// Set of constants representing the allowable values for FilterTypeEnum +const ( + FilterTypeInclude FilterTypeEnum = "INCLUDE" + FilterTypeExclude FilterTypeEnum = "EXCLUDE" +) + +var mappingFilterTypeEnum = map[string]FilterTypeEnum{ + "INCLUDE": FilterTypeInclude, + "EXCLUDE": FilterTypeExclude, +} + +var mappingFilterTypeEnumLowerCase = map[string]FilterTypeEnum{ + "include": FilterTypeInclude, + "exclude": FilterTypeExclude, +} + +// GetFilterTypeEnumValues Enumerates the set of values for FilterTypeEnum +func GetFilterTypeEnumValues() []FilterTypeEnum { + values := make([]FilterTypeEnum, 0) + for _, v := range mappingFilterTypeEnum { + values = append(values, v) + } + return values +} + +// GetFilterTypeEnumStringValues Enumerates the set of values in String for FilterTypeEnum +func GetFilterTypeEnumStringValues() []string { + return []string{ + "INCLUDE", + "EXCLUDE", + } +} + +// GetMappingFilterTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingFilterTypeEnum(val string) (FilterTypeEnum, bool) { + enum, ok := mappingFilterTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/get_erratum_request_response.go b/osmanagementhub/get_erratum_request_response.go new file mode 100644 index 0000000000..4b7bb75878 --- /dev/null +++ b/osmanagementhub/get_erratum_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetErratumRequest wrapper for the GetErratum operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetErratum.go.html to see an example of how to use GetErratumRequest. +type GetErratumRequest struct { + + // The OCID of the compartment that contains the resources to list. This parameter is required. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The erratum name (e.g. ELSA-2023-34678). + Name *string `mandatory:"true" contributesTo:"path" name:"name"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetErratumRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetErratumRequest) 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 GetErratumRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetErratumRequest) 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 GetErratumRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetErratumResponse wrapper for the GetErratum operation +type GetErratumResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Erratum instance + Erratum `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 GetErratumResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetErratumResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_lifecycle_environment_request_response.go b/osmanagementhub/get_lifecycle_environment_request_response.go new file mode 100644 index 0000000000..525b352251 --- /dev/null +++ b/osmanagementhub/get_lifecycle_environment_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetLifecycleEnvironmentRequest wrapper for the GetLifecycleEnvironment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetLifecycleEnvironment.go.html to see an example of how to use GetLifecycleEnvironmentRequest. +type GetLifecycleEnvironmentRequest struct { + + // The OCID of the lifecycle environment. + LifecycleEnvironmentId *string `mandatory:"true" contributesTo:"path" name:"lifecycleEnvironmentId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetLifecycleEnvironmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetLifecycleEnvironmentRequest) 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 GetLifecycleEnvironmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetLifecycleEnvironmentRequest) 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 GetLifecycleEnvironmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetLifecycleEnvironmentResponse wrapper for the GetLifecycleEnvironment operation +type GetLifecycleEnvironmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The LifecycleEnvironment instance + LifecycleEnvironment `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 GetLifecycleEnvironmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetLifecycleEnvironmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_lifecycle_stage_request_response.go b/osmanagementhub/get_lifecycle_stage_request_response.go new file mode 100644 index 0000000000..9919fc92ba --- /dev/null +++ b/osmanagementhub/get_lifecycle_stage_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetLifecycleStageRequest wrapper for the GetLifecycleStage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetLifecycleStage.go.html to see an example of how to use GetLifecycleStageRequest. +type GetLifecycleStageRequest struct { + + // The OCID of the lifecycle stage. + LifecycleStageId *string `mandatory:"true" contributesTo:"path" name:"lifecycleStageId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetLifecycleStageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetLifecycleStageRequest) 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 GetLifecycleStageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetLifecycleStageRequest) 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 GetLifecycleStageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetLifecycleStageResponse wrapper for the GetLifecycleStage operation +type GetLifecycleStageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The LifecycleStage instance + LifecycleStage `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 GetLifecycleStageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetLifecycleStageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_managed_instance_analytic_content_request_response.go b/osmanagementhub/get_managed_instance_analytic_content_request_response.go new file mode 100644 index 0000000000..e052877898 --- /dev/null +++ b/osmanagementhub/get_managed_instance_analytic_content_request_response.go @@ -0,0 +1,187 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// GetManagedInstanceAnalyticContentRequest wrapper for the GetManagedInstanceAnalyticContent operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstanceAnalyticContent.go.html to see an example of how to use GetManagedInstanceAnalyticContentRequest. +type GetManagedInstanceAnalyticContentRequest struct { + + // This compartmentId is used to list managed instances within a compartment. + // Or serve as an additional filter to restrict only managed instances with in certain compartment if other filter presents. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID of the managed instance group for which to list resources. + ManagedInstanceGroupId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceGroupId"` + + // The OCID of the lifecycle environment. + LifecycleEnvironmentId *string `mandatory:"false" contributesTo:"query" name:"lifecycleEnvironmentId"` + + // The OCID of the lifecycle stage for which to list resources. + LifecycleStageId *string `mandatory:"false" contributesTo:"query" name:"lifecycleStageId"` + + // A filter to return only instances whose managed instance status matches the given status. + Status []ManagedInstanceStatusEnum `contributesTo:"query" name:"status" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // Filter instances by Location. Used when report target type is compartment or group. + InstanceLocation GetManagedInstanceAnalyticContentInstanceLocationEnum `mandatory:"false" contributesTo:"query" name:"instanceLocation" omitEmpty:"true"` + + // A filter to return instances with number of available security updates equals to the number specified. + SecurityUpdatesAvailableEqualsTo *int `mandatory:"false" contributesTo:"query" name:"securityUpdatesAvailableEqualsTo"` + + // A filter to return instances with number of available bug updates equals to the number specified. + BugUpdatesAvailableEqualsTo *int `mandatory:"false" contributesTo:"query" name:"bugUpdatesAvailableEqualsTo"` + + // A filter to return instances with number of available security updates greater than the number specified. + SecurityUpdatesAvailableGreaterThan *int `mandatory:"false" contributesTo:"query" name:"securityUpdatesAvailableGreaterThan"` + + // A filter to return instances with number of available bug updates greater than the number specified. + BugUpdatesAvailableGreaterThan *int `mandatory:"false" contributesTo:"query" name:"bugUpdatesAvailableGreaterThan"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetManagedInstanceAnalyticContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetManagedInstanceAnalyticContentRequest) 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 GetManagedInstanceAnalyticContentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetManagedInstanceAnalyticContentRequest) 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 GetManagedInstanceAnalyticContentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.Status { + if _, ok := GetMappingManagedInstanceStatusEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", val, strings.Join(GetManagedInstanceStatusEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingGetManagedInstanceAnalyticContentInstanceLocationEnum(string(request.InstanceLocation)); !ok && request.InstanceLocation != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for InstanceLocation: %s. Supported values are: %s.", request.InstanceLocation, strings.Join(GetGetManagedInstanceAnalyticContentInstanceLocationEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetManagedInstanceAnalyticContentResponse wrapper for the GetManagedInstanceAnalyticContent operation +type GetManagedInstanceAnalyticContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // 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 GetManagedInstanceAnalyticContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetManagedInstanceAnalyticContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetManagedInstanceAnalyticContentInstanceLocationEnum Enum with underlying type: string +type GetManagedInstanceAnalyticContentInstanceLocationEnum string + +// Set of constants representing the allowable values for GetManagedInstanceAnalyticContentInstanceLocationEnum +const ( + GetManagedInstanceAnalyticContentInstanceLocationOnPremise GetManagedInstanceAnalyticContentInstanceLocationEnum = "ON_PREMISE" + GetManagedInstanceAnalyticContentInstanceLocationOciCompute GetManagedInstanceAnalyticContentInstanceLocationEnum = "OCI_COMPUTE" + GetManagedInstanceAnalyticContentInstanceLocationAzure GetManagedInstanceAnalyticContentInstanceLocationEnum = "AZURE" + GetManagedInstanceAnalyticContentInstanceLocationEc2 GetManagedInstanceAnalyticContentInstanceLocationEnum = "EC2" +) + +var mappingGetManagedInstanceAnalyticContentInstanceLocationEnum = map[string]GetManagedInstanceAnalyticContentInstanceLocationEnum{ + "ON_PREMISE": GetManagedInstanceAnalyticContentInstanceLocationOnPremise, + "OCI_COMPUTE": GetManagedInstanceAnalyticContentInstanceLocationOciCompute, + "AZURE": GetManagedInstanceAnalyticContentInstanceLocationAzure, + "EC2": GetManagedInstanceAnalyticContentInstanceLocationEc2, +} + +var mappingGetManagedInstanceAnalyticContentInstanceLocationEnumLowerCase = map[string]GetManagedInstanceAnalyticContentInstanceLocationEnum{ + "on_premise": GetManagedInstanceAnalyticContentInstanceLocationOnPremise, + "oci_compute": GetManagedInstanceAnalyticContentInstanceLocationOciCompute, + "azure": GetManagedInstanceAnalyticContentInstanceLocationAzure, + "ec2": GetManagedInstanceAnalyticContentInstanceLocationEc2, +} + +// GetGetManagedInstanceAnalyticContentInstanceLocationEnumValues Enumerates the set of values for GetManagedInstanceAnalyticContentInstanceLocationEnum +func GetGetManagedInstanceAnalyticContentInstanceLocationEnumValues() []GetManagedInstanceAnalyticContentInstanceLocationEnum { + values := make([]GetManagedInstanceAnalyticContentInstanceLocationEnum, 0) + for _, v := range mappingGetManagedInstanceAnalyticContentInstanceLocationEnum { + values = append(values, v) + } + return values +} + +// GetGetManagedInstanceAnalyticContentInstanceLocationEnumStringValues Enumerates the set of values in String for GetManagedInstanceAnalyticContentInstanceLocationEnum +func GetGetManagedInstanceAnalyticContentInstanceLocationEnumStringValues() []string { + return []string{ + "ON_PREMISE", + "OCI_COMPUTE", + "AZURE", + "EC2", + } +} + +// GetMappingGetManagedInstanceAnalyticContentInstanceLocationEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetManagedInstanceAnalyticContentInstanceLocationEnum(val string) (GetManagedInstanceAnalyticContentInstanceLocationEnum, bool) { + enum, ok := mappingGetManagedInstanceAnalyticContentInstanceLocationEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/get_managed_instance_content_request_response.go b/osmanagementhub/get_managed_instance_content_request_response.go new file mode 100644 index 0000000000..143dd44b5e --- /dev/null +++ b/osmanagementhub/get_managed_instance_content_request_response.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// GetManagedInstanceContentRequest wrapper for the GetManagedInstanceContent operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstanceContent.go.html to see an example of how to use GetManagedInstanceContentRequest. +type GetManagedInstanceContentRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // The assigned erratum name. It's unique and not changeable. + // Example: `ELSA-2020-5804` + AdvisoryName []string `contributesTo:"query" name:"advisoryName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the erratum advisory name given. + AdvisoryNameContains *string `mandatory:"false" contributesTo:"query" name:"advisoryNameContains"` + + // A filter to return only errata that match the given advisory types. + AdvisoryType []GetManagedInstanceContentAdvisoryTypeEnum `contributesTo:"query" name:"advisoryType" omitEmpty:"true" collectionFormat:"multi"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetManagedInstanceContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetManagedInstanceContentRequest) 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 GetManagedInstanceContentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetManagedInstanceContentRequest) 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 GetManagedInstanceContentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.AdvisoryType { + if _, ok := GetMappingGetManagedInstanceContentAdvisoryTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdvisoryType: %s. Supported values are: %s.", val, strings.Join(GetGetManagedInstanceContentAdvisoryTypeEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetManagedInstanceContentResponse wrapper for the GetManagedInstanceContent operation +type GetManagedInstanceContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // 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 GetManagedInstanceContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetManagedInstanceContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetManagedInstanceContentAdvisoryTypeEnum Enum with underlying type: string +type GetManagedInstanceContentAdvisoryTypeEnum string + +// Set of constants representing the allowable values for GetManagedInstanceContentAdvisoryTypeEnum +const ( + GetManagedInstanceContentAdvisoryTypeSecurity GetManagedInstanceContentAdvisoryTypeEnum = "SECURITY" + GetManagedInstanceContentAdvisoryTypeBugfix GetManagedInstanceContentAdvisoryTypeEnum = "BUGFIX" + GetManagedInstanceContentAdvisoryTypeEnhancement GetManagedInstanceContentAdvisoryTypeEnum = "ENHANCEMENT" +) + +var mappingGetManagedInstanceContentAdvisoryTypeEnum = map[string]GetManagedInstanceContentAdvisoryTypeEnum{ + "SECURITY": GetManagedInstanceContentAdvisoryTypeSecurity, + "BUGFIX": GetManagedInstanceContentAdvisoryTypeBugfix, + "ENHANCEMENT": GetManagedInstanceContentAdvisoryTypeEnhancement, +} + +var mappingGetManagedInstanceContentAdvisoryTypeEnumLowerCase = map[string]GetManagedInstanceContentAdvisoryTypeEnum{ + "security": GetManagedInstanceContentAdvisoryTypeSecurity, + "bugfix": GetManagedInstanceContentAdvisoryTypeBugfix, + "enhancement": GetManagedInstanceContentAdvisoryTypeEnhancement, +} + +// GetGetManagedInstanceContentAdvisoryTypeEnumValues Enumerates the set of values for GetManagedInstanceContentAdvisoryTypeEnum +func GetGetManagedInstanceContentAdvisoryTypeEnumValues() []GetManagedInstanceContentAdvisoryTypeEnum { + values := make([]GetManagedInstanceContentAdvisoryTypeEnum, 0) + for _, v := range mappingGetManagedInstanceContentAdvisoryTypeEnum { + values = append(values, v) + } + return values +} + +// GetGetManagedInstanceContentAdvisoryTypeEnumStringValues Enumerates the set of values in String for GetManagedInstanceContentAdvisoryTypeEnum +func GetGetManagedInstanceContentAdvisoryTypeEnumStringValues() []string { + return []string{ + "SECURITY", + "BUGFIX", + "ENHANCEMENT", + } +} + +// GetMappingGetManagedInstanceContentAdvisoryTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetManagedInstanceContentAdvisoryTypeEnum(val string) (GetManagedInstanceContentAdvisoryTypeEnum, bool) { + enum, ok := mappingGetManagedInstanceContentAdvisoryTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/get_managed_instance_group_request_response.go b/osmanagementhub/get_managed_instance_group_request_response.go new file mode 100644 index 0000000000..b8a60a4806 --- /dev/null +++ b/osmanagementhub/get_managed_instance_group_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetManagedInstanceGroupRequest wrapper for the GetManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstanceGroup.go.html to see an example of how to use GetManagedInstanceGroupRequest. +type GetManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetManagedInstanceGroupRequest) 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 GetManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetManagedInstanceGroupRequest) 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 GetManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetManagedInstanceGroupResponse wrapper for the GetManagedInstanceGroup operation +type GetManagedInstanceGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagedInstanceGroup instance + ManagedInstanceGroup `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 GetManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_managed_instance_request_response.go b/osmanagementhub/get_managed_instance_request_response.go new file mode 100644 index 0000000000..20c505a7c7 --- /dev/null +++ b/osmanagementhub/get_managed_instance_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetManagedInstanceRequest wrapper for the GetManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstance.go.html to see an example of how to use GetManagedInstanceRequest. +type GetManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetManagedInstanceRequest) 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 GetManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetManagedInstanceRequest) 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 GetManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetManagedInstanceResponse wrapper for the GetManagedInstance operation +type GetManagedInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagedInstance instance + ManagedInstance `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_management_station_request_response.go b/osmanagementhub/get_management_station_request_response.go new file mode 100644 index 0000000000..7353b8b284 --- /dev/null +++ b/osmanagementhub/get_management_station_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetManagementStationRequest wrapper for the GetManagementStation operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagementStation.go.html to see an example of how to use GetManagementStationRequest. +type GetManagementStationRequest struct { + + // The OCID of the management station. + ManagementStationId *string `mandatory:"true" contributesTo:"path" name:"managementStationId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetManagementStationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetManagementStationRequest) 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 GetManagementStationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetManagementStationRequest) 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 GetManagementStationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetManagementStationResponse wrapper for the GetManagementStation operation +type GetManagementStationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagementStation instance + ManagementStation `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetManagementStationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetManagementStationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_module_stream_profile_request_response.go b/osmanagementhub/get_module_stream_profile_request_response.go new file mode 100644 index 0000000000..b8bafb16aa --- /dev/null +++ b/osmanagementhub/get_module_stream_profile_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetModuleStreamProfileRequest wrapper for the GetModuleStreamProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetModuleStreamProfile.go.html to see an example of how to use GetModuleStreamProfileRequest. +type GetModuleStreamProfileRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The name of the profile of the containing module stream. + ProfileName *string `mandatory:"true" contributesTo:"path" name:"profileName"` + + // The name of a module. + ModuleName *string `mandatory:"true" contributesTo:"query" name:"moduleName"` + + // The name of the stream of the containing module. + StreamName *string `mandatory:"true" contributesTo:"query" name:"streamName"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetModuleStreamProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetModuleStreamProfileRequest) 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 GetModuleStreamProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetModuleStreamProfileRequest) 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 GetModuleStreamProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetModuleStreamProfileResponse wrapper for the GetModuleStreamProfile operation +type GetModuleStreamProfileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModuleStreamProfile instance + ModuleStreamProfile `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 GetModuleStreamProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetModuleStreamProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_module_stream_request_response.go b/osmanagementhub/get_module_stream_request_response.go new file mode 100644 index 0000000000..91e53ab90c --- /dev/null +++ b/osmanagementhub/get_module_stream_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetModuleStreamRequest wrapper for the GetModuleStream operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetModuleStream.go.html to see an example of how to use GetModuleStreamRequest. +type GetModuleStreamRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The name of the module. + ModuleName *string `mandatory:"true" contributesTo:"path" name:"moduleName"` + + // The name of the stream of the containing module. + StreamName *string `mandatory:"true" contributesTo:"query" name:"streamName"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetModuleStreamRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetModuleStreamRequest) 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 GetModuleStreamRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetModuleStreamRequest) 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 GetModuleStreamRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetModuleStreamResponse wrapper for the GetModuleStream operation +type GetModuleStreamResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModuleStream instance + ModuleStream `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 GetModuleStreamResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetModuleStreamResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_package_group_request_response.go b/osmanagementhub/get_package_group_request_response.go new file mode 100644 index 0000000000..4926983c39 --- /dev/null +++ b/osmanagementhub/get_package_group_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetPackageGroupRequest wrapper for the GetPackageGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetPackageGroup.go.html to see an example of how to use GetPackageGroupRequest. +type GetPackageGroupRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The unique package group identifier. + PackageGroupId *string `mandatory:"true" contributesTo:"path" name:"packageGroupId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetPackageGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPackageGroupRequest) 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 GetPackageGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPackageGroupRequest) 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 GetPackageGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetPackageGroupResponse wrapper for the GetPackageGroup operation +type GetPackageGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PackageGroup instance + PackageGroup `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 GetPackageGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPackageGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_profile_request_response.go b/osmanagementhub/get_profile_request_response.go new file mode 100644 index 0000000000..481209d51f --- /dev/null +++ b/osmanagementhub/get_profile_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetProfileRequest wrapper for the GetProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetProfile.go.html to see an example of how to use GetProfileRequest. +type GetProfileRequest struct { + + // The OCID of the registration profile. + ProfileId *string `mandatory:"true" contributesTo:"path" name:"profileId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetProfileRequest) 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 GetProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetProfileRequest) 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 GetProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetProfileResponse wrapper for the GetProfile operation +type GetProfileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Profile instance + Profile `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 GetProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_scheduled_job_request_response.go b/osmanagementhub/get_scheduled_job_request_response.go new file mode 100644 index 0000000000..6ae93e574a --- /dev/null +++ b/osmanagementhub/get_scheduled_job_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetScheduledJobRequest wrapper for the GetScheduledJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetScheduledJob.go.html to see an example of how to use GetScheduledJobRequest. +type GetScheduledJobRequest struct { + + // The OCID of the scheduled job. + ScheduledJobId *string `mandatory:"true" contributesTo:"path" name:"scheduledJobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetScheduledJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetScheduledJobRequest) 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 GetScheduledJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetScheduledJobRequest) 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 GetScheduledJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetScheduledJobResponse wrapper for the GetScheduledJob operation +type GetScheduledJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ScheduledJob instance + ScheduledJob `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetScheduledJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetScheduledJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_software_package_request_response.go b/osmanagementhub/get_software_package_request_response.go new file mode 100644 index 0000000000..9144c5de6e --- /dev/null +++ b/osmanagementhub/get_software_package_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSoftwarePackageRequest wrapper for the GetSoftwarePackage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetSoftwarePackage.go.html to see an example of how to use GetSoftwarePackageRequest. +type GetSoftwarePackageRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The name of the software package. + SoftwarePackageName *string `mandatory:"true" contributesTo:"path" name:"softwarePackageName"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSoftwarePackageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSoftwarePackageRequest) 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 GetSoftwarePackageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSoftwarePackageRequest) 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 GetSoftwarePackageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSoftwarePackageResponse wrapper for the GetSoftwarePackage operation +type GetSoftwarePackageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SoftwarePackage instance + SoftwarePackage `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 GetSoftwarePackageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSoftwarePackageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_software_source_request_response.go b/osmanagementhub/get_software_source_request_response.go new file mode 100644 index 0000000000..3b0a17dc5d --- /dev/null +++ b/osmanagementhub/get_software_source_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSoftwareSourceRequest wrapper for the GetSoftwareSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetSoftwareSource.go.html to see an example of how to use GetSoftwareSourceRequest. +type GetSoftwareSourceRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSoftwareSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSoftwareSourceRequest) 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 GetSoftwareSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSoftwareSourceRequest) 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 GetSoftwareSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSoftwareSourceResponse wrapper for the GetSoftwareSource operation +type GetSoftwareSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SoftwareSource instance + SoftwareSource `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetSoftwareSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSoftwareSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/get_work_request_request_response.go b/osmanagementhub/get_work_request_request_response.go new file mode 100644 index 0000000000..439633be65 --- /dev/null +++ b/osmanagementhub/get_work_request_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +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/osmanagementhub/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/group_profile.go b/osmanagementhub/group_profile.go new file mode 100644 index 0000000000..10846ae278 --- /dev/null +++ b/osmanagementhub/group_profile.go @@ -0,0 +1,175 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GroupProfile Definition of a registration profile of type GROUP. +type GroupProfile struct { + + // The OCID of the profile that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + ManagedInstanceGroup *ManagedInstanceGroupDetails `mandatory:"true" json:"managedInstanceGroup"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // The time the the registration profile was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The operating system family. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The current state of the registration profile. + LifecycleState ProfileLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m GroupProfile) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m GroupProfile) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m GroupProfile) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m GroupProfile) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m GroupProfile) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetVendorName returns VendorName +func (m GroupProfile) GetVendorName() VendorNameEnum { + return m.VendorName +} + +//GetOsFamily returns OsFamily +func (m GroupProfile) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m GroupProfile) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetTimeCreated returns TimeCreated +func (m GroupProfile) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m GroupProfile) GetLifecycleState() ProfileLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m GroupProfile) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m GroupProfile) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m GroupProfile) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m GroupProfile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m GroupProfile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingProfileLifecycleStateEnum(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(GetProfileLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GroupProfile) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGroupProfile GroupProfile + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeGroupProfile + }{ + "GROUP", + (MarshalTypeGroupProfile)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/id.go b/osmanagementhub/id.go new file mode 100644 index 0000000000..8bee307498 --- /dev/null +++ b/osmanagementhub/id.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Id An id along with a name to simplify display for a user. +type Id struct { + + // The OCID of the resource that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // User friendly name. + DisplayName *string `mandatory:"true" json:"displayName"` +} + +func (m Id) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Id) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/install_module_stream_profile_on_managed_instance_details.go b/osmanagementhub/install_module_stream_profile_on_managed_instance_details.go new file mode 100644 index 0000000000..6a2e8a7c6b --- /dev/null +++ b/osmanagementhub/install_module_stream_profile_on_managed_instance_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InstallModuleStreamProfileOnManagedInstanceDetails The details of the module stream profile to be installed on a managed instance. +type InstallModuleStreamProfileOnManagedInstanceDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + // The name of a profile of the specified module stream. + ProfileName *string `mandatory:"false" json:"profileName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m InstallModuleStreamProfileOnManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InstallModuleStreamProfileOnManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/install_module_stream_profile_on_managed_instance_group_details.go b/osmanagementhub/install_module_stream_profile_on_managed_instance_group_details.go new file mode 100644 index 0000000000..835b185a2a --- /dev/null +++ b/osmanagementhub/install_module_stream_profile_on_managed_instance_group_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InstallModuleStreamProfileOnManagedInstanceGroupDetails The work request details for the module stream profile operation on the managed instance group. +type InstallModuleStreamProfileOnManagedInstanceGroupDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"false" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + // The name of a profile of the specified module stream. + ProfileName *string `mandatory:"false" json:"profileName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m InstallModuleStreamProfileOnManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InstallModuleStreamProfileOnManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/install_module_stream_profile_on_managed_instance_group_request_response.go b/osmanagementhub/install_module_stream_profile_on_managed_instance_group_request_response.go new file mode 100644 index 0000000000..a87330f0ca --- /dev/null +++ b/osmanagementhub/install_module_stream_profile_on_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// InstallModuleStreamProfileOnManagedInstanceGroupRequest wrapper for the InstallModuleStreamProfileOnManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallModuleStreamProfileOnManagedInstanceGroup.go.html to see an example of how to use InstallModuleStreamProfileOnManagedInstanceGroupRequest. +type InstallModuleStreamProfileOnManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for profiles to install on the managed instance group. + InstallModuleStreamProfileOnManagedInstanceGroupDetails `contributesTo:"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 `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 InstallModuleStreamProfileOnManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request InstallModuleStreamProfileOnManagedInstanceGroupRequest) 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 InstallModuleStreamProfileOnManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request InstallModuleStreamProfileOnManagedInstanceGroupRequest) 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 InstallModuleStreamProfileOnManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// InstallModuleStreamProfileOnManagedInstanceGroupResponse wrapper for the InstallModuleStreamProfileOnManagedInstanceGroup operation +type InstallModuleStreamProfileOnManagedInstanceGroupResponse 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 InstallModuleStreamProfileOnManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response InstallModuleStreamProfileOnManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/install_module_stream_profile_on_managed_instance_request_response.go b/osmanagementhub/install_module_stream_profile_on_managed_instance_request_response.go new file mode 100644 index 0000000000..c1b801b72a --- /dev/null +++ b/osmanagementhub/install_module_stream_profile_on_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// InstallModuleStreamProfileOnManagedInstanceRequest wrapper for the InstallModuleStreamProfileOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallModuleStreamProfileOnManagedInstance.go.html to see an example of how to use InstallModuleStreamProfileOnManagedInstanceRequest. +type InstallModuleStreamProfileOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // The details of the module stream profile to be installed on a managed instance. + InstallModuleStreamProfileOnManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request InstallModuleStreamProfileOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request InstallModuleStreamProfileOnManagedInstanceRequest) 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 InstallModuleStreamProfileOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request InstallModuleStreamProfileOnManagedInstanceRequest) 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 InstallModuleStreamProfileOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// InstallModuleStreamProfileOnManagedInstanceResponse wrapper for the InstallModuleStreamProfileOnManagedInstance operation +type InstallModuleStreamProfileOnManagedInstanceResponse 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 InstallModuleStreamProfileOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response InstallModuleStreamProfileOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/install_packages_on_managed_instance_details.go b/osmanagementhub/install_packages_on_managed_instance_details.go new file mode 100644 index 0000000000..956b84957f --- /dev/null +++ b/osmanagementhub/install_packages_on_managed_instance_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InstallPackagesOnManagedInstanceDetails The details about the software packages to be installed. +type InstallPackagesOnManagedInstanceDetails struct { + + // The list of package names. + PackageNames []string `mandatory:"true" json:"packageNames"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m InstallPackagesOnManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InstallPackagesOnManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/install_packages_on_managed_instance_group_details.go b/osmanagementhub/install_packages_on_managed_instance_group_details.go new file mode 100644 index 0000000000..295835e564 --- /dev/null +++ b/osmanagementhub/install_packages_on_managed_instance_group_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InstallPackagesOnManagedInstanceGroupDetails The names of the packages to be installed on the managed instance group. +type InstallPackagesOnManagedInstanceGroupDetails struct { + + // The list of package names. + PackageNames []string `mandatory:"false" json:"packageNames"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m InstallPackagesOnManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InstallPackagesOnManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/install_packages_on_managed_instance_group_request_response.go b/osmanagementhub/install_packages_on_managed_instance_group_request_response.go new file mode 100644 index 0000000000..99868447af --- /dev/null +++ b/osmanagementhub/install_packages_on_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// InstallPackagesOnManagedInstanceGroupRequest wrapper for the InstallPackagesOnManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallPackagesOnManagedInstanceGroup.go.html to see an example of how to use InstallPackagesOnManagedInstanceGroupRequest. +type InstallPackagesOnManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for packages to install on the specified managed instance group. + InstallPackagesOnManagedInstanceGroupDetails `contributesTo:"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 `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 InstallPackagesOnManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request InstallPackagesOnManagedInstanceGroupRequest) 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 InstallPackagesOnManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request InstallPackagesOnManagedInstanceGroupRequest) 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 InstallPackagesOnManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// InstallPackagesOnManagedInstanceGroupResponse wrapper for the InstallPackagesOnManagedInstanceGroup operation +type InstallPackagesOnManagedInstanceGroupResponse 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 InstallPackagesOnManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response InstallPackagesOnManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/install_packages_on_managed_instance_request_response.go b/osmanagementhub/install_packages_on_managed_instance_request_response.go new file mode 100644 index 0000000000..6975ddf49a --- /dev/null +++ b/osmanagementhub/install_packages_on_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// InstallPackagesOnManagedInstanceRequest wrapper for the InstallPackagesOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallPackagesOnManagedInstance.go.html to see an example of how to use InstallPackagesOnManagedInstanceRequest. +type InstallPackagesOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // Details about packages to be installed on a managed instance. + InstallPackagesOnManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request InstallPackagesOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request InstallPackagesOnManagedInstanceRequest) 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 InstallPackagesOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request InstallPackagesOnManagedInstanceRequest) 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 InstallPackagesOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// InstallPackagesOnManagedInstanceResponse wrapper for the InstallPackagesOnManagedInstance operation +type InstallPackagesOnManagedInstanceResponse 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 InstallPackagesOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response InstallPackagesOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/installed_package_collection.go b/osmanagementhub/installed_package_collection.go new file mode 100644 index 0000000000..b65d6e9761 --- /dev/null +++ b/osmanagementhub/installed_package_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InstalledPackageCollection Results of an installed package search on a managed instance. +type InstalledPackageCollection struct { + + // List of installed packages. + Items []InstalledPackageSummary `mandatory:"true" json:"items"` +} + +func (m InstalledPackageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InstalledPackageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/installed_package_summary.go b/osmanagementhub/installed_package_summary.go new file mode 100644 index 0000000000..7a3cb4ae3e --- /dev/null +++ b/osmanagementhub/installed_package_summary.go @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InstalledPackageSummary A software package installed on a managed instance. +type InstalledPackageSummary struct { + + // Package name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Unique identifier for the package. + Name *string `mandatory:"true" json:"name"` + + // Type of the package. + Type *string `mandatory:"true" json:"type"` + + // Version of the installed package. + Version *string `mandatory:"true" json:"version"` + + // The date and time the package was installed, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeInstalled *common.SDKTime `mandatory:"true" json:"timeInstalled"` + + // list of software sources that provide the software package. + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` + + // The date and time the package was issued by a providing erratum (if available), as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeIssued *common.SDKTime `mandatory:"false" json:"timeIssued"` + + // The architecture for which this package was built. + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` +} + +//GetDisplayName returns DisplayName +func (m InstalledPackageSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetName returns Name +func (m InstalledPackageSummary) GetName() *string { + return m.Name +} + +//GetType returns Type +func (m InstalledPackageSummary) GetType() *string { + return m.Type +} + +//GetVersion returns Version +func (m InstalledPackageSummary) GetVersion() *string { + return m.Version +} + +//GetArchitecture returns Architecture +func (m InstalledPackageSummary) GetArchitecture() ArchTypeEnum { + return m.Architecture +} + +//GetSoftwareSources returns SoftwareSources +func (m InstalledPackageSummary) GetSoftwareSources() []SoftwareSourceDetails { + return m.SoftwareSources +} + +func (m InstalledPackageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InstalledPackageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m InstalledPackageSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstalledPackageSummary InstalledPackageSummary + s := struct { + DiscriminatorParam string `json:"packageClassification"` + MarshalTypeInstalledPackageSummary + }{ + "INSTALLED", + (MarshalTypeInstalledPackageSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/lifecycle_environment.go b/osmanagementhub/lifecycle_environment.go new file mode 100644 index 0000000000..b9a4dc09e7 --- /dev/null +++ b/osmanagementhub/lifecycle_environment.go @@ -0,0 +1,157 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleEnvironment Contains versioned software source content and lifecycle stages for a managed instance. +type LifecycleEnvironment struct { + + // The OCID of the resource that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the lifecycle environment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // User specified list of lifecycle stages to be created for the lifecycle environment. + Stages []LifecycleStage `mandatory:"true" json:"stages"` + + // The current state of the lifecycle environment. + LifecycleState LifecycleEnvironmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The operating system type of the target instances. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The CPU architecture of the target instances. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The time the lifecycle environment was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // User specified information about the lifecycle environment. + Description *string `mandatory:"false" json:"description"` + + // The list of managed instance OCIDs specified in the lifecycle stage. + ManagedInstanceIds []ManagedInstanceDetails `mandatory:"false" json:"managedInstanceIds"` + + // The time the lifecycle environment was last modified. An RFC3339 formatted datetime string. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m LifecycleEnvironment) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleEnvironment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingLifecycleEnvironmentLifecycleStateEnum(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(GetLifecycleEnvironmentLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// LifecycleEnvironmentLifecycleStateEnum Enum with underlying type: string +type LifecycleEnvironmentLifecycleStateEnum string + +// Set of constants representing the allowable values for LifecycleEnvironmentLifecycleStateEnum +const ( + LifecycleEnvironmentLifecycleStateCreating LifecycleEnvironmentLifecycleStateEnum = "CREATING" + LifecycleEnvironmentLifecycleStateUpdating LifecycleEnvironmentLifecycleStateEnum = "UPDATING" + LifecycleEnvironmentLifecycleStateActive LifecycleEnvironmentLifecycleStateEnum = "ACTIVE" + LifecycleEnvironmentLifecycleStateDeleting LifecycleEnvironmentLifecycleStateEnum = "DELETING" + LifecycleEnvironmentLifecycleStateDeleted LifecycleEnvironmentLifecycleStateEnum = "DELETED" + LifecycleEnvironmentLifecycleStateFailed LifecycleEnvironmentLifecycleStateEnum = "FAILED" +) + +var mappingLifecycleEnvironmentLifecycleStateEnum = map[string]LifecycleEnvironmentLifecycleStateEnum{ + "CREATING": LifecycleEnvironmentLifecycleStateCreating, + "UPDATING": LifecycleEnvironmentLifecycleStateUpdating, + "ACTIVE": LifecycleEnvironmentLifecycleStateActive, + "DELETING": LifecycleEnvironmentLifecycleStateDeleting, + "DELETED": LifecycleEnvironmentLifecycleStateDeleted, + "FAILED": LifecycleEnvironmentLifecycleStateFailed, +} + +var mappingLifecycleEnvironmentLifecycleStateEnumLowerCase = map[string]LifecycleEnvironmentLifecycleStateEnum{ + "creating": LifecycleEnvironmentLifecycleStateCreating, + "updating": LifecycleEnvironmentLifecycleStateUpdating, + "active": LifecycleEnvironmentLifecycleStateActive, + "deleting": LifecycleEnvironmentLifecycleStateDeleting, + "deleted": LifecycleEnvironmentLifecycleStateDeleted, + "failed": LifecycleEnvironmentLifecycleStateFailed, +} + +// GetLifecycleEnvironmentLifecycleStateEnumValues Enumerates the set of values for LifecycleEnvironmentLifecycleStateEnum +func GetLifecycleEnvironmentLifecycleStateEnumValues() []LifecycleEnvironmentLifecycleStateEnum { + values := make([]LifecycleEnvironmentLifecycleStateEnum, 0) + for _, v := range mappingLifecycleEnvironmentLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetLifecycleEnvironmentLifecycleStateEnumStringValues Enumerates the set of values in String for LifecycleEnvironmentLifecycleStateEnum +func GetLifecycleEnvironmentLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingLifecycleEnvironmentLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingLifecycleEnvironmentLifecycleStateEnum(val string) (LifecycleEnvironmentLifecycleStateEnum, bool) { + enum, ok := mappingLifecycleEnvironmentLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/lifecycle_environment_collection.go b/osmanagementhub/lifecycle_environment_collection.go new file mode 100644 index 0000000000..3c1510bbca --- /dev/null +++ b/osmanagementhub/lifecycle_environment_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleEnvironmentCollection Results of a lifecycle environment search. Contains both lifecycle environment summary items and other data. +type LifecycleEnvironmentCollection struct { + + // List of lifecycle environments. + Items []LifecycleEnvironmentSummary `mandatory:"true" json:"items"` +} + +func (m LifecycleEnvironmentCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleEnvironmentCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/lifecycle_environment_details.go b/osmanagementhub/lifecycle_environment_details.go new file mode 100644 index 0000000000..8eeff8926d --- /dev/null +++ b/osmanagementhub/lifecycle_environment_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleEnvironmentDetails Identifying information for the specified lifecycle environment. +type LifecycleEnvironmentDetails struct { + + // The OCID of the lifecycle environment. + Id *string `mandatory:"true" json:"id"` + + // Lifecycle environment name. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m LifecycleEnvironmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleEnvironmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/lifecycle_environment_summary.go b/osmanagementhub/lifecycle_environment_summary.go new file mode 100644 index 0000000000..4d68759331 --- /dev/null +++ b/osmanagementhub/lifecycle_environment_summary.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleEnvironmentSummary Summary of the lifecycle environment. +type LifecycleEnvironmentSummary struct { + + // The lifecycle environment OCID that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the lifecycle environment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // User specified information about the lifecycle environment. + Description *string `mandatory:"true" json:"description"` + + // User specified list of lifecycle stages to be created for the lLifecycle environment. + Stages []LifecycleStageSummary `mandatory:"true" json:"stages"` + + // The CPU architecture of the target managed instance. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The operating system type of the target managed instance. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The current state of the lifecycle environment. + LifecycleState LifecycleEnvironmentLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The time the lifecycle environment was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the lifecycle environment was modified. An RFC3339 formatted datetime string. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m LifecycleEnvironmentSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleEnvironmentSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + + if _, ok := GetMappingLifecycleEnvironmentLifecycleStateEnum(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(GetLifecycleEnvironmentLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/lifecycle_profile.go b/osmanagementhub/lifecycle_profile.go new file mode 100644 index 0000000000..5dd58af518 --- /dev/null +++ b/osmanagementhub/lifecycle_profile.go @@ -0,0 +1,177 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleProfile Definition of a registration profile of type LIFECYCLE. +type LifecycleProfile struct { + + // The OCID of the profile that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + LifecycleStage *LifecycleStageDetails `mandatory:"true" json:"lifecycleStage"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // The time the the registration profile was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + LifecycleEnvironment *LifecycleEnvironmentDetails `mandatory:"false" json:"lifecycleEnvironment"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The operating system family. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The current state of the registration profile. + LifecycleState ProfileLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m LifecycleProfile) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m LifecycleProfile) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m LifecycleProfile) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m LifecycleProfile) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m LifecycleProfile) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetVendorName returns VendorName +func (m LifecycleProfile) GetVendorName() VendorNameEnum { + return m.VendorName +} + +//GetOsFamily returns OsFamily +func (m LifecycleProfile) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m LifecycleProfile) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetTimeCreated returns TimeCreated +func (m LifecycleProfile) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m LifecycleProfile) GetLifecycleState() ProfileLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m LifecycleProfile) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m LifecycleProfile) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m LifecycleProfile) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m LifecycleProfile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleProfile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingProfileLifecycleStateEnum(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(GetProfileLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m LifecycleProfile) MarshalJSON() (buff []byte, e error) { + type MarshalTypeLifecycleProfile LifecycleProfile + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeLifecycleProfile + }{ + "LIFECYCLE", + (MarshalTypeLifecycleProfile)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/lifecycle_stage.go b/osmanagementhub/lifecycle_stage.go new file mode 100644 index 0000000000..44811df440 --- /dev/null +++ b/osmanagementhub/lifecycle_stage.go @@ -0,0 +1,160 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleStage Defines the lifecycle stage. +type LifecycleStage struct { + + // The OCID of the tenancy containing the lifecycle stage. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // User specified rank for the lifecycle stage. + // Rank determines the hierarchy of the lifecycle stages for a given lifecycle environment. + Rank *int `mandatory:"true" json:"rank"` + + // The lifecycle stage OCID that is immutable on creation. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the lifecycle environment for the lifecycle stage. + LifecycleEnvironmentId *string `mandatory:"false" json:"lifecycleEnvironmentId"` + + // The operating system type of the target instances. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The CPU architecture of the target instances. + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"false" json:"vendorName,omitempty"` + + // The list of managed instances specified lifecycle stage. + ManagedInstanceIds []ManagedInstanceDetails `mandatory:"false" json:"managedInstanceIds"` + + SoftwareSourceId *SoftwareSourceDetails `mandatory:"false" json:"softwareSourceId"` + + // The time the lifecycle stage was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the lifecycle stage was last modified. An RFC3339 formatted datetime string. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // The current state of the lifecycle stage. + LifecycleState LifecycleStageLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m LifecycleStage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleStage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleStageLifecycleStateEnum(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(GetLifecycleStageLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// LifecycleStageLifecycleStateEnum Enum with underlying type: string +type LifecycleStageLifecycleStateEnum string + +// Set of constants representing the allowable values for LifecycleStageLifecycleStateEnum +const ( + LifecycleStageLifecycleStateCreating LifecycleStageLifecycleStateEnum = "CREATING" + LifecycleStageLifecycleStateUpdating LifecycleStageLifecycleStateEnum = "UPDATING" + LifecycleStageLifecycleStateActive LifecycleStageLifecycleStateEnum = "ACTIVE" + LifecycleStageLifecycleStateDeleting LifecycleStageLifecycleStateEnum = "DELETING" + LifecycleStageLifecycleStateDeleted LifecycleStageLifecycleStateEnum = "DELETED" + LifecycleStageLifecycleStateFailed LifecycleStageLifecycleStateEnum = "FAILED" +) + +var mappingLifecycleStageLifecycleStateEnum = map[string]LifecycleStageLifecycleStateEnum{ + "CREATING": LifecycleStageLifecycleStateCreating, + "UPDATING": LifecycleStageLifecycleStateUpdating, + "ACTIVE": LifecycleStageLifecycleStateActive, + "DELETING": LifecycleStageLifecycleStateDeleting, + "DELETED": LifecycleStageLifecycleStateDeleted, + "FAILED": LifecycleStageLifecycleStateFailed, +} + +var mappingLifecycleStageLifecycleStateEnumLowerCase = map[string]LifecycleStageLifecycleStateEnum{ + "creating": LifecycleStageLifecycleStateCreating, + "updating": LifecycleStageLifecycleStateUpdating, + "active": LifecycleStageLifecycleStateActive, + "deleting": LifecycleStageLifecycleStateDeleting, + "deleted": LifecycleStageLifecycleStateDeleted, + "failed": LifecycleStageLifecycleStateFailed, +} + +// GetLifecycleStageLifecycleStateEnumValues Enumerates the set of values for LifecycleStageLifecycleStateEnum +func GetLifecycleStageLifecycleStateEnumValues() []LifecycleStageLifecycleStateEnum { + values := make([]LifecycleStageLifecycleStateEnum, 0) + for _, v := range mappingLifecycleStageLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetLifecycleStageLifecycleStateEnumStringValues Enumerates the set of values in String for LifecycleStageLifecycleStateEnum +func GetLifecycleStageLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingLifecycleStageLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingLifecycleStageLifecycleStateEnum(val string) (LifecycleStageLifecycleStateEnum, bool) { + enum, ok := mappingLifecycleStageLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/lifecycle_stage_collection.go b/osmanagementhub/lifecycle_stage_collection.go new file mode 100644 index 0000000000..350dcf3012 --- /dev/null +++ b/osmanagementhub/lifecycle_stage_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleStageCollection Results of a lifecycle stage search. Contains both lifecycle stage summary items and other data. +type LifecycleStageCollection struct { + + // List of lifecycle stages. + Items []LifecycleStageSummary `mandatory:"true" json:"items"` +} + +func (m LifecycleStageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleStageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/lifecycle_stage_details.go b/osmanagementhub/lifecycle_stage_details.go new file mode 100644 index 0000000000..50c5793008 --- /dev/null +++ b/osmanagementhub/lifecycle_stage_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleStageDetails Identifying information for the specified lifecycle stage. +type LifecycleStageDetails struct { + + // The OCID of the lifecycle stage. + Id *string `mandatory:"true" json:"id"` + + // Lifecycle stage name. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m LifecycleStageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleStageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/lifecycle_stage_summary.go b/osmanagementhub/lifecycle_stage_summary.go new file mode 100644 index 0000000000..19e8e00592 --- /dev/null +++ b/osmanagementhub/lifecycle_stage_summary.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleStageSummary Defines the lifecycle stage summary. +type LifecycleStageSummary struct { + + // The OCID of the tenancy containing the lifecycle stage. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // User specified rank for the lifecycle stage. + // Rank determines the hierarchy of the lifecycle stages for a given lifecycle environment. + Rank *int `mandatory:"true" json:"rank"` + + // The lifecycle stage OCID that is immutable on creation. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the lifecycle environment for the lifecycle stage. + LifecycleEnvironmentId *string `mandatory:"false" json:"lifecycleEnvironmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + LifecycleEnvironmentDisplayName *string `mandatory:"false" json:"lifecycleEnvironmentDisplayName"` + + // The operating system type of the target instances. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The CPU architecture of the target instances. + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"false" json:"vendorName,omitempty"` + + // The number of managed instances attached to the lifecycle stage. + ManagedInstances *int `mandatory:"false" json:"managedInstances"` + + SoftwareSourceId *SoftwareSourceDetails `mandatory:"false" json:"softwareSourceId"` + + // The time the lifecycle stage was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the lifecycle stage was last modified. An RFC3339 formatted datetime string. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // The current state of the lifecycle environment. + LifecycleState LifecycleStageLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m LifecycleStageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LifecycleStageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleStageLifecycleStateEnum(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(GetLifecycleStageLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/list_entitlements_request_response.go b/osmanagementhub/list_entitlements_request_response.go new file mode 100644 index 0000000000..1f738a9155 --- /dev/null +++ b/osmanagementhub/list_entitlements_request_response.go @@ -0,0 +1,246 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListEntitlementsRequest wrapper for the ListEntitlements operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListEntitlements.go.html to see an example of how to use ListEntitlementsRequest. +type ListEntitlementsRequest struct { + + // The OCID of the compartment that contains the resources to list. This parameter is required. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return entitlements that match the given CSI. + Csi *string `mandatory:"false" contributesTo:"query" name:"csi"` + + // A filter to return only profiles that match the given vendorName. + VendorName ListEntitlementsVendorNameEnum `mandatory:"false" contributesTo:"query" name:"vendorName" omitEmpty:"true"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListEntitlementsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort entitlements by. Only one sort order may be provided. + SortBy ListEntitlementsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListEntitlementsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListEntitlementsRequest) 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 ListEntitlementsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListEntitlementsRequest) 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 ListEntitlementsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListEntitlementsVendorNameEnum(string(request.VendorName)); !ok && request.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", request.VendorName, strings.Join(GetListEntitlementsVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingListEntitlementsSortOrderEnum(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(GetListEntitlementsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListEntitlementsSortByEnum(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(GetListEntitlementsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListEntitlementsResponse wrapper for the ListEntitlements operation +type ListEntitlementsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of EntitlementCollection instances + EntitlementCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListEntitlementsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListEntitlementsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListEntitlementsVendorNameEnum Enum with underlying type: string +type ListEntitlementsVendorNameEnum string + +// Set of constants representing the allowable values for ListEntitlementsVendorNameEnum +const ( + ListEntitlementsVendorNameOracle ListEntitlementsVendorNameEnum = "ORACLE" +) + +var mappingListEntitlementsVendorNameEnum = map[string]ListEntitlementsVendorNameEnum{ + "ORACLE": ListEntitlementsVendorNameOracle, +} + +var mappingListEntitlementsVendorNameEnumLowerCase = map[string]ListEntitlementsVendorNameEnum{ + "oracle": ListEntitlementsVendorNameOracle, +} + +// GetListEntitlementsVendorNameEnumValues Enumerates the set of values for ListEntitlementsVendorNameEnum +func GetListEntitlementsVendorNameEnumValues() []ListEntitlementsVendorNameEnum { + values := make([]ListEntitlementsVendorNameEnum, 0) + for _, v := range mappingListEntitlementsVendorNameEnum { + values = append(values, v) + } + return values +} + +// GetListEntitlementsVendorNameEnumStringValues Enumerates the set of values in String for ListEntitlementsVendorNameEnum +func GetListEntitlementsVendorNameEnumStringValues() []string { + return []string{ + "ORACLE", + } +} + +// GetMappingListEntitlementsVendorNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListEntitlementsVendorNameEnum(val string) (ListEntitlementsVendorNameEnum, bool) { + enum, ok := mappingListEntitlementsVendorNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListEntitlementsSortOrderEnum Enum with underlying type: string +type ListEntitlementsSortOrderEnum string + +// Set of constants representing the allowable values for ListEntitlementsSortOrderEnum +const ( + ListEntitlementsSortOrderAsc ListEntitlementsSortOrderEnum = "ASC" + ListEntitlementsSortOrderDesc ListEntitlementsSortOrderEnum = "DESC" +) + +var mappingListEntitlementsSortOrderEnum = map[string]ListEntitlementsSortOrderEnum{ + "ASC": ListEntitlementsSortOrderAsc, + "DESC": ListEntitlementsSortOrderDesc, +} + +var mappingListEntitlementsSortOrderEnumLowerCase = map[string]ListEntitlementsSortOrderEnum{ + "asc": ListEntitlementsSortOrderAsc, + "desc": ListEntitlementsSortOrderDesc, +} + +// GetListEntitlementsSortOrderEnumValues Enumerates the set of values for ListEntitlementsSortOrderEnum +func GetListEntitlementsSortOrderEnumValues() []ListEntitlementsSortOrderEnum { + values := make([]ListEntitlementsSortOrderEnum, 0) + for _, v := range mappingListEntitlementsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListEntitlementsSortOrderEnumStringValues Enumerates the set of values in String for ListEntitlementsSortOrderEnum +func GetListEntitlementsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListEntitlementsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListEntitlementsSortOrderEnum(val string) (ListEntitlementsSortOrderEnum, bool) { + enum, ok := mappingListEntitlementsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListEntitlementsSortByEnum Enum with underlying type: string +type ListEntitlementsSortByEnum string + +// Set of constants representing the allowable values for ListEntitlementsSortByEnum +const ( + ListEntitlementsSortByCsi ListEntitlementsSortByEnum = "csi" + ListEntitlementsSortByVendorname ListEntitlementsSortByEnum = "vendorName" +) + +var mappingListEntitlementsSortByEnum = map[string]ListEntitlementsSortByEnum{ + "csi": ListEntitlementsSortByCsi, + "vendorName": ListEntitlementsSortByVendorname, +} + +var mappingListEntitlementsSortByEnumLowerCase = map[string]ListEntitlementsSortByEnum{ + "csi": ListEntitlementsSortByCsi, + "vendorname": ListEntitlementsSortByVendorname, +} + +// GetListEntitlementsSortByEnumValues Enumerates the set of values for ListEntitlementsSortByEnum +func GetListEntitlementsSortByEnumValues() []ListEntitlementsSortByEnum { + values := make([]ListEntitlementsSortByEnum, 0) + for _, v := range mappingListEntitlementsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListEntitlementsSortByEnumStringValues Enumerates the set of values in String for ListEntitlementsSortByEnum +func GetListEntitlementsSortByEnumStringValues() []string { + return []string{ + "csi", + "vendorName", + } +} + +// GetMappingListEntitlementsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListEntitlementsSortByEnum(val string) (ListEntitlementsSortByEnum, bool) { + enum, ok := mappingListEntitlementsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_errata_request_response.go b/osmanagementhub/list_errata_request_response.go new file mode 100644 index 0000000000..6e4534a636 --- /dev/null +++ b/osmanagementhub/list_errata_request_response.go @@ -0,0 +1,284 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListErrataRequest wrapper for the ListErrata operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListErrata.go.html to see an example of how to use ListErrataRequest. +type ListErrataRequest struct { + + // The OCID of the compartment that contains the resources to list. This parameter is required. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The assigned erratum name. It's unique and not changeable. + // Example: `ELSA-2020-5804` + Name []string `contributesTo:"query" name:"name" collectionFormat:"multi"` + + // A filter to return resources that may partially match the erratum name given. + NameContains *string `mandatory:"false" contributesTo:"query" name:"nameContains"` + + // A filter to return only packages that match the given update classification type. + ClassificationType []ClassificationTypesEnum `contributesTo:"query" name:"classificationType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only profiles that match the given osFamily. + OsFamily ListErrataOsFamilyEnum `mandatory:"false" contributesTo:"query" name:"osFamily" omitEmpty:"true"` + + // The advisory severity. + AdvisorySeverity []AdvisorySeverityEnum `contributesTo:"query" name:"advisorySeverity" omitEmpty:"true" collectionFormat:"multi"` + + // The issue date after which to list all errata, in ISO 8601 format + // Example: 2017-07-14T02:40:00.000Z + TimeIssueDateStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeIssueDateStart"` + + // The issue date before which to list all errata, in ISO 8601 format + // Example: 2017-07-14T02:40:00.000Z + TimeIssueDateEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeIssueDateEnd"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListErrataSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort errata by. Only one sort order may be provided. Default order for timeIssued is descending. Default order for name is ascending. If no value is specified timeIssued is default. + SortBy ListErrataSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListErrataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListErrataRequest) 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 ListErrataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListErrataRequest) 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 ListErrataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.ClassificationType { + if _, ok := GetMappingClassificationTypesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ClassificationType: %s. Supported values are: %s.", val, strings.Join(GetClassificationTypesEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListErrataOsFamilyEnum(string(request.OsFamily)); !ok && request.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", request.OsFamily, strings.Join(GetListErrataOsFamilyEnumStringValues(), ","))) + } + for _, val := range request.AdvisorySeverity { + if _, ok := GetMappingAdvisorySeverityEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdvisorySeverity: %s. Supported values are: %s.", val, strings.Join(GetAdvisorySeverityEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListErrataSortOrderEnum(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(GetListErrataSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListErrataSortByEnum(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(GetListErrataSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListErrataResponse wrapper for the ListErrata operation +type ListErrataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ErratumCollection instances + ErratumCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListErrataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListErrataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListErrataOsFamilyEnum Enum with underlying type: string +type ListErrataOsFamilyEnum string + +// Set of constants representing the allowable values for ListErrataOsFamilyEnum +const ( + ListErrataOsFamily9 ListErrataOsFamilyEnum = "ORACLE_LINUX_9" + ListErrataOsFamily8 ListErrataOsFamilyEnum = "ORACLE_LINUX_8" + ListErrataOsFamily7 ListErrataOsFamilyEnum = "ORACLE_LINUX_7" +) + +var mappingListErrataOsFamilyEnum = map[string]ListErrataOsFamilyEnum{ + "ORACLE_LINUX_9": ListErrataOsFamily9, + "ORACLE_LINUX_8": ListErrataOsFamily8, + "ORACLE_LINUX_7": ListErrataOsFamily7, +} + +var mappingListErrataOsFamilyEnumLowerCase = map[string]ListErrataOsFamilyEnum{ + "oracle_linux_9": ListErrataOsFamily9, + "oracle_linux_8": ListErrataOsFamily8, + "oracle_linux_7": ListErrataOsFamily7, +} + +// GetListErrataOsFamilyEnumValues Enumerates the set of values for ListErrataOsFamilyEnum +func GetListErrataOsFamilyEnumValues() []ListErrataOsFamilyEnum { + values := make([]ListErrataOsFamilyEnum, 0) + for _, v := range mappingListErrataOsFamilyEnum { + values = append(values, v) + } + return values +} + +// GetListErrataOsFamilyEnumStringValues Enumerates the set of values in String for ListErrataOsFamilyEnum +func GetListErrataOsFamilyEnumStringValues() []string { + return []string{ + "ORACLE_LINUX_9", + "ORACLE_LINUX_8", + "ORACLE_LINUX_7", + } +} + +// GetMappingListErrataOsFamilyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListErrataOsFamilyEnum(val string) (ListErrataOsFamilyEnum, bool) { + enum, ok := mappingListErrataOsFamilyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListErrataSortOrderEnum Enum with underlying type: string +type ListErrataSortOrderEnum string + +// Set of constants representing the allowable values for ListErrataSortOrderEnum +const ( + ListErrataSortOrderAsc ListErrataSortOrderEnum = "ASC" + ListErrataSortOrderDesc ListErrataSortOrderEnum = "DESC" +) + +var mappingListErrataSortOrderEnum = map[string]ListErrataSortOrderEnum{ + "ASC": ListErrataSortOrderAsc, + "DESC": ListErrataSortOrderDesc, +} + +var mappingListErrataSortOrderEnumLowerCase = map[string]ListErrataSortOrderEnum{ + "asc": ListErrataSortOrderAsc, + "desc": ListErrataSortOrderDesc, +} + +// GetListErrataSortOrderEnumValues Enumerates the set of values for ListErrataSortOrderEnum +func GetListErrataSortOrderEnumValues() []ListErrataSortOrderEnum { + values := make([]ListErrataSortOrderEnum, 0) + for _, v := range mappingListErrataSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListErrataSortOrderEnumStringValues Enumerates the set of values in String for ListErrataSortOrderEnum +func GetListErrataSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListErrataSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListErrataSortOrderEnum(val string) (ListErrataSortOrderEnum, bool) { + enum, ok := mappingListErrataSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListErrataSortByEnum Enum with underlying type: string +type ListErrataSortByEnum string + +// Set of constants representing the allowable values for ListErrataSortByEnum +const ( + ListErrataSortByTimeissued ListErrataSortByEnum = "timeIssued" + ListErrataSortByName ListErrataSortByEnum = "name" +) + +var mappingListErrataSortByEnum = map[string]ListErrataSortByEnum{ + "timeIssued": ListErrataSortByTimeissued, + "name": ListErrataSortByName, +} + +var mappingListErrataSortByEnumLowerCase = map[string]ListErrataSortByEnum{ + "timeissued": ListErrataSortByTimeissued, + "name": ListErrataSortByName, +} + +// GetListErrataSortByEnumValues Enumerates the set of values for ListErrataSortByEnum +func GetListErrataSortByEnumValues() []ListErrataSortByEnum { + values := make([]ListErrataSortByEnum, 0) + for _, v := range mappingListErrataSortByEnum { + values = append(values, v) + } + return values +} + +// GetListErrataSortByEnumStringValues Enumerates the set of values in String for ListErrataSortByEnum +func GetListErrataSortByEnumStringValues() []string { + return []string{ + "timeIssued", + "name", + } +} + +// GetMappingListErrataSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListErrataSortByEnum(val string) (ListErrataSortByEnum, bool) { + enum, ok := mappingListErrataSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_lifecycle_environments_request_response.go b/osmanagementhub/list_lifecycle_environments_request_response.go new file mode 100644 index 0000000000..c4a1f7cc3e --- /dev/null +++ b/osmanagementhub/list_lifecycle_environments_request_response.go @@ -0,0 +1,327 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListLifecycleEnvironmentsRequest wrapper for the ListLifecycleEnvironments operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListLifecycleEnvironments.go.html to see an example of how to use ListLifecycleEnvironmentsRequest. +type ListLifecycleEnvironmentsRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The OCID of the lifecycle environment. + LifecycleEnvironmentId *string `mandatory:"false" contributesTo:"query" name:"lifecycleEnvironmentId"` + + // A filter to return only profiles that match the given archType. + ArchType ListLifecycleEnvironmentsArchTypeEnum `mandatory:"false" contributesTo:"query" name:"archType" omitEmpty:"true"` + + // A filter to return only profiles that match the given osFamily. + OsFamily ListLifecycleEnvironmentsOsFamilyEnum `mandatory:"false" contributesTo:"query" name:"osFamily" omitEmpty:"true"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only the lifecycle environments that match the display name given. + LifecycleState LifecycleEnvironmentLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListLifecycleEnvironmentsSortOrderEnum `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 ListLifecycleEnvironmentsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListLifecycleEnvironmentsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListLifecycleEnvironmentsRequest) 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 ListLifecycleEnvironmentsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListLifecycleEnvironmentsRequest) 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 ListLifecycleEnvironmentsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListLifecycleEnvironmentsArchTypeEnum(string(request.ArchType)); !ok && request.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", request.ArchType, strings.Join(GetListLifecycleEnvironmentsArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleEnvironmentsOsFamilyEnum(string(request.OsFamily)); !ok && request.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", request.OsFamily, strings.Join(GetListLifecycleEnvironmentsOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleEnvironmentLifecycleStateEnum(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(GetLifecycleEnvironmentLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleEnvironmentsSortOrderEnum(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(GetListLifecycleEnvironmentsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleEnvironmentsSortByEnum(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(GetListLifecycleEnvironmentsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListLifecycleEnvironmentsResponse wrapper for the ListLifecycleEnvironments operation +type ListLifecycleEnvironmentsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of LifecycleEnvironmentCollection instances + LifecycleEnvironmentCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListLifecycleEnvironmentsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListLifecycleEnvironmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListLifecycleEnvironmentsArchTypeEnum Enum with underlying type: string +type ListLifecycleEnvironmentsArchTypeEnum string + +// Set of constants representing the allowable values for ListLifecycleEnvironmentsArchTypeEnum +const ( + ListLifecycleEnvironmentsArchTypeX8664 ListLifecycleEnvironmentsArchTypeEnum = "X86_64" + ListLifecycleEnvironmentsArchTypeAarch64 ListLifecycleEnvironmentsArchTypeEnum = "AARCH64" + ListLifecycleEnvironmentsArchTypeI686 ListLifecycleEnvironmentsArchTypeEnum = "I686" + ListLifecycleEnvironmentsArchTypeNoarch ListLifecycleEnvironmentsArchTypeEnum = "NOARCH" + ListLifecycleEnvironmentsArchTypeSrc ListLifecycleEnvironmentsArchTypeEnum = "SRC" +) + +var mappingListLifecycleEnvironmentsArchTypeEnum = map[string]ListLifecycleEnvironmentsArchTypeEnum{ + "X86_64": ListLifecycleEnvironmentsArchTypeX8664, + "AARCH64": ListLifecycleEnvironmentsArchTypeAarch64, + "I686": ListLifecycleEnvironmentsArchTypeI686, + "NOARCH": ListLifecycleEnvironmentsArchTypeNoarch, + "SRC": ListLifecycleEnvironmentsArchTypeSrc, +} + +var mappingListLifecycleEnvironmentsArchTypeEnumLowerCase = map[string]ListLifecycleEnvironmentsArchTypeEnum{ + "x86_64": ListLifecycleEnvironmentsArchTypeX8664, + "aarch64": ListLifecycleEnvironmentsArchTypeAarch64, + "i686": ListLifecycleEnvironmentsArchTypeI686, + "noarch": ListLifecycleEnvironmentsArchTypeNoarch, + "src": ListLifecycleEnvironmentsArchTypeSrc, +} + +// GetListLifecycleEnvironmentsArchTypeEnumValues Enumerates the set of values for ListLifecycleEnvironmentsArchTypeEnum +func GetListLifecycleEnvironmentsArchTypeEnumValues() []ListLifecycleEnvironmentsArchTypeEnum { + values := make([]ListLifecycleEnvironmentsArchTypeEnum, 0) + for _, v := range mappingListLifecycleEnvironmentsArchTypeEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleEnvironmentsArchTypeEnumStringValues Enumerates the set of values in String for ListLifecycleEnvironmentsArchTypeEnum +func GetListLifecycleEnvironmentsArchTypeEnumStringValues() []string { + return []string{ + "X86_64", + "AARCH64", + "I686", + "NOARCH", + "SRC", + } +} + +// GetMappingListLifecycleEnvironmentsArchTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleEnvironmentsArchTypeEnum(val string) (ListLifecycleEnvironmentsArchTypeEnum, bool) { + enum, ok := mappingListLifecycleEnvironmentsArchTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListLifecycleEnvironmentsOsFamilyEnum Enum with underlying type: string +type ListLifecycleEnvironmentsOsFamilyEnum string + +// Set of constants representing the allowable values for ListLifecycleEnvironmentsOsFamilyEnum +const ( + ListLifecycleEnvironmentsOsFamily9 ListLifecycleEnvironmentsOsFamilyEnum = "ORACLE_LINUX_9" + ListLifecycleEnvironmentsOsFamily8 ListLifecycleEnvironmentsOsFamilyEnum = "ORACLE_LINUX_8" + ListLifecycleEnvironmentsOsFamily7 ListLifecycleEnvironmentsOsFamilyEnum = "ORACLE_LINUX_7" +) + +var mappingListLifecycleEnvironmentsOsFamilyEnum = map[string]ListLifecycleEnvironmentsOsFamilyEnum{ + "ORACLE_LINUX_9": ListLifecycleEnvironmentsOsFamily9, + "ORACLE_LINUX_8": ListLifecycleEnvironmentsOsFamily8, + "ORACLE_LINUX_7": ListLifecycleEnvironmentsOsFamily7, +} + +var mappingListLifecycleEnvironmentsOsFamilyEnumLowerCase = map[string]ListLifecycleEnvironmentsOsFamilyEnum{ + "oracle_linux_9": ListLifecycleEnvironmentsOsFamily9, + "oracle_linux_8": ListLifecycleEnvironmentsOsFamily8, + "oracle_linux_7": ListLifecycleEnvironmentsOsFamily7, +} + +// GetListLifecycleEnvironmentsOsFamilyEnumValues Enumerates the set of values for ListLifecycleEnvironmentsOsFamilyEnum +func GetListLifecycleEnvironmentsOsFamilyEnumValues() []ListLifecycleEnvironmentsOsFamilyEnum { + values := make([]ListLifecycleEnvironmentsOsFamilyEnum, 0) + for _, v := range mappingListLifecycleEnvironmentsOsFamilyEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleEnvironmentsOsFamilyEnumStringValues Enumerates the set of values in String for ListLifecycleEnvironmentsOsFamilyEnum +func GetListLifecycleEnvironmentsOsFamilyEnumStringValues() []string { + return []string{ + "ORACLE_LINUX_9", + "ORACLE_LINUX_8", + "ORACLE_LINUX_7", + } +} + +// GetMappingListLifecycleEnvironmentsOsFamilyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleEnvironmentsOsFamilyEnum(val string) (ListLifecycleEnvironmentsOsFamilyEnum, bool) { + enum, ok := mappingListLifecycleEnvironmentsOsFamilyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListLifecycleEnvironmentsSortOrderEnum Enum with underlying type: string +type ListLifecycleEnvironmentsSortOrderEnum string + +// Set of constants representing the allowable values for ListLifecycleEnvironmentsSortOrderEnum +const ( + ListLifecycleEnvironmentsSortOrderAsc ListLifecycleEnvironmentsSortOrderEnum = "ASC" + ListLifecycleEnvironmentsSortOrderDesc ListLifecycleEnvironmentsSortOrderEnum = "DESC" +) + +var mappingListLifecycleEnvironmentsSortOrderEnum = map[string]ListLifecycleEnvironmentsSortOrderEnum{ + "ASC": ListLifecycleEnvironmentsSortOrderAsc, + "DESC": ListLifecycleEnvironmentsSortOrderDesc, +} + +var mappingListLifecycleEnvironmentsSortOrderEnumLowerCase = map[string]ListLifecycleEnvironmentsSortOrderEnum{ + "asc": ListLifecycleEnvironmentsSortOrderAsc, + "desc": ListLifecycleEnvironmentsSortOrderDesc, +} + +// GetListLifecycleEnvironmentsSortOrderEnumValues Enumerates the set of values for ListLifecycleEnvironmentsSortOrderEnum +func GetListLifecycleEnvironmentsSortOrderEnumValues() []ListLifecycleEnvironmentsSortOrderEnum { + values := make([]ListLifecycleEnvironmentsSortOrderEnum, 0) + for _, v := range mappingListLifecycleEnvironmentsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleEnvironmentsSortOrderEnumStringValues Enumerates the set of values in String for ListLifecycleEnvironmentsSortOrderEnum +func GetListLifecycleEnvironmentsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListLifecycleEnvironmentsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleEnvironmentsSortOrderEnum(val string) (ListLifecycleEnvironmentsSortOrderEnum, bool) { + enum, ok := mappingListLifecycleEnvironmentsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListLifecycleEnvironmentsSortByEnum Enum with underlying type: string +type ListLifecycleEnvironmentsSortByEnum string + +// Set of constants representing the allowable values for ListLifecycleEnvironmentsSortByEnum +const ( + ListLifecycleEnvironmentsSortByTimecreated ListLifecycleEnvironmentsSortByEnum = "timeCreated" + ListLifecycleEnvironmentsSortByDisplayname ListLifecycleEnvironmentsSortByEnum = "displayName" +) + +var mappingListLifecycleEnvironmentsSortByEnum = map[string]ListLifecycleEnvironmentsSortByEnum{ + "timeCreated": ListLifecycleEnvironmentsSortByTimecreated, + "displayName": ListLifecycleEnvironmentsSortByDisplayname, +} + +var mappingListLifecycleEnvironmentsSortByEnumLowerCase = map[string]ListLifecycleEnvironmentsSortByEnum{ + "timecreated": ListLifecycleEnvironmentsSortByTimecreated, + "displayname": ListLifecycleEnvironmentsSortByDisplayname, +} + +// GetListLifecycleEnvironmentsSortByEnumValues Enumerates the set of values for ListLifecycleEnvironmentsSortByEnum +func GetListLifecycleEnvironmentsSortByEnumValues() []ListLifecycleEnvironmentsSortByEnum { + values := make([]ListLifecycleEnvironmentsSortByEnum, 0) + for _, v := range mappingListLifecycleEnvironmentsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleEnvironmentsSortByEnumStringValues Enumerates the set of values in String for ListLifecycleEnvironmentsSortByEnum +func GetListLifecycleEnvironmentsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListLifecycleEnvironmentsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleEnvironmentsSortByEnum(val string) (ListLifecycleEnvironmentsSortByEnum, bool) { + enum, ok := mappingListLifecycleEnvironmentsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_lifecycle_stage_installed_packages_request_response.go b/osmanagementhub/list_lifecycle_stage_installed_packages_request_response.go new file mode 100644 index 0000000000..181c0b89b6 --- /dev/null +++ b/osmanagementhub/list_lifecycle_stage_installed_packages_request_response.go @@ -0,0 +1,215 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListLifecycleStageInstalledPackagesRequest wrapper for the ListLifecycleStageInstalledPackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListLifecycleStageInstalledPackages.go.html to see an example of how to use ListLifecycleStageInstalledPackagesRequest. +type ListLifecycleStageInstalledPackagesRequest struct { + + // The OCID of the lifecycle stage. + LifecycleStageId *string `mandatory:"true" contributesTo:"path" name:"lifecycleStageId"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only lifecycle stage whose lifecycle state matches the given lifecycle state. + LifecycleState LifecycleStageLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListLifecycleStageInstalledPackagesSortOrderEnum `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 ListLifecycleStageInstalledPackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListLifecycleStageInstalledPackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListLifecycleStageInstalledPackagesRequest) 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 ListLifecycleStageInstalledPackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListLifecycleStageInstalledPackagesRequest) 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 ListLifecycleStageInstalledPackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingLifecycleStageLifecycleStateEnum(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(GetLifecycleStageLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleStageInstalledPackagesSortOrderEnum(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(GetListLifecycleStageInstalledPackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleStageInstalledPackagesSortByEnum(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(GetListLifecycleStageInstalledPackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListLifecycleStageInstalledPackagesResponse wrapper for the ListLifecycleStageInstalledPackages operation +type ListLifecycleStageInstalledPackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of InstalledPackageCollection instances + InstalledPackageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListLifecycleStageInstalledPackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListLifecycleStageInstalledPackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListLifecycleStageInstalledPackagesSortOrderEnum Enum with underlying type: string +type ListLifecycleStageInstalledPackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListLifecycleStageInstalledPackagesSortOrderEnum +const ( + ListLifecycleStageInstalledPackagesSortOrderAsc ListLifecycleStageInstalledPackagesSortOrderEnum = "ASC" + ListLifecycleStageInstalledPackagesSortOrderDesc ListLifecycleStageInstalledPackagesSortOrderEnum = "DESC" +) + +var mappingListLifecycleStageInstalledPackagesSortOrderEnum = map[string]ListLifecycleStageInstalledPackagesSortOrderEnum{ + "ASC": ListLifecycleStageInstalledPackagesSortOrderAsc, + "DESC": ListLifecycleStageInstalledPackagesSortOrderDesc, +} + +var mappingListLifecycleStageInstalledPackagesSortOrderEnumLowerCase = map[string]ListLifecycleStageInstalledPackagesSortOrderEnum{ + "asc": ListLifecycleStageInstalledPackagesSortOrderAsc, + "desc": ListLifecycleStageInstalledPackagesSortOrderDesc, +} + +// GetListLifecycleStageInstalledPackagesSortOrderEnumValues Enumerates the set of values for ListLifecycleStageInstalledPackagesSortOrderEnum +func GetListLifecycleStageInstalledPackagesSortOrderEnumValues() []ListLifecycleStageInstalledPackagesSortOrderEnum { + values := make([]ListLifecycleStageInstalledPackagesSortOrderEnum, 0) + for _, v := range mappingListLifecycleStageInstalledPackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleStageInstalledPackagesSortOrderEnumStringValues Enumerates the set of values in String for ListLifecycleStageInstalledPackagesSortOrderEnum +func GetListLifecycleStageInstalledPackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListLifecycleStageInstalledPackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleStageInstalledPackagesSortOrderEnum(val string) (ListLifecycleStageInstalledPackagesSortOrderEnum, bool) { + enum, ok := mappingListLifecycleStageInstalledPackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListLifecycleStageInstalledPackagesSortByEnum Enum with underlying type: string +type ListLifecycleStageInstalledPackagesSortByEnum string + +// Set of constants representing the allowable values for ListLifecycleStageInstalledPackagesSortByEnum +const ( + ListLifecycleStageInstalledPackagesSortByTimecreated ListLifecycleStageInstalledPackagesSortByEnum = "timeCreated" + ListLifecycleStageInstalledPackagesSortByDisplayname ListLifecycleStageInstalledPackagesSortByEnum = "displayName" +) + +var mappingListLifecycleStageInstalledPackagesSortByEnum = map[string]ListLifecycleStageInstalledPackagesSortByEnum{ + "timeCreated": ListLifecycleStageInstalledPackagesSortByTimecreated, + "displayName": ListLifecycleStageInstalledPackagesSortByDisplayname, +} + +var mappingListLifecycleStageInstalledPackagesSortByEnumLowerCase = map[string]ListLifecycleStageInstalledPackagesSortByEnum{ + "timecreated": ListLifecycleStageInstalledPackagesSortByTimecreated, + "displayname": ListLifecycleStageInstalledPackagesSortByDisplayname, +} + +// GetListLifecycleStageInstalledPackagesSortByEnumValues Enumerates the set of values for ListLifecycleStageInstalledPackagesSortByEnum +func GetListLifecycleStageInstalledPackagesSortByEnumValues() []ListLifecycleStageInstalledPackagesSortByEnum { + values := make([]ListLifecycleStageInstalledPackagesSortByEnum, 0) + for _, v := range mappingListLifecycleStageInstalledPackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleStageInstalledPackagesSortByEnumStringValues Enumerates the set of values in String for ListLifecycleStageInstalledPackagesSortByEnum +func GetListLifecycleStageInstalledPackagesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListLifecycleStageInstalledPackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleStageInstalledPackagesSortByEnum(val string) (ListLifecycleStageInstalledPackagesSortByEnum, bool) { + enum, ok := mappingListLifecycleStageInstalledPackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_lifecycle_stages_request_response.go b/osmanagementhub/list_lifecycle_stages_request_response.go new file mode 100644 index 0000000000..35f27bcab9 --- /dev/null +++ b/osmanagementhub/list_lifecycle_stages_request_response.go @@ -0,0 +1,330 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListLifecycleStagesRequest wrapper for the ListLifecycleStages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListLifecycleStages.go.html to see an example of how to use ListLifecycleStagesRequest. +type ListLifecycleStagesRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The OCID of the lifecycle stage. + LifecycleStageId *string `mandatory:"false" contributesTo:"query" name:"lifecycleStageId"` + + // The OCID for the software source. + SoftwareSourceId *string `mandatory:"false" contributesTo:"query" name:"softwareSourceId"` + + // A filter to return only profiles that match the given archType. + ArchType ListLifecycleStagesArchTypeEnum `mandatory:"false" contributesTo:"query" name:"archType" omitEmpty:"true"` + + // A filter to return only profiles that match the given osFamily. + OsFamily ListLifecycleStagesOsFamilyEnum `mandatory:"false" contributesTo:"query" name:"osFamily" omitEmpty:"true"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only lifecycle stage whose lifecycle state matches the given lifecycle state. + LifecycleState LifecycleStageLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListLifecycleStagesSortOrderEnum `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 ListLifecycleStagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListLifecycleStagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListLifecycleStagesRequest) 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 ListLifecycleStagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListLifecycleStagesRequest) 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 ListLifecycleStagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListLifecycleStagesArchTypeEnum(string(request.ArchType)); !ok && request.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", request.ArchType, strings.Join(GetListLifecycleStagesArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleStagesOsFamilyEnum(string(request.OsFamily)); !ok && request.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", request.OsFamily, strings.Join(GetListLifecycleStagesOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleStageLifecycleStateEnum(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(GetLifecycleStageLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleStagesSortOrderEnum(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(GetListLifecycleStagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListLifecycleStagesSortByEnum(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(GetListLifecycleStagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListLifecycleStagesResponse wrapper for the ListLifecycleStages operation +type ListLifecycleStagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of LifecycleStageCollection instances + LifecycleStageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListLifecycleStagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListLifecycleStagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListLifecycleStagesArchTypeEnum Enum with underlying type: string +type ListLifecycleStagesArchTypeEnum string + +// Set of constants representing the allowable values for ListLifecycleStagesArchTypeEnum +const ( + ListLifecycleStagesArchTypeX8664 ListLifecycleStagesArchTypeEnum = "X86_64" + ListLifecycleStagesArchTypeAarch64 ListLifecycleStagesArchTypeEnum = "AARCH64" + ListLifecycleStagesArchTypeI686 ListLifecycleStagesArchTypeEnum = "I686" + ListLifecycleStagesArchTypeNoarch ListLifecycleStagesArchTypeEnum = "NOARCH" + ListLifecycleStagesArchTypeSrc ListLifecycleStagesArchTypeEnum = "SRC" +) + +var mappingListLifecycleStagesArchTypeEnum = map[string]ListLifecycleStagesArchTypeEnum{ + "X86_64": ListLifecycleStagesArchTypeX8664, + "AARCH64": ListLifecycleStagesArchTypeAarch64, + "I686": ListLifecycleStagesArchTypeI686, + "NOARCH": ListLifecycleStagesArchTypeNoarch, + "SRC": ListLifecycleStagesArchTypeSrc, +} + +var mappingListLifecycleStagesArchTypeEnumLowerCase = map[string]ListLifecycleStagesArchTypeEnum{ + "x86_64": ListLifecycleStagesArchTypeX8664, + "aarch64": ListLifecycleStagesArchTypeAarch64, + "i686": ListLifecycleStagesArchTypeI686, + "noarch": ListLifecycleStagesArchTypeNoarch, + "src": ListLifecycleStagesArchTypeSrc, +} + +// GetListLifecycleStagesArchTypeEnumValues Enumerates the set of values for ListLifecycleStagesArchTypeEnum +func GetListLifecycleStagesArchTypeEnumValues() []ListLifecycleStagesArchTypeEnum { + values := make([]ListLifecycleStagesArchTypeEnum, 0) + for _, v := range mappingListLifecycleStagesArchTypeEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleStagesArchTypeEnumStringValues Enumerates the set of values in String for ListLifecycleStagesArchTypeEnum +func GetListLifecycleStagesArchTypeEnumStringValues() []string { + return []string{ + "X86_64", + "AARCH64", + "I686", + "NOARCH", + "SRC", + } +} + +// GetMappingListLifecycleStagesArchTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleStagesArchTypeEnum(val string) (ListLifecycleStagesArchTypeEnum, bool) { + enum, ok := mappingListLifecycleStagesArchTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListLifecycleStagesOsFamilyEnum Enum with underlying type: string +type ListLifecycleStagesOsFamilyEnum string + +// Set of constants representing the allowable values for ListLifecycleStagesOsFamilyEnum +const ( + ListLifecycleStagesOsFamily9 ListLifecycleStagesOsFamilyEnum = "ORACLE_LINUX_9" + ListLifecycleStagesOsFamily8 ListLifecycleStagesOsFamilyEnum = "ORACLE_LINUX_8" + ListLifecycleStagesOsFamily7 ListLifecycleStagesOsFamilyEnum = "ORACLE_LINUX_7" +) + +var mappingListLifecycleStagesOsFamilyEnum = map[string]ListLifecycleStagesOsFamilyEnum{ + "ORACLE_LINUX_9": ListLifecycleStagesOsFamily9, + "ORACLE_LINUX_8": ListLifecycleStagesOsFamily8, + "ORACLE_LINUX_7": ListLifecycleStagesOsFamily7, +} + +var mappingListLifecycleStagesOsFamilyEnumLowerCase = map[string]ListLifecycleStagesOsFamilyEnum{ + "oracle_linux_9": ListLifecycleStagesOsFamily9, + "oracle_linux_8": ListLifecycleStagesOsFamily8, + "oracle_linux_7": ListLifecycleStagesOsFamily7, +} + +// GetListLifecycleStagesOsFamilyEnumValues Enumerates the set of values for ListLifecycleStagesOsFamilyEnum +func GetListLifecycleStagesOsFamilyEnumValues() []ListLifecycleStagesOsFamilyEnum { + values := make([]ListLifecycleStagesOsFamilyEnum, 0) + for _, v := range mappingListLifecycleStagesOsFamilyEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleStagesOsFamilyEnumStringValues Enumerates the set of values in String for ListLifecycleStagesOsFamilyEnum +func GetListLifecycleStagesOsFamilyEnumStringValues() []string { + return []string{ + "ORACLE_LINUX_9", + "ORACLE_LINUX_8", + "ORACLE_LINUX_7", + } +} + +// GetMappingListLifecycleStagesOsFamilyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleStagesOsFamilyEnum(val string) (ListLifecycleStagesOsFamilyEnum, bool) { + enum, ok := mappingListLifecycleStagesOsFamilyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListLifecycleStagesSortOrderEnum Enum with underlying type: string +type ListLifecycleStagesSortOrderEnum string + +// Set of constants representing the allowable values for ListLifecycleStagesSortOrderEnum +const ( + ListLifecycleStagesSortOrderAsc ListLifecycleStagesSortOrderEnum = "ASC" + ListLifecycleStagesSortOrderDesc ListLifecycleStagesSortOrderEnum = "DESC" +) + +var mappingListLifecycleStagesSortOrderEnum = map[string]ListLifecycleStagesSortOrderEnum{ + "ASC": ListLifecycleStagesSortOrderAsc, + "DESC": ListLifecycleStagesSortOrderDesc, +} + +var mappingListLifecycleStagesSortOrderEnumLowerCase = map[string]ListLifecycleStagesSortOrderEnum{ + "asc": ListLifecycleStagesSortOrderAsc, + "desc": ListLifecycleStagesSortOrderDesc, +} + +// GetListLifecycleStagesSortOrderEnumValues Enumerates the set of values for ListLifecycleStagesSortOrderEnum +func GetListLifecycleStagesSortOrderEnumValues() []ListLifecycleStagesSortOrderEnum { + values := make([]ListLifecycleStagesSortOrderEnum, 0) + for _, v := range mappingListLifecycleStagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleStagesSortOrderEnumStringValues Enumerates the set of values in String for ListLifecycleStagesSortOrderEnum +func GetListLifecycleStagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListLifecycleStagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleStagesSortOrderEnum(val string) (ListLifecycleStagesSortOrderEnum, bool) { + enum, ok := mappingListLifecycleStagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListLifecycleStagesSortByEnum Enum with underlying type: string +type ListLifecycleStagesSortByEnum string + +// Set of constants representing the allowable values for ListLifecycleStagesSortByEnum +const ( + ListLifecycleStagesSortByTimecreated ListLifecycleStagesSortByEnum = "timeCreated" + ListLifecycleStagesSortByDisplayname ListLifecycleStagesSortByEnum = "displayName" +) + +var mappingListLifecycleStagesSortByEnum = map[string]ListLifecycleStagesSortByEnum{ + "timeCreated": ListLifecycleStagesSortByTimecreated, + "displayName": ListLifecycleStagesSortByDisplayname, +} + +var mappingListLifecycleStagesSortByEnumLowerCase = map[string]ListLifecycleStagesSortByEnum{ + "timecreated": ListLifecycleStagesSortByTimecreated, + "displayname": ListLifecycleStagesSortByDisplayname, +} + +// GetListLifecycleStagesSortByEnumValues Enumerates the set of values for ListLifecycleStagesSortByEnum +func GetListLifecycleStagesSortByEnumValues() []ListLifecycleStagesSortByEnum { + values := make([]ListLifecycleStagesSortByEnum, 0) + for _, v := range mappingListLifecycleStagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListLifecycleStagesSortByEnumStringValues Enumerates the set of values in String for ListLifecycleStagesSortByEnum +func GetListLifecycleStagesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListLifecycleStagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListLifecycleStagesSortByEnum(val string) (ListLifecycleStagesSortByEnum, bool) { + enum, ok := mappingListLifecycleStagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_available_packages_request_response.go b/osmanagementhub/list_managed_instance_available_packages_request_response.go new file mode 100644 index 0000000000..6da4ed017d --- /dev/null +++ b/osmanagementhub/list_managed_instance_available_packages_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceAvailablePackagesRequest wrapper for the ListManagedInstanceAvailablePackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceAvailablePackages.go.html to see an example of how to use ListManagedInstanceAvailablePackagesRequest. +type ListManagedInstanceAvailablePackagesRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceAvailablePackagesSortOrderEnum `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 ListManagedInstanceAvailablePackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceAvailablePackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceAvailablePackagesRequest) 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 ListManagedInstanceAvailablePackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceAvailablePackagesRequest) 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 ListManagedInstanceAvailablePackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceAvailablePackagesSortOrderEnum(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(GetListManagedInstanceAvailablePackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceAvailablePackagesSortByEnum(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(GetListManagedInstanceAvailablePackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceAvailablePackagesResponse wrapper for the ListManagedInstanceAvailablePackages operation +type ListManagedInstanceAvailablePackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of AvailablePackageCollection instances + AvailablePackageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceAvailablePackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceAvailablePackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceAvailablePackagesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceAvailablePackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceAvailablePackagesSortOrderEnum +const ( + ListManagedInstanceAvailablePackagesSortOrderAsc ListManagedInstanceAvailablePackagesSortOrderEnum = "ASC" + ListManagedInstanceAvailablePackagesSortOrderDesc ListManagedInstanceAvailablePackagesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceAvailablePackagesSortOrderEnum = map[string]ListManagedInstanceAvailablePackagesSortOrderEnum{ + "ASC": ListManagedInstanceAvailablePackagesSortOrderAsc, + "DESC": ListManagedInstanceAvailablePackagesSortOrderDesc, +} + +var mappingListManagedInstanceAvailablePackagesSortOrderEnumLowerCase = map[string]ListManagedInstanceAvailablePackagesSortOrderEnum{ + "asc": ListManagedInstanceAvailablePackagesSortOrderAsc, + "desc": ListManagedInstanceAvailablePackagesSortOrderDesc, +} + +// GetListManagedInstanceAvailablePackagesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceAvailablePackagesSortOrderEnum +func GetListManagedInstanceAvailablePackagesSortOrderEnumValues() []ListManagedInstanceAvailablePackagesSortOrderEnum { + values := make([]ListManagedInstanceAvailablePackagesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceAvailablePackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceAvailablePackagesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceAvailablePackagesSortOrderEnum +func GetListManagedInstanceAvailablePackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceAvailablePackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceAvailablePackagesSortOrderEnum(val string) (ListManagedInstanceAvailablePackagesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceAvailablePackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceAvailablePackagesSortByEnum Enum with underlying type: string +type ListManagedInstanceAvailablePackagesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceAvailablePackagesSortByEnum +const ( + ListManagedInstanceAvailablePackagesSortByTimecreated ListManagedInstanceAvailablePackagesSortByEnum = "timeCreated" + ListManagedInstanceAvailablePackagesSortByDisplayname ListManagedInstanceAvailablePackagesSortByEnum = "displayName" +) + +var mappingListManagedInstanceAvailablePackagesSortByEnum = map[string]ListManagedInstanceAvailablePackagesSortByEnum{ + "timeCreated": ListManagedInstanceAvailablePackagesSortByTimecreated, + "displayName": ListManagedInstanceAvailablePackagesSortByDisplayname, +} + +var mappingListManagedInstanceAvailablePackagesSortByEnumLowerCase = map[string]ListManagedInstanceAvailablePackagesSortByEnum{ + "timecreated": ListManagedInstanceAvailablePackagesSortByTimecreated, + "displayname": ListManagedInstanceAvailablePackagesSortByDisplayname, +} + +// GetListManagedInstanceAvailablePackagesSortByEnumValues Enumerates the set of values for ListManagedInstanceAvailablePackagesSortByEnum +func GetListManagedInstanceAvailablePackagesSortByEnumValues() []ListManagedInstanceAvailablePackagesSortByEnum { + values := make([]ListManagedInstanceAvailablePackagesSortByEnum, 0) + for _, v := range mappingListManagedInstanceAvailablePackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceAvailablePackagesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceAvailablePackagesSortByEnum +func GetListManagedInstanceAvailablePackagesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceAvailablePackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceAvailablePackagesSortByEnum(val string) (ListManagedInstanceAvailablePackagesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceAvailablePackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_available_software_sources_request_response.go b/osmanagementhub/list_managed_instance_available_software_sources_request_response.go new file mode 100644 index 0000000000..4b17c8e679 --- /dev/null +++ b/osmanagementhub/list_managed_instance_available_software_sources_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceAvailableSoftwareSourcesRequest wrapper for the ListManagedInstanceAvailableSoftwareSources operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceAvailableSoftwareSources.go.html to see an example of how to use ListManagedInstanceAvailableSoftwareSourcesRequest. +type ListManagedInstanceAvailableSoftwareSourcesRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum `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 ListManagedInstanceAvailableSoftwareSourcesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceAvailableSoftwareSourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceAvailableSoftwareSourcesRequest) 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 ListManagedInstanceAvailableSoftwareSourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceAvailableSoftwareSourcesRequest) 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 ListManagedInstanceAvailableSoftwareSourcesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceAvailableSoftwareSourcesSortOrderEnum(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(GetListManagedInstanceAvailableSoftwareSourcesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceAvailableSoftwareSourcesSortByEnum(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(GetListManagedInstanceAvailableSoftwareSourcesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceAvailableSoftwareSourcesResponse wrapper for the ListManagedInstanceAvailableSoftwareSources operation +type ListManagedInstanceAvailableSoftwareSourcesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of AvailableSoftwareSourceCollection instances + AvailableSoftwareSourceCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceAvailableSoftwareSourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceAvailableSoftwareSourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum +const ( + ListManagedInstanceAvailableSoftwareSourcesSortOrderAsc ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum = "ASC" + ListManagedInstanceAvailableSoftwareSourcesSortOrderDesc ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceAvailableSoftwareSourcesSortOrderEnum = map[string]ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum{ + "ASC": ListManagedInstanceAvailableSoftwareSourcesSortOrderAsc, + "DESC": ListManagedInstanceAvailableSoftwareSourcesSortOrderDesc, +} + +var mappingListManagedInstanceAvailableSoftwareSourcesSortOrderEnumLowerCase = map[string]ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum{ + "asc": ListManagedInstanceAvailableSoftwareSourcesSortOrderAsc, + "desc": ListManagedInstanceAvailableSoftwareSourcesSortOrderDesc, +} + +// GetListManagedInstanceAvailableSoftwareSourcesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum +func GetListManagedInstanceAvailableSoftwareSourcesSortOrderEnumValues() []ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum { + values := make([]ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceAvailableSoftwareSourcesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceAvailableSoftwareSourcesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum +func GetListManagedInstanceAvailableSoftwareSourcesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceAvailableSoftwareSourcesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceAvailableSoftwareSourcesSortOrderEnum(val string) (ListManagedInstanceAvailableSoftwareSourcesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceAvailableSoftwareSourcesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceAvailableSoftwareSourcesSortByEnum Enum with underlying type: string +type ListManagedInstanceAvailableSoftwareSourcesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceAvailableSoftwareSourcesSortByEnum +const ( + ListManagedInstanceAvailableSoftwareSourcesSortByTimecreated ListManagedInstanceAvailableSoftwareSourcesSortByEnum = "timeCreated" + ListManagedInstanceAvailableSoftwareSourcesSortByDisplayname ListManagedInstanceAvailableSoftwareSourcesSortByEnum = "displayName" +) + +var mappingListManagedInstanceAvailableSoftwareSourcesSortByEnum = map[string]ListManagedInstanceAvailableSoftwareSourcesSortByEnum{ + "timeCreated": ListManagedInstanceAvailableSoftwareSourcesSortByTimecreated, + "displayName": ListManagedInstanceAvailableSoftwareSourcesSortByDisplayname, +} + +var mappingListManagedInstanceAvailableSoftwareSourcesSortByEnumLowerCase = map[string]ListManagedInstanceAvailableSoftwareSourcesSortByEnum{ + "timecreated": ListManagedInstanceAvailableSoftwareSourcesSortByTimecreated, + "displayname": ListManagedInstanceAvailableSoftwareSourcesSortByDisplayname, +} + +// GetListManagedInstanceAvailableSoftwareSourcesSortByEnumValues Enumerates the set of values for ListManagedInstanceAvailableSoftwareSourcesSortByEnum +func GetListManagedInstanceAvailableSoftwareSourcesSortByEnumValues() []ListManagedInstanceAvailableSoftwareSourcesSortByEnum { + values := make([]ListManagedInstanceAvailableSoftwareSourcesSortByEnum, 0) + for _, v := range mappingListManagedInstanceAvailableSoftwareSourcesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceAvailableSoftwareSourcesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceAvailableSoftwareSourcesSortByEnum +func GetListManagedInstanceAvailableSoftwareSourcesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceAvailableSoftwareSourcesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceAvailableSoftwareSourcesSortByEnum(val string) (ListManagedInstanceAvailableSoftwareSourcesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceAvailableSoftwareSourcesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_errata_request_response.go b/osmanagementhub/list_managed_instance_errata_request_response.go new file mode 100644 index 0000000000..78e341c0ab --- /dev/null +++ b/osmanagementhub/list_managed_instance_errata_request_response.go @@ -0,0 +1,264 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceErrataRequest wrapper for the ListManagedInstanceErrata operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceErrata.go.html to see an example of how to use ListManagedInstanceErrataRequest. +type ListManagedInstanceErrataRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // A filter to return only errata that match the given advisory types. + AdvisoryType []ListManagedInstanceErrataAdvisoryTypeEnum `contributesTo:"query" name:"advisoryType" omitEmpty:"true" collectionFormat:"multi"` + + // The assigned erratum name. It's unique and not changeable. + // Example: `ELSA-2020-5804` + Name []string `contributesTo:"query" name:"name" collectionFormat:"multi"` + + // A filter to return resources that may partially match the erratum name given. + NameContains *string `mandatory:"false" contributesTo:"query" name:"nameContains"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceErrataSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort errata by. Only one sort order may be provided. Default order for timeIssued is descending. Default order for name is ascending. If no value is specified timeIssued is default. + SortBy ListManagedInstanceErrataSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceErrataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceErrataRequest) 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 ListManagedInstanceErrataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceErrataRequest) 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 ListManagedInstanceErrataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.AdvisoryType { + if _, ok := GetMappingListManagedInstanceErrataAdvisoryTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdvisoryType: %s. Supported values are: %s.", val, strings.Join(GetListManagedInstanceErrataAdvisoryTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListManagedInstanceErrataSortOrderEnum(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(GetListManagedInstanceErrataSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceErrataSortByEnum(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(GetListManagedInstanceErrataSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceErrataResponse wrapper for the ListManagedInstanceErrata operation +type ListManagedInstanceErrataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceErratumSummaryCollection instances + ManagedInstanceErratumSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceErrataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceErrataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceErrataAdvisoryTypeEnum Enum with underlying type: string +type ListManagedInstanceErrataAdvisoryTypeEnum string + +// Set of constants representing the allowable values for ListManagedInstanceErrataAdvisoryTypeEnum +const ( + ListManagedInstanceErrataAdvisoryTypeSecurity ListManagedInstanceErrataAdvisoryTypeEnum = "SECURITY" + ListManagedInstanceErrataAdvisoryTypeBugfix ListManagedInstanceErrataAdvisoryTypeEnum = "BUGFIX" + ListManagedInstanceErrataAdvisoryTypeEnhancement ListManagedInstanceErrataAdvisoryTypeEnum = "ENHANCEMENT" +) + +var mappingListManagedInstanceErrataAdvisoryTypeEnum = map[string]ListManagedInstanceErrataAdvisoryTypeEnum{ + "SECURITY": ListManagedInstanceErrataAdvisoryTypeSecurity, + "BUGFIX": ListManagedInstanceErrataAdvisoryTypeBugfix, + "ENHANCEMENT": ListManagedInstanceErrataAdvisoryTypeEnhancement, +} + +var mappingListManagedInstanceErrataAdvisoryTypeEnumLowerCase = map[string]ListManagedInstanceErrataAdvisoryTypeEnum{ + "security": ListManagedInstanceErrataAdvisoryTypeSecurity, + "bugfix": ListManagedInstanceErrataAdvisoryTypeBugfix, + "enhancement": ListManagedInstanceErrataAdvisoryTypeEnhancement, +} + +// GetListManagedInstanceErrataAdvisoryTypeEnumValues Enumerates the set of values for ListManagedInstanceErrataAdvisoryTypeEnum +func GetListManagedInstanceErrataAdvisoryTypeEnumValues() []ListManagedInstanceErrataAdvisoryTypeEnum { + values := make([]ListManagedInstanceErrataAdvisoryTypeEnum, 0) + for _, v := range mappingListManagedInstanceErrataAdvisoryTypeEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceErrataAdvisoryTypeEnumStringValues Enumerates the set of values in String for ListManagedInstanceErrataAdvisoryTypeEnum +func GetListManagedInstanceErrataAdvisoryTypeEnumStringValues() []string { + return []string{ + "SECURITY", + "BUGFIX", + "ENHANCEMENT", + } +} + +// GetMappingListManagedInstanceErrataAdvisoryTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceErrataAdvisoryTypeEnum(val string) (ListManagedInstanceErrataAdvisoryTypeEnum, bool) { + enum, ok := mappingListManagedInstanceErrataAdvisoryTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceErrataSortOrderEnum Enum with underlying type: string +type ListManagedInstanceErrataSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceErrataSortOrderEnum +const ( + ListManagedInstanceErrataSortOrderAsc ListManagedInstanceErrataSortOrderEnum = "ASC" + ListManagedInstanceErrataSortOrderDesc ListManagedInstanceErrataSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceErrataSortOrderEnum = map[string]ListManagedInstanceErrataSortOrderEnum{ + "ASC": ListManagedInstanceErrataSortOrderAsc, + "DESC": ListManagedInstanceErrataSortOrderDesc, +} + +var mappingListManagedInstanceErrataSortOrderEnumLowerCase = map[string]ListManagedInstanceErrataSortOrderEnum{ + "asc": ListManagedInstanceErrataSortOrderAsc, + "desc": ListManagedInstanceErrataSortOrderDesc, +} + +// GetListManagedInstanceErrataSortOrderEnumValues Enumerates the set of values for ListManagedInstanceErrataSortOrderEnum +func GetListManagedInstanceErrataSortOrderEnumValues() []ListManagedInstanceErrataSortOrderEnum { + values := make([]ListManagedInstanceErrataSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceErrataSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceErrataSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceErrataSortOrderEnum +func GetListManagedInstanceErrataSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceErrataSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceErrataSortOrderEnum(val string) (ListManagedInstanceErrataSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceErrataSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceErrataSortByEnum Enum with underlying type: string +type ListManagedInstanceErrataSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceErrataSortByEnum +const ( + ListManagedInstanceErrataSortByTimeissued ListManagedInstanceErrataSortByEnum = "timeIssued" + ListManagedInstanceErrataSortByName ListManagedInstanceErrataSortByEnum = "name" +) + +var mappingListManagedInstanceErrataSortByEnum = map[string]ListManagedInstanceErrataSortByEnum{ + "timeIssued": ListManagedInstanceErrataSortByTimeissued, + "name": ListManagedInstanceErrataSortByName, +} + +var mappingListManagedInstanceErrataSortByEnumLowerCase = map[string]ListManagedInstanceErrataSortByEnum{ + "timeissued": ListManagedInstanceErrataSortByTimeissued, + "name": ListManagedInstanceErrataSortByName, +} + +// GetListManagedInstanceErrataSortByEnumValues Enumerates the set of values for ListManagedInstanceErrataSortByEnum +func GetListManagedInstanceErrataSortByEnumValues() []ListManagedInstanceErrataSortByEnum { + values := make([]ListManagedInstanceErrataSortByEnum, 0) + for _, v := range mappingListManagedInstanceErrataSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceErrataSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceErrataSortByEnum +func GetListManagedInstanceErrataSortByEnumStringValues() []string { + return []string{ + "timeIssued", + "name", + } +} + +// GetMappingListManagedInstanceErrataSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceErrataSortByEnum(val string) (ListManagedInstanceErrataSortByEnum, bool) { + enum, ok := mappingListManagedInstanceErrataSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_group_available_modules_request_response.go b/osmanagementhub/list_managed_instance_group_available_modules_request_response.go new file mode 100644 index 0000000000..bbed9f51c0 --- /dev/null +++ b/osmanagementhub/list_managed_instance_group_available_modules_request_response.go @@ -0,0 +1,204 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceGroupAvailableModulesRequest wrapper for the ListManagedInstanceGroupAvailableModules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupAvailableModules.go.html to see an example of how to use ListManagedInstanceGroupAvailableModulesRequest. +type ListManagedInstanceGroupAvailableModulesRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The resource name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return resources that may partially match the name given. + NameContains *string `mandatory:"false" contributesTo:"query" name:"nameContains"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceGroupAvailableModulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for name is ascending. + SortBy ListManagedInstanceGroupAvailableModulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceGroupAvailableModulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceGroupAvailableModulesRequest) 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 ListManagedInstanceGroupAvailableModulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceGroupAvailableModulesRequest) 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 ListManagedInstanceGroupAvailableModulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceGroupAvailableModulesSortOrderEnum(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(GetListManagedInstanceGroupAvailableModulesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupAvailableModulesSortByEnum(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(GetListManagedInstanceGroupAvailableModulesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceGroupAvailableModulesResponse wrapper for the ListManagedInstanceGroupAvailableModules operation +type ListManagedInstanceGroupAvailableModulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceGroupAvailableModuleCollection instances + ManagedInstanceGroupAvailableModuleCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceGroupAvailableModulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceGroupAvailableModulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceGroupAvailableModulesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceGroupAvailableModulesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupAvailableModulesSortOrderEnum +const ( + ListManagedInstanceGroupAvailableModulesSortOrderAsc ListManagedInstanceGroupAvailableModulesSortOrderEnum = "ASC" + ListManagedInstanceGroupAvailableModulesSortOrderDesc ListManagedInstanceGroupAvailableModulesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceGroupAvailableModulesSortOrderEnum = map[string]ListManagedInstanceGroupAvailableModulesSortOrderEnum{ + "ASC": ListManagedInstanceGroupAvailableModulesSortOrderAsc, + "DESC": ListManagedInstanceGroupAvailableModulesSortOrderDesc, +} + +var mappingListManagedInstanceGroupAvailableModulesSortOrderEnumLowerCase = map[string]ListManagedInstanceGroupAvailableModulesSortOrderEnum{ + "asc": ListManagedInstanceGroupAvailableModulesSortOrderAsc, + "desc": ListManagedInstanceGroupAvailableModulesSortOrderDesc, +} + +// GetListManagedInstanceGroupAvailableModulesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceGroupAvailableModulesSortOrderEnum +func GetListManagedInstanceGroupAvailableModulesSortOrderEnumValues() []ListManagedInstanceGroupAvailableModulesSortOrderEnum { + values := make([]ListManagedInstanceGroupAvailableModulesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceGroupAvailableModulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupAvailableModulesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupAvailableModulesSortOrderEnum +func GetListManagedInstanceGroupAvailableModulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceGroupAvailableModulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupAvailableModulesSortOrderEnum(val string) (ListManagedInstanceGroupAvailableModulesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceGroupAvailableModulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupAvailableModulesSortByEnum Enum with underlying type: string +type ListManagedInstanceGroupAvailableModulesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupAvailableModulesSortByEnum +const ( + ListManagedInstanceGroupAvailableModulesSortByName ListManagedInstanceGroupAvailableModulesSortByEnum = "name" +) + +var mappingListManagedInstanceGroupAvailableModulesSortByEnum = map[string]ListManagedInstanceGroupAvailableModulesSortByEnum{ + "name": ListManagedInstanceGroupAvailableModulesSortByName, +} + +var mappingListManagedInstanceGroupAvailableModulesSortByEnumLowerCase = map[string]ListManagedInstanceGroupAvailableModulesSortByEnum{ + "name": ListManagedInstanceGroupAvailableModulesSortByName, +} + +// GetListManagedInstanceGroupAvailableModulesSortByEnumValues Enumerates the set of values for ListManagedInstanceGroupAvailableModulesSortByEnum +func GetListManagedInstanceGroupAvailableModulesSortByEnumValues() []ListManagedInstanceGroupAvailableModulesSortByEnum { + values := make([]ListManagedInstanceGroupAvailableModulesSortByEnum, 0) + for _, v := range mappingListManagedInstanceGroupAvailableModulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupAvailableModulesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupAvailableModulesSortByEnum +func GetListManagedInstanceGroupAvailableModulesSortByEnumStringValues() []string { + return []string{ + "name", + } +} + +// GetMappingListManagedInstanceGroupAvailableModulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupAvailableModulesSortByEnum(val string) (ListManagedInstanceGroupAvailableModulesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceGroupAvailableModulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_group_available_packages_request_response.go b/osmanagementhub/list_managed_instance_group_available_packages_request_response.go new file mode 100644 index 0000000000..ed08585434 --- /dev/null +++ b/osmanagementhub/list_managed_instance_group_available_packages_request_response.go @@ -0,0 +1,213 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceGroupAvailablePackagesRequest wrapper for the ListManagedInstanceGroupAvailablePackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupAvailablePackages.go.html to see an example of how to use ListManagedInstanceGroupAvailablePackagesRequest. +type ListManagedInstanceGroupAvailablePackagesRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceGroupAvailablePackagesSortOrderEnum `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 ListManagedInstanceGroupAvailablePackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // A boolean variable that is used to list only the latest versions of packages, module streams, + // and stream profiles when set to true. All packages, module streams, and stream profiles are + // returned when set to false. + IsLatest *bool `mandatory:"false" contributesTo:"query" name:"isLatest"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListManagedInstanceGroupAvailablePackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceGroupAvailablePackagesRequest) 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 ListManagedInstanceGroupAvailablePackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceGroupAvailablePackagesRequest) 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 ListManagedInstanceGroupAvailablePackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceGroupAvailablePackagesSortOrderEnum(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(GetListManagedInstanceGroupAvailablePackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupAvailablePackagesSortByEnum(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(GetListManagedInstanceGroupAvailablePackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceGroupAvailablePackagesResponse wrapper for the ListManagedInstanceGroupAvailablePackages operation +type ListManagedInstanceGroupAvailablePackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceGroupAvailablePackageCollection instances + ManagedInstanceGroupAvailablePackageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceGroupAvailablePackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceGroupAvailablePackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceGroupAvailablePackagesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceGroupAvailablePackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupAvailablePackagesSortOrderEnum +const ( + ListManagedInstanceGroupAvailablePackagesSortOrderAsc ListManagedInstanceGroupAvailablePackagesSortOrderEnum = "ASC" + ListManagedInstanceGroupAvailablePackagesSortOrderDesc ListManagedInstanceGroupAvailablePackagesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceGroupAvailablePackagesSortOrderEnum = map[string]ListManagedInstanceGroupAvailablePackagesSortOrderEnum{ + "ASC": ListManagedInstanceGroupAvailablePackagesSortOrderAsc, + "DESC": ListManagedInstanceGroupAvailablePackagesSortOrderDesc, +} + +var mappingListManagedInstanceGroupAvailablePackagesSortOrderEnumLowerCase = map[string]ListManagedInstanceGroupAvailablePackagesSortOrderEnum{ + "asc": ListManagedInstanceGroupAvailablePackagesSortOrderAsc, + "desc": ListManagedInstanceGroupAvailablePackagesSortOrderDesc, +} + +// GetListManagedInstanceGroupAvailablePackagesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceGroupAvailablePackagesSortOrderEnum +func GetListManagedInstanceGroupAvailablePackagesSortOrderEnumValues() []ListManagedInstanceGroupAvailablePackagesSortOrderEnum { + values := make([]ListManagedInstanceGroupAvailablePackagesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceGroupAvailablePackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupAvailablePackagesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupAvailablePackagesSortOrderEnum +func GetListManagedInstanceGroupAvailablePackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceGroupAvailablePackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupAvailablePackagesSortOrderEnum(val string) (ListManagedInstanceGroupAvailablePackagesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceGroupAvailablePackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupAvailablePackagesSortByEnum Enum with underlying type: string +type ListManagedInstanceGroupAvailablePackagesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupAvailablePackagesSortByEnum +const ( + ListManagedInstanceGroupAvailablePackagesSortByTimecreated ListManagedInstanceGroupAvailablePackagesSortByEnum = "timeCreated" + ListManagedInstanceGroupAvailablePackagesSortByDisplayname ListManagedInstanceGroupAvailablePackagesSortByEnum = "displayName" +) + +var mappingListManagedInstanceGroupAvailablePackagesSortByEnum = map[string]ListManagedInstanceGroupAvailablePackagesSortByEnum{ + "timeCreated": ListManagedInstanceGroupAvailablePackagesSortByTimecreated, + "displayName": ListManagedInstanceGroupAvailablePackagesSortByDisplayname, +} + +var mappingListManagedInstanceGroupAvailablePackagesSortByEnumLowerCase = map[string]ListManagedInstanceGroupAvailablePackagesSortByEnum{ + "timecreated": ListManagedInstanceGroupAvailablePackagesSortByTimecreated, + "displayname": ListManagedInstanceGroupAvailablePackagesSortByDisplayname, +} + +// GetListManagedInstanceGroupAvailablePackagesSortByEnumValues Enumerates the set of values for ListManagedInstanceGroupAvailablePackagesSortByEnum +func GetListManagedInstanceGroupAvailablePackagesSortByEnumValues() []ListManagedInstanceGroupAvailablePackagesSortByEnum { + values := make([]ListManagedInstanceGroupAvailablePackagesSortByEnum, 0) + for _, v := range mappingListManagedInstanceGroupAvailablePackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupAvailablePackagesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupAvailablePackagesSortByEnum +func GetListManagedInstanceGroupAvailablePackagesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceGroupAvailablePackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupAvailablePackagesSortByEnum(val string) (ListManagedInstanceGroupAvailablePackagesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceGroupAvailablePackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_group_available_software_sources_request_response.go b/osmanagementhub/list_managed_instance_group_available_software_sources_request_response.go new file mode 100644 index 0000000000..0f4c8c812f --- /dev/null +++ b/osmanagementhub/list_managed_instance_group_available_software_sources_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceGroupAvailableSoftwareSourcesRequest wrapper for the ListManagedInstanceGroupAvailableSoftwareSources operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupAvailableSoftwareSources.go.html to see an example of how to use ListManagedInstanceGroupAvailableSoftwareSourcesRequest. +type ListManagedInstanceGroupAvailableSoftwareSourcesRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum `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 ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceGroupAvailableSoftwareSourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceGroupAvailableSoftwareSourcesRequest) 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 ListManagedInstanceGroupAvailableSoftwareSourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceGroupAvailableSoftwareSourcesRequest) 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 ListManagedInstanceGroupAvailableSoftwareSourcesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum(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(GetListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum(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(GetListManagedInstanceGroupAvailableSoftwareSourcesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceGroupAvailableSoftwareSourcesResponse wrapper for the ListManagedInstanceGroupAvailableSoftwareSources operation +type ListManagedInstanceGroupAvailableSoftwareSourcesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of AvailableSoftwareSourceCollection instances + AvailableSoftwareSourceCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceGroupAvailableSoftwareSourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceGroupAvailableSoftwareSourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum +const ( + ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderAsc ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum = "ASC" + ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderDesc ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum = map[string]ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum{ + "ASC": ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderAsc, + "DESC": ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderDesc, +} + +var mappingListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnumLowerCase = map[string]ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum{ + "asc": ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderAsc, + "desc": ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderDesc, +} + +// GetListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum +func GetListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnumValues() []ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum { + values := make([]ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum +func GetListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum(val string) (ListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceGroupAvailableSoftwareSourcesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum Enum with underlying type: string +type ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum +const ( + ListManagedInstanceGroupAvailableSoftwareSourcesSortByTimecreated ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum = "timeCreated" + ListManagedInstanceGroupAvailableSoftwareSourcesSortByDisplayname ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum = "displayName" +) + +var mappingListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum = map[string]ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum{ + "timeCreated": ListManagedInstanceGroupAvailableSoftwareSourcesSortByTimecreated, + "displayName": ListManagedInstanceGroupAvailableSoftwareSourcesSortByDisplayname, +} + +var mappingListManagedInstanceGroupAvailableSoftwareSourcesSortByEnumLowerCase = map[string]ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum{ + "timecreated": ListManagedInstanceGroupAvailableSoftwareSourcesSortByTimecreated, + "displayname": ListManagedInstanceGroupAvailableSoftwareSourcesSortByDisplayname, +} + +// GetListManagedInstanceGroupAvailableSoftwareSourcesSortByEnumValues Enumerates the set of values for ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum +func GetListManagedInstanceGroupAvailableSoftwareSourcesSortByEnumValues() []ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum { + values := make([]ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum, 0) + for _, v := range mappingListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupAvailableSoftwareSourcesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum +func GetListManagedInstanceGroupAvailableSoftwareSourcesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum(val string) (ListManagedInstanceGroupAvailableSoftwareSourcesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceGroupAvailableSoftwareSourcesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_group_installed_packages_request_response.go b/osmanagementhub/list_managed_instance_group_installed_packages_request_response.go new file mode 100644 index 0000000000..669183cb2b --- /dev/null +++ b/osmanagementhub/list_managed_instance_group_installed_packages_request_response.go @@ -0,0 +1,220 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceGroupInstalledPackagesRequest wrapper for the ListManagedInstanceGroupInstalledPackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupInstalledPackages.go.html to see an example of how to use ListManagedInstanceGroupInstalledPackagesRequest. +type ListManagedInstanceGroupInstalledPackagesRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The install date after which to list all packages, in ISO 8601 format + // Example: 2017-07-14T02:40:00.000Z + TimeInstallDateStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeInstallDateStart"` + + // The install date before which to list all packages, in ISO 8601 format. + // Example: 2017-07-14T02:40:00.000Z + TimeInstallDateEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeInstallDateEnd"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceGroupInstalledPackagesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeInstalled is descending. Default order for displayName is ascending. + SortBy ListManagedInstanceGroupInstalledPackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceGroupInstalledPackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceGroupInstalledPackagesRequest) 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 ListManagedInstanceGroupInstalledPackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceGroupInstalledPackagesRequest) 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 ListManagedInstanceGroupInstalledPackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceGroupInstalledPackagesSortOrderEnum(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(GetListManagedInstanceGroupInstalledPackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupInstalledPackagesSortByEnum(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(GetListManagedInstanceGroupInstalledPackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceGroupInstalledPackagesResponse wrapper for the ListManagedInstanceGroupInstalledPackages operation +type ListManagedInstanceGroupInstalledPackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceGroupInstalledPackageCollection instances + ManagedInstanceGroupInstalledPackageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceGroupInstalledPackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceGroupInstalledPackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceGroupInstalledPackagesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceGroupInstalledPackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupInstalledPackagesSortOrderEnum +const ( + ListManagedInstanceGroupInstalledPackagesSortOrderAsc ListManagedInstanceGroupInstalledPackagesSortOrderEnum = "ASC" + ListManagedInstanceGroupInstalledPackagesSortOrderDesc ListManagedInstanceGroupInstalledPackagesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceGroupInstalledPackagesSortOrderEnum = map[string]ListManagedInstanceGroupInstalledPackagesSortOrderEnum{ + "ASC": ListManagedInstanceGroupInstalledPackagesSortOrderAsc, + "DESC": ListManagedInstanceGroupInstalledPackagesSortOrderDesc, +} + +var mappingListManagedInstanceGroupInstalledPackagesSortOrderEnumLowerCase = map[string]ListManagedInstanceGroupInstalledPackagesSortOrderEnum{ + "asc": ListManagedInstanceGroupInstalledPackagesSortOrderAsc, + "desc": ListManagedInstanceGroupInstalledPackagesSortOrderDesc, +} + +// GetListManagedInstanceGroupInstalledPackagesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceGroupInstalledPackagesSortOrderEnum +func GetListManagedInstanceGroupInstalledPackagesSortOrderEnumValues() []ListManagedInstanceGroupInstalledPackagesSortOrderEnum { + values := make([]ListManagedInstanceGroupInstalledPackagesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceGroupInstalledPackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupInstalledPackagesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupInstalledPackagesSortOrderEnum +func GetListManagedInstanceGroupInstalledPackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceGroupInstalledPackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupInstalledPackagesSortOrderEnum(val string) (ListManagedInstanceGroupInstalledPackagesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceGroupInstalledPackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupInstalledPackagesSortByEnum Enum with underlying type: string +type ListManagedInstanceGroupInstalledPackagesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupInstalledPackagesSortByEnum +const ( + ListManagedInstanceGroupInstalledPackagesSortByTimeinstalled ListManagedInstanceGroupInstalledPackagesSortByEnum = "timeInstalled" + ListManagedInstanceGroupInstalledPackagesSortByTimecreated ListManagedInstanceGroupInstalledPackagesSortByEnum = "timeCreated" + ListManagedInstanceGroupInstalledPackagesSortByDisplayname ListManagedInstanceGroupInstalledPackagesSortByEnum = "displayName" +) + +var mappingListManagedInstanceGroupInstalledPackagesSortByEnum = map[string]ListManagedInstanceGroupInstalledPackagesSortByEnum{ + "timeInstalled": ListManagedInstanceGroupInstalledPackagesSortByTimeinstalled, + "timeCreated": ListManagedInstanceGroupInstalledPackagesSortByTimecreated, + "displayName": ListManagedInstanceGroupInstalledPackagesSortByDisplayname, +} + +var mappingListManagedInstanceGroupInstalledPackagesSortByEnumLowerCase = map[string]ListManagedInstanceGroupInstalledPackagesSortByEnum{ + "timeinstalled": ListManagedInstanceGroupInstalledPackagesSortByTimeinstalled, + "timecreated": ListManagedInstanceGroupInstalledPackagesSortByTimecreated, + "displayname": ListManagedInstanceGroupInstalledPackagesSortByDisplayname, +} + +// GetListManagedInstanceGroupInstalledPackagesSortByEnumValues Enumerates the set of values for ListManagedInstanceGroupInstalledPackagesSortByEnum +func GetListManagedInstanceGroupInstalledPackagesSortByEnumValues() []ListManagedInstanceGroupInstalledPackagesSortByEnum { + values := make([]ListManagedInstanceGroupInstalledPackagesSortByEnum, 0) + for _, v := range mappingListManagedInstanceGroupInstalledPackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupInstalledPackagesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupInstalledPackagesSortByEnum +func GetListManagedInstanceGroupInstalledPackagesSortByEnumStringValues() []string { + return []string{ + "timeInstalled", + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceGroupInstalledPackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupInstalledPackagesSortByEnum(val string) (ListManagedInstanceGroupInstalledPackagesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceGroupInstalledPackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_group_modules_request_response.go b/osmanagementhub/list_managed_instance_group_modules_request_response.go new file mode 100644 index 0000000000..3f1ce3ec48 --- /dev/null +++ b/osmanagementhub/list_managed_instance_group_modules_request_response.go @@ -0,0 +1,211 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceGroupModulesRequest wrapper for the ListManagedInstanceGroupModules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupModules.go.html to see an example of how to use ListManagedInstanceGroupModulesRequest. +type ListManagedInstanceGroupModulesRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The resource name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return resources that may partially match the name given. + NameContains *string `mandatory:"false" contributesTo:"query" name:"nameContains"` + + // The name of the stream of the containing module. This parameter + // is required if a profileName is specified. + StreamName *string `mandatory:"false" contributesTo:"query" name:"streamName"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceGroupModulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for name is ascending. + SortBy ListManagedInstanceGroupModulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceGroupModulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceGroupModulesRequest) 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 ListManagedInstanceGroupModulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceGroupModulesRequest) 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 ListManagedInstanceGroupModulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceGroupModulesSortOrderEnum(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(GetListManagedInstanceGroupModulesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupModulesSortByEnum(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(GetListManagedInstanceGroupModulesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceGroupModulesResponse wrapper for the ListManagedInstanceGroupModules operation +type ListManagedInstanceGroupModulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceGroupModuleCollection instances + ManagedInstanceGroupModuleCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceGroupModulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceGroupModulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceGroupModulesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceGroupModulesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupModulesSortOrderEnum +const ( + ListManagedInstanceGroupModulesSortOrderAsc ListManagedInstanceGroupModulesSortOrderEnum = "ASC" + ListManagedInstanceGroupModulesSortOrderDesc ListManagedInstanceGroupModulesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceGroupModulesSortOrderEnum = map[string]ListManagedInstanceGroupModulesSortOrderEnum{ + "ASC": ListManagedInstanceGroupModulesSortOrderAsc, + "DESC": ListManagedInstanceGroupModulesSortOrderDesc, +} + +var mappingListManagedInstanceGroupModulesSortOrderEnumLowerCase = map[string]ListManagedInstanceGroupModulesSortOrderEnum{ + "asc": ListManagedInstanceGroupModulesSortOrderAsc, + "desc": ListManagedInstanceGroupModulesSortOrderDesc, +} + +// GetListManagedInstanceGroupModulesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceGroupModulesSortOrderEnum +func GetListManagedInstanceGroupModulesSortOrderEnumValues() []ListManagedInstanceGroupModulesSortOrderEnum { + values := make([]ListManagedInstanceGroupModulesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceGroupModulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupModulesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupModulesSortOrderEnum +func GetListManagedInstanceGroupModulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceGroupModulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupModulesSortOrderEnum(val string) (ListManagedInstanceGroupModulesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceGroupModulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupModulesSortByEnum Enum with underlying type: string +type ListManagedInstanceGroupModulesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupModulesSortByEnum +const ( + ListManagedInstanceGroupModulesSortByName ListManagedInstanceGroupModulesSortByEnum = "name" +) + +var mappingListManagedInstanceGroupModulesSortByEnum = map[string]ListManagedInstanceGroupModulesSortByEnum{ + "name": ListManagedInstanceGroupModulesSortByName, +} + +var mappingListManagedInstanceGroupModulesSortByEnumLowerCase = map[string]ListManagedInstanceGroupModulesSortByEnum{ + "name": ListManagedInstanceGroupModulesSortByName, +} + +// GetListManagedInstanceGroupModulesSortByEnumValues Enumerates the set of values for ListManagedInstanceGroupModulesSortByEnum +func GetListManagedInstanceGroupModulesSortByEnumValues() []ListManagedInstanceGroupModulesSortByEnum { + values := make([]ListManagedInstanceGroupModulesSortByEnum, 0) + for _, v := range mappingListManagedInstanceGroupModulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupModulesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupModulesSortByEnum +func GetListManagedInstanceGroupModulesSortByEnumStringValues() []string { + return []string{ + "name", + } +} + +// GetMappingListManagedInstanceGroupModulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupModulesSortByEnum(val string) (ListManagedInstanceGroupModulesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceGroupModulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_groups_request_response.go b/osmanagementhub/list_managed_instance_groups_request_response.go new file mode 100644 index 0000000000..d2adfa8534 --- /dev/null +++ b/osmanagementhub/list_managed_instance_groups_request_response.go @@ -0,0 +1,329 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceGroupsRequest wrapper for the ListManagedInstanceGroups operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroups.go.html to see an example of how to use ListManagedInstanceGroupsRequest. +type ListManagedInstanceGroupsRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID of the managed instance group for which to list resources. + ManagedInstanceGroupId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceGroupId"` + + // The OCID for the software source. + SoftwareSourceId *string `mandatory:"false" contributesTo:"query" name:"softwareSourceId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // A filter to return only profiles that match the given archType. + ArchType ListManagedInstanceGroupsArchTypeEnum `mandatory:"false" contributesTo:"query" name:"archType" omitEmpty:"true"` + + // A filter to return only profiles that match the given osFamily. + OsFamily ListManagedInstanceGroupsOsFamilyEnum `mandatory:"false" contributesTo:"query" name:"osFamily" omitEmpty:"true"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only resources their lifecycle state matches the given lifecycle state. + LifecycleState ManagedInstanceGroupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceGroupsSortOrderEnum `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 ListManagedInstanceGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceGroupsRequest) 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 ListManagedInstanceGroupsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceGroupsRequest) 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 ListManagedInstanceGroupsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceGroupsArchTypeEnum(string(request.ArchType)); !ok && request.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", request.ArchType, strings.Join(GetListManagedInstanceGroupsArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupsOsFamilyEnum(string(request.OsFamily)); !ok && request.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", request.OsFamily, strings.Join(GetListManagedInstanceGroupsOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingManagedInstanceGroupLifecycleStateEnum(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(GetManagedInstanceGroupLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupsSortOrderEnum(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(GetListManagedInstanceGroupsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceGroupsSortByEnum(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(GetListManagedInstanceGroupsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceGroupsResponse wrapper for the ListManagedInstanceGroups operation +type ListManagedInstanceGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceGroupCollection instances + ManagedInstanceGroupCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceGroupsArchTypeEnum Enum with underlying type: string +type ListManagedInstanceGroupsArchTypeEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupsArchTypeEnum +const ( + ListManagedInstanceGroupsArchTypeX8664 ListManagedInstanceGroupsArchTypeEnum = "X86_64" + ListManagedInstanceGroupsArchTypeAarch64 ListManagedInstanceGroupsArchTypeEnum = "AARCH64" + ListManagedInstanceGroupsArchTypeI686 ListManagedInstanceGroupsArchTypeEnum = "I686" + ListManagedInstanceGroupsArchTypeNoarch ListManagedInstanceGroupsArchTypeEnum = "NOARCH" + ListManagedInstanceGroupsArchTypeSrc ListManagedInstanceGroupsArchTypeEnum = "SRC" +) + +var mappingListManagedInstanceGroupsArchTypeEnum = map[string]ListManagedInstanceGroupsArchTypeEnum{ + "X86_64": ListManagedInstanceGroupsArchTypeX8664, + "AARCH64": ListManagedInstanceGroupsArchTypeAarch64, + "I686": ListManagedInstanceGroupsArchTypeI686, + "NOARCH": ListManagedInstanceGroupsArchTypeNoarch, + "SRC": ListManagedInstanceGroupsArchTypeSrc, +} + +var mappingListManagedInstanceGroupsArchTypeEnumLowerCase = map[string]ListManagedInstanceGroupsArchTypeEnum{ + "x86_64": ListManagedInstanceGroupsArchTypeX8664, + "aarch64": ListManagedInstanceGroupsArchTypeAarch64, + "i686": ListManagedInstanceGroupsArchTypeI686, + "noarch": ListManagedInstanceGroupsArchTypeNoarch, + "src": ListManagedInstanceGroupsArchTypeSrc, +} + +// GetListManagedInstanceGroupsArchTypeEnumValues Enumerates the set of values for ListManagedInstanceGroupsArchTypeEnum +func GetListManagedInstanceGroupsArchTypeEnumValues() []ListManagedInstanceGroupsArchTypeEnum { + values := make([]ListManagedInstanceGroupsArchTypeEnum, 0) + for _, v := range mappingListManagedInstanceGroupsArchTypeEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupsArchTypeEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupsArchTypeEnum +func GetListManagedInstanceGroupsArchTypeEnumStringValues() []string { + return []string{ + "X86_64", + "AARCH64", + "I686", + "NOARCH", + "SRC", + } +} + +// GetMappingListManagedInstanceGroupsArchTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupsArchTypeEnum(val string) (ListManagedInstanceGroupsArchTypeEnum, bool) { + enum, ok := mappingListManagedInstanceGroupsArchTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupsOsFamilyEnum Enum with underlying type: string +type ListManagedInstanceGroupsOsFamilyEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupsOsFamilyEnum +const ( + ListManagedInstanceGroupsOsFamily9 ListManagedInstanceGroupsOsFamilyEnum = "ORACLE_LINUX_9" + ListManagedInstanceGroupsOsFamily8 ListManagedInstanceGroupsOsFamilyEnum = "ORACLE_LINUX_8" + ListManagedInstanceGroupsOsFamily7 ListManagedInstanceGroupsOsFamilyEnum = "ORACLE_LINUX_7" +) + +var mappingListManagedInstanceGroupsOsFamilyEnum = map[string]ListManagedInstanceGroupsOsFamilyEnum{ + "ORACLE_LINUX_9": ListManagedInstanceGroupsOsFamily9, + "ORACLE_LINUX_8": ListManagedInstanceGroupsOsFamily8, + "ORACLE_LINUX_7": ListManagedInstanceGroupsOsFamily7, +} + +var mappingListManagedInstanceGroupsOsFamilyEnumLowerCase = map[string]ListManagedInstanceGroupsOsFamilyEnum{ + "oracle_linux_9": ListManagedInstanceGroupsOsFamily9, + "oracle_linux_8": ListManagedInstanceGroupsOsFamily8, + "oracle_linux_7": ListManagedInstanceGroupsOsFamily7, +} + +// GetListManagedInstanceGroupsOsFamilyEnumValues Enumerates the set of values for ListManagedInstanceGroupsOsFamilyEnum +func GetListManagedInstanceGroupsOsFamilyEnumValues() []ListManagedInstanceGroupsOsFamilyEnum { + values := make([]ListManagedInstanceGroupsOsFamilyEnum, 0) + for _, v := range mappingListManagedInstanceGroupsOsFamilyEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupsOsFamilyEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupsOsFamilyEnum +func GetListManagedInstanceGroupsOsFamilyEnumStringValues() []string { + return []string{ + "ORACLE_LINUX_9", + "ORACLE_LINUX_8", + "ORACLE_LINUX_7", + } +} + +// GetMappingListManagedInstanceGroupsOsFamilyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupsOsFamilyEnum(val string) (ListManagedInstanceGroupsOsFamilyEnum, bool) { + enum, ok := mappingListManagedInstanceGroupsOsFamilyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupsSortOrderEnum Enum with underlying type: string +type ListManagedInstanceGroupsSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupsSortOrderEnum +const ( + ListManagedInstanceGroupsSortOrderAsc ListManagedInstanceGroupsSortOrderEnum = "ASC" + ListManagedInstanceGroupsSortOrderDesc ListManagedInstanceGroupsSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceGroupsSortOrderEnum = map[string]ListManagedInstanceGroupsSortOrderEnum{ + "ASC": ListManagedInstanceGroupsSortOrderAsc, + "DESC": ListManagedInstanceGroupsSortOrderDesc, +} + +var mappingListManagedInstanceGroupsSortOrderEnumLowerCase = map[string]ListManagedInstanceGroupsSortOrderEnum{ + "asc": ListManagedInstanceGroupsSortOrderAsc, + "desc": ListManagedInstanceGroupsSortOrderDesc, +} + +// GetListManagedInstanceGroupsSortOrderEnumValues Enumerates the set of values for ListManagedInstanceGroupsSortOrderEnum +func GetListManagedInstanceGroupsSortOrderEnumValues() []ListManagedInstanceGroupsSortOrderEnum { + values := make([]ListManagedInstanceGroupsSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceGroupsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupsSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupsSortOrderEnum +func GetListManagedInstanceGroupsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceGroupsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupsSortOrderEnum(val string) (ListManagedInstanceGroupsSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceGroupsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceGroupsSortByEnum Enum with underlying type: string +type ListManagedInstanceGroupsSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceGroupsSortByEnum +const ( + ListManagedInstanceGroupsSortByTimecreated ListManagedInstanceGroupsSortByEnum = "timeCreated" + ListManagedInstanceGroupsSortByDisplayname ListManagedInstanceGroupsSortByEnum = "displayName" +) + +var mappingListManagedInstanceGroupsSortByEnum = map[string]ListManagedInstanceGroupsSortByEnum{ + "timeCreated": ListManagedInstanceGroupsSortByTimecreated, + "displayName": ListManagedInstanceGroupsSortByDisplayname, +} + +var mappingListManagedInstanceGroupsSortByEnumLowerCase = map[string]ListManagedInstanceGroupsSortByEnum{ + "timecreated": ListManagedInstanceGroupsSortByTimecreated, + "displayname": ListManagedInstanceGroupsSortByDisplayname, +} + +// GetListManagedInstanceGroupsSortByEnumValues Enumerates the set of values for ListManagedInstanceGroupsSortByEnum +func GetListManagedInstanceGroupsSortByEnumValues() []ListManagedInstanceGroupsSortByEnum { + values := make([]ListManagedInstanceGroupsSortByEnum, 0) + for _, v := range mappingListManagedInstanceGroupsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceGroupsSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceGroupsSortByEnum +func GetListManagedInstanceGroupsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceGroupsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceGroupsSortByEnum(val string) (ListManagedInstanceGroupsSortByEnum, bool) { + enum, ok := mappingListManagedInstanceGroupsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_installed_packages_request_response.go b/osmanagementhub/list_managed_instance_installed_packages_request_response.go new file mode 100644 index 0000000000..b062ab38ac --- /dev/null +++ b/osmanagementhub/list_managed_instance_installed_packages_request_response.go @@ -0,0 +1,220 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceInstalledPackagesRequest wrapper for the ListManagedInstanceInstalledPackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceInstalledPackages.go.html to see an example of how to use ListManagedInstanceInstalledPackagesRequest. +type ListManagedInstanceInstalledPackagesRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The install date after which to list all packages, in ISO 8601 format + // Example: 2017-07-14T02:40:00.000Z + TimeInstallDateStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeInstallDateStart"` + + // The install date before which to list all packages, in ISO 8601 format. + // Example: 2017-07-14T02:40:00.000Z + TimeInstallDateEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeInstallDateEnd"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceInstalledPackagesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeInstalled is descending. Default order for displayName is ascending. + SortBy ListManagedInstanceInstalledPackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceInstalledPackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceInstalledPackagesRequest) 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 ListManagedInstanceInstalledPackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceInstalledPackagesRequest) 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 ListManagedInstanceInstalledPackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceInstalledPackagesSortOrderEnum(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(GetListManagedInstanceInstalledPackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceInstalledPackagesSortByEnum(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(GetListManagedInstanceInstalledPackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceInstalledPackagesResponse wrapper for the ListManagedInstanceInstalledPackages operation +type ListManagedInstanceInstalledPackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of InstalledPackageCollection instances + InstalledPackageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceInstalledPackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceInstalledPackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceInstalledPackagesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceInstalledPackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceInstalledPackagesSortOrderEnum +const ( + ListManagedInstanceInstalledPackagesSortOrderAsc ListManagedInstanceInstalledPackagesSortOrderEnum = "ASC" + ListManagedInstanceInstalledPackagesSortOrderDesc ListManagedInstanceInstalledPackagesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceInstalledPackagesSortOrderEnum = map[string]ListManagedInstanceInstalledPackagesSortOrderEnum{ + "ASC": ListManagedInstanceInstalledPackagesSortOrderAsc, + "DESC": ListManagedInstanceInstalledPackagesSortOrderDesc, +} + +var mappingListManagedInstanceInstalledPackagesSortOrderEnumLowerCase = map[string]ListManagedInstanceInstalledPackagesSortOrderEnum{ + "asc": ListManagedInstanceInstalledPackagesSortOrderAsc, + "desc": ListManagedInstanceInstalledPackagesSortOrderDesc, +} + +// GetListManagedInstanceInstalledPackagesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceInstalledPackagesSortOrderEnum +func GetListManagedInstanceInstalledPackagesSortOrderEnumValues() []ListManagedInstanceInstalledPackagesSortOrderEnum { + values := make([]ListManagedInstanceInstalledPackagesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceInstalledPackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceInstalledPackagesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceInstalledPackagesSortOrderEnum +func GetListManagedInstanceInstalledPackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceInstalledPackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceInstalledPackagesSortOrderEnum(val string) (ListManagedInstanceInstalledPackagesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceInstalledPackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceInstalledPackagesSortByEnum Enum with underlying type: string +type ListManagedInstanceInstalledPackagesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceInstalledPackagesSortByEnum +const ( + ListManagedInstanceInstalledPackagesSortByTimeinstalled ListManagedInstanceInstalledPackagesSortByEnum = "timeInstalled" + ListManagedInstanceInstalledPackagesSortByTimecreated ListManagedInstanceInstalledPackagesSortByEnum = "timeCreated" + ListManagedInstanceInstalledPackagesSortByDisplayname ListManagedInstanceInstalledPackagesSortByEnum = "displayName" +) + +var mappingListManagedInstanceInstalledPackagesSortByEnum = map[string]ListManagedInstanceInstalledPackagesSortByEnum{ + "timeInstalled": ListManagedInstanceInstalledPackagesSortByTimeinstalled, + "timeCreated": ListManagedInstanceInstalledPackagesSortByTimecreated, + "displayName": ListManagedInstanceInstalledPackagesSortByDisplayname, +} + +var mappingListManagedInstanceInstalledPackagesSortByEnumLowerCase = map[string]ListManagedInstanceInstalledPackagesSortByEnum{ + "timeinstalled": ListManagedInstanceInstalledPackagesSortByTimeinstalled, + "timecreated": ListManagedInstanceInstalledPackagesSortByTimecreated, + "displayname": ListManagedInstanceInstalledPackagesSortByDisplayname, +} + +// GetListManagedInstanceInstalledPackagesSortByEnumValues Enumerates the set of values for ListManagedInstanceInstalledPackagesSortByEnum +func GetListManagedInstanceInstalledPackagesSortByEnumValues() []ListManagedInstanceInstalledPackagesSortByEnum { + values := make([]ListManagedInstanceInstalledPackagesSortByEnum, 0) + for _, v := range mappingListManagedInstanceInstalledPackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceInstalledPackagesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceInstalledPackagesSortByEnum +func GetListManagedInstanceInstalledPackagesSortByEnumStringValues() []string { + return []string{ + "timeInstalled", + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceInstalledPackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceInstalledPackagesSortByEnum(val string) (ListManagedInstanceInstalledPackagesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceInstalledPackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_modules_request_response.go b/osmanagementhub/list_managed_instance_modules_request_response.go new file mode 100644 index 0000000000..6069cb2319 --- /dev/null +++ b/osmanagementhub/list_managed_instance_modules_request_response.go @@ -0,0 +1,207 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceModulesRequest wrapper for the ListManagedInstanceModules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceModules.go.html to see an example of how to use ListManagedInstanceModulesRequest. +type ListManagedInstanceModulesRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The resource name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return resources that may partially match the name given. + NameContains *string `mandatory:"false" contributesTo:"query" name:"nameContains"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceModulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for name is ascending. + SortBy ListManagedInstanceModulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceModulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceModulesRequest) 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 ListManagedInstanceModulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceModulesRequest) 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 ListManagedInstanceModulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListManagedInstanceModulesSortOrderEnum(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(GetListManagedInstanceModulesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceModulesSortByEnum(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(GetListManagedInstanceModulesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceModulesResponse wrapper for the ListManagedInstanceModules operation +type ListManagedInstanceModulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceModuleCollection instances + ManagedInstanceModuleCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceModulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceModulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceModulesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceModulesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceModulesSortOrderEnum +const ( + ListManagedInstanceModulesSortOrderAsc ListManagedInstanceModulesSortOrderEnum = "ASC" + ListManagedInstanceModulesSortOrderDesc ListManagedInstanceModulesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceModulesSortOrderEnum = map[string]ListManagedInstanceModulesSortOrderEnum{ + "ASC": ListManagedInstanceModulesSortOrderAsc, + "DESC": ListManagedInstanceModulesSortOrderDesc, +} + +var mappingListManagedInstanceModulesSortOrderEnumLowerCase = map[string]ListManagedInstanceModulesSortOrderEnum{ + "asc": ListManagedInstanceModulesSortOrderAsc, + "desc": ListManagedInstanceModulesSortOrderDesc, +} + +// GetListManagedInstanceModulesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceModulesSortOrderEnum +func GetListManagedInstanceModulesSortOrderEnumValues() []ListManagedInstanceModulesSortOrderEnum { + values := make([]ListManagedInstanceModulesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceModulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceModulesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceModulesSortOrderEnum +func GetListManagedInstanceModulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceModulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceModulesSortOrderEnum(val string) (ListManagedInstanceModulesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceModulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceModulesSortByEnum Enum with underlying type: string +type ListManagedInstanceModulesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceModulesSortByEnum +const ( + ListManagedInstanceModulesSortByName ListManagedInstanceModulesSortByEnum = "name" +) + +var mappingListManagedInstanceModulesSortByEnum = map[string]ListManagedInstanceModulesSortByEnum{ + "name": ListManagedInstanceModulesSortByName, +} + +var mappingListManagedInstanceModulesSortByEnumLowerCase = map[string]ListManagedInstanceModulesSortByEnum{ + "name": ListManagedInstanceModulesSortByName, +} + +// GetListManagedInstanceModulesSortByEnumValues Enumerates the set of values for ListManagedInstanceModulesSortByEnum +func GetListManagedInstanceModulesSortByEnumValues() []ListManagedInstanceModulesSortByEnum { + values := make([]ListManagedInstanceModulesSortByEnum, 0) + for _, v := range mappingListManagedInstanceModulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceModulesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceModulesSortByEnum +func GetListManagedInstanceModulesSortByEnumStringValues() []string { + return []string{ + "name", + } +} + +// GetMappingListManagedInstanceModulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceModulesSortByEnum(val string) (ListManagedInstanceModulesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceModulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instance_updatable_packages_request_response.go b/osmanagementhub/list_managed_instance_updatable_packages_request_response.go new file mode 100644 index 0000000000..cdfd621968 --- /dev/null +++ b/osmanagementhub/list_managed_instance_updatable_packages_request_response.go @@ -0,0 +1,221 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstanceUpdatablePackagesRequest wrapper for the ListManagedInstanceUpdatablePackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceUpdatablePackages.go.html to see an example of how to use ListManagedInstanceUpdatablePackagesRequest. +type ListManagedInstanceUpdatablePackagesRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // A filter to return only packages that match the given update classification type. + ClassificationType []ClassificationTypesEnum `contributesTo:"query" name:"classificationType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The assigned erratum name. It's unique and not changeable. + // Example: `ELSA-2020-5804` + AdvisoryName []string `contributesTo:"query" name:"advisoryName" collectionFormat:"multi"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstanceUpdatablePackagesSortOrderEnum `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 ListManagedInstanceUpdatablePackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstanceUpdatablePackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstanceUpdatablePackagesRequest) 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 ListManagedInstanceUpdatablePackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstanceUpdatablePackagesRequest) 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 ListManagedInstanceUpdatablePackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.ClassificationType { + if _, ok := GetMappingClassificationTypesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ClassificationType: %s. Supported values are: %s.", val, strings.Join(GetClassificationTypesEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListManagedInstanceUpdatablePackagesSortOrderEnum(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(GetListManagedInstanceUpdatablePackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstanceUpdatablePackagesSortByEnum(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(GetListManagedInstanceUpdatablePackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstanceUpdatablePackagesResponse wrapper for the ListManagedInstanceUpdatablePackages operation +type ListManagedInstanceUpdatablePackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of UpdatablePackageCollection instances + UpdatablePackageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstanceUpdatablePackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstanceUpdatablePackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstanceUpdatablePackagesSortOrderEnum Enum with underlying type: string +type ListManagedInstanceUpdatablePackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstanceUpdatablePackagesSortOrderEnum +const ( + ListManagedInstanceUpdatablePackagesSortOrderAsc ListManagedInstanceUpdatablePackagesSortOrderEnum = "ASC" + ListManagedInstanceUpdatablePackagesSortOrderDesc ListManagedInstanceUpdatablePackagesSortOrderEnum = "DESC" +) + +var mappingListManagedInstanceUpdatablePackagesSortOrderEnum = map[string]ListManagedInstanceUpdatablePackagesSortOrderEnum{ + "ASC": ListManagedInstanceUpdatablePackagesSortOrderAsc, + "DESC": ListManagedInstanceUpdatablePackagesSortOrderDesc, +} + +var mappingListManagedInstanceUpdatablePackagesSortOrderEnumLowerCase = map[string]ListManagedInstanceUpdatablePackagesSortOrderEnum{ + "asc": ListManagedInstanceUpdatablePackagesSortOrderAsc, + "desc": ListManagedInstanceUpdatablePackagesSortOrderDesc, +} + +// GetListManagedInstanceUpdatablePackagesSortOrderEnumValues Enumerates the set of values for ListManagedInstanceUpdatablePackagesSortOrderEnum +func GetListManagedInstanceUpdatablePackagesSortOrderEnumValues() []ListManagedInstanceUpdatablePackagesSortOrderEnum { + values := make([]ListManagedInstanceUpdatablePackagesSortOrderEnum, 0) + for _, v := range mappingListManagedInstanceUpdatablePackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceUpdatablePackagesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstanceUpdatablePackagesSortOrderEnum +func GetListManagedInstanceUpdatablePackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstanceUpdatablePackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceUpdatablePackagesSortOrderEnum(val string) (ListManagedInstanceUpdatablePackagesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstanceUpdatablePackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstanceUpdatablePackagesSortByEnum Enum with underlying type: string +type ListManagedInstanceUpdatablePackagesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstanceUpdatablePackagesSortByEnum +const ( + ListManagedInstanceUpdatablePackagesSortByTimecreated ListManagedInstanceUpdatablePackagesSortByEnum = "timeCreated" + ListManagedInstanceUpdatablePackagesSortByDisplayname ListManagedInstanceUpdatablePackagesSortByEnum = "displayName" +) + +var mappingListManagedInstanceUpdatablePackagesSortByEnum = map[string]ListManagedInstanceUpdatablePackagesSortByEnum{ + "timeCreated": ListManagedInstanceUpdatablePackagesSortByTimecreated, + "displayName": ListManagedInstanceUpdatablePackagesSortByDisplayname, +} + +var mappingListManagedInstanceUpdatablePackagesSortByEnumLowerCase = map[string]ListManagedInstanceUpdatablePackagesSortByEnum{ + "timecreated": ListManagedInstanceUpdatablePackagesSortByTimecreated, + "displayname": ListManagedInstanceUpdatablePackagesSortByDisplayname, +} + +// GetListManagedInstanceUpdatablePackagesSortByEnumValues Enumerates the set of values for ListManagedInstanceUpdatablePackagesSortByEnum +func GetListManagedInstanceUpdatablePackagesSortByEnumValues() []ListManagedInstanceUpdatablePackagesSortByEnum { + values := make([]ListManagedInstanceUpdatablePackagesSortByEnum, 0) + for _, v := range mappingListManagedInstanceUpdatablePackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstanceUpdatablePackagesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstanceUpdatablePackagesSortByEnum +func GetListManagedInstanceUpdatablePackagesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstanceUpdatablePackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstanceUpdatablePackagesSortByEnum(val string) (ListManagedInstanceUpdatablePackagesSortByEnum, bool) { + enum, ok := mappingListManagedInstanceUpdatablePackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_managed_instances_request_response.go b/osmanagementhub/list_managed_instances_request_response.go new file mode 100644 index 0000000000..d3ed1a6ac6 --- /dev/null +++ b/osmanagementhub/list_managed_instances_request_response.go @@ -0,0 +1,260 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagedInstancesRequest wrapper for the ListManagedInstances operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstances.go.html to see an example of how to use ListManagedInstancesRequest. +type ListManagedInstancesRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The OCID of the managed instance for which to list resources. + ManagedInstanceId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceId"` + + // A filter to return only instances whose managed instance status matches the given status. + Status []ManagedInstanceStatusEnum `contributesTo:"query" name:"status" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only instances whose architecture type matches the given architecture. + ArchType []ArchTypeEnum `contributesTo:"query" name:"archType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only instances whose OS family type matches the given OS family. + OsFamily []OsFamilyEnum `contributesTo:"query" name:"osFamily" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only managed instances acting as management stations. + IsManagementStation *bool `mandatory:"false" contributesTo:"query" name:"isManagementStation"` + + // A filter to return only managed instances that are attached to the specified group. + Group *string `mandatory:"false" contributesTo:"query" name:"group"` + + // A filter to return only managed instances that are NOT attached to the specified group. + GroupNotEqualTo *string `mandatory:"false" contributesTo:"query" name:"groupNotEqualTo"` + + // A filter to return only managed instances that are associated with the specified lifecycle environment. + LifecycleStage *string `mandatory:"false" contributesTo:"query" name:"lifecycleStage"` + + // A filter to return only managed instances that are NOT associated with the specified lifecycle environment. + LifecycleStageNotEqualTo *string `mandatory:"false" contributesTo:"query" name:"lifecycleStageNotEqualTo"` + + // A filter to return only managed instances that are attached to the specified group or lifecycle environment. + IsAttachedToGroupOrLifecycleStage *bool `mandatory:"false" contributesTo:"query" name:"isAttachedToGroupOrLifecycleStage"` + + // The OCID for the software source. + SoftwareSourceId *string `mandatory:"false" contributesTo:"query" name:"softwareSourceId"` + + // The assigned erratum name. It's unique and not changeable. + // Example: `ELSA-2020-5804` + AdvisoryName []string `contributesTo:"query" name:"advisoryName" collectionFormat:"multi"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagedInstancesSortOrderEnum `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 ListManagedInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListManagedInstancesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagedInstancesRequest) 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 ListManagedInstancesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagedInstancesRequest) 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 ListManagedInstancesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.Status { + if _, ok := GetMappingManagedInstanceStatusEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", val, strings.Join(GetManagedInstanceStatusEnumStringValues(), ","))) + } + } + + for _, val := range request.ArchType { + if _, ok := GetMappingArchTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", val, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + } + + for _, val := range request.OsFamily { + if _, ok := GetMappingOsFamilyEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", val, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListManagedInstancesSortOrderEnum(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(GetListManagedInstancesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagedInstancesSortByEnum(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(GetListManagedInstancesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagedInstancesResponse wrapper for the ListManagedInstances operation +type ListManagedInstancesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceCollection instances + ManagedInstanceCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagedInstancesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagedInstancesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagedInstancesSortOrderEnum Enum with underlying type: string +type ListManagedInstancesSortOrderEnum string + +// Set of constants representing the allowable values for ListManagedInstancesSortOrderEnum +const ( + ListManagedInstancesSortOrderAsc ListManagedInstancesSortOrderEnum = "ASC" + ListManagedInstancesSortOrderDesc ListManagedInstancesSortOrderEnum = "DESC" +) + +var mappingListManagedInstancesSortOrderEnum = map[string]ListManagedInstancesSortOrderEnum{ + "ASC": ListManagedInstancesSortOrderAsc, + "DESC": ListManagedInstancesSortOrderDesc, +} + +var mappingListManagedInstancesSortOrderEnumLowerCase = map[string]ListManagedInstancesSortOrderEnum{ + "asc": ListManagedInstancesSortOrderAsc, + "desc": ListManagedInstancesSortOrderDesc, +} + +// GetListManagedInstancesSortOrderEnumValues Enumerates the set of values for ListManagedInstancesSortOrderEnum +func GetListManagedInstancesSortOrderEnumValues() []ListManagedInstancesSortOrderEnum { + values := make([]ListManagedInstancesSortOrderEnum, 0) + for _, v := range mappingListManagedInstancesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstancesSortOrderEnumStringValues Enumerates the set of values in String for ListManagedInstancesSortOrderEnum +func GetListManagedInstancesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagedInstancesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstancesSortOrderEnum(val string) (ListManagedInstancesSortOrderEnum, bool) { + enum, ok := mappingListManagedInstancesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagedInstancesSortByEnum Enum with underlying type: string +type ListManagedInstancesSortByEnum string + +// Set of constants representing the allowable values for ListManagedInstancesSortByEnum +const ( + ListManagedInstancesSortByTimecreated ListManagedInstancesSortByEnum = "timeCreated" + ListManagedInstancesSortByDisplayname ListManagedInstancesSortByEnum = "displayName" +) + +var mappingListManagedInstancesSortByEnum = map[string]ListManagedInstancesSortByEnum{ + "timeCreated": ListManagedInstancesSortByTimecreated, + "displayName": ListManagedInstancesSortByDisplayname, +} + +var mappingListManagedInstancesSortByEnumLowerCase = map[string]ListManagedInstancesSortByEnum{ + "timecreated": ListManagedInstancesSortByTimecreated, + "displayname": ListManagedInstancesSortByDisplayname, +} + +// GetListManagedInstancesSortByEnumValues Enumerates the set of values for ListManagedInstancesSortByEnum +func GetListManagedInstancesSortByEnumValues() []ListManagedInstancesSortByEnum { + values := make([]ListManagedInstancesSortByEnum, 0) + for _, v := range mappingListManagedInstancesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagedInstancesSortByEnumStringValues Enumerates the set of values in String for ListManagedInstancesSortByEnum +func GetListManagedInstancesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagedInstancesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagedInstancesSortByEnum(val string) (ListManagedInstancesSortByEnum, bool) { + enum, ok := mappingListManagedInstancesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_management_stations_request_response.go b/osmanagementhub/list_management_stations_request_response.go new file mode 100644 index 0000000000..6c6aeafd8a --- /dev/null +++ b/osmanagementhub/list_management_stations_request_response.go @@ -0,0 +1,218 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListManagementStationsRequest wrapper for the ListManagementStations operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagementStations.go.html to see an example of how to use ListManagementStationsRequest. +type ListManagementStationsRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Example: `My new resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The current lifecycle state for the object. + LifecycleState ManagementStationLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The OCID of the managed instance for which to list resources. + ManagedInstanceId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListManagementStationsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListManagementStationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The OCID of the management station. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListManagementStationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListManagementStationsRequest) 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 ListManagementStationsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListManagementStationsRequest) 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 ListManagementStationsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingManagementStationLifecycleStateEnum(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(GetManagementStationLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagementStationsSortOrderEnum(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(GetListManagementStationsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListManagementStationsSortByEnum(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(GetListManagementStationsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListManagementStationsResponse wrapper for the ListManagementStations operation +type ListManagementStationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagementStationCollection instances + ManagementStationCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListManagementStationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListManagementStationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListManagementStationsSortOrderEnum Enum with underlying type: string +type ListManagementStationsSortOrderEnum string + +// Set of constants representing the allowable values for ListManagementStationsSortOrderEnum +const ( + ListManagementStationsSortOrderAsc ListManagementStationsSortOrderEnum = "ASC" + ListManagementStationsSortOrderDesc ListManagementStationsSortOrderEnum = "DESC" +) + +var mappingListManagementStationsSortOrderEnum = map[string]ListManagementStationsSortOrderEnum{ + "ASC": ListManagementStationsSortOrderAsc, + "DESC": ListManagementStationsSortOrderDesc, +} + +var mappingListManagementStationsSortOrderEnumLowerCase = map[string]ListManagementStationsSortOrderEnum{ + "asc": ListManagementStationsSortOrderAsc, + "desc": ListManagementStationsSortOrderDesc, +} + +// GetListManagementStationsSortOrderEnumValues Enumerates the set of values for ListManagementStationsSortOrderEnum +func GetListManagementStationsSortOrderEnumValues() []ListManagementStationsSortOrderEnum { + values := make([]ListManagementStationsSortOrderEnum, 0) + for _, v := range mappingListManagementStationsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListManagementStationsSortOrderEnumStringValues Enumerates the set of values in String for ListManagementStationsSortOrderEnum +func GetListManagementStationsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListManagementStationsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagementStationsSortOrderEnum(val string) (ListManagementStationsSortOrderEnum, bool) { + enum, ok := mappingListManagementStationsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListManagementStationsSortByEnum Enum with underlying type: string +type ListManagementStationsSortByEnum string + +// Set of constants representing the allowable values for ListManagementStationsSortByEnum +const ( + ListManagementStationsSortByTimecreated ListManagementStationsSortByEnum = "timeCreated" + ListManagementStationsSortByDisplayname ListManagementStationsSortByEnum = "displayName" +) + +var mappingListManagementStationsSortByEnum = map[string]ListManagementStationsSortByEnum{ + "timeCreated": ListManagementStationsSortByTimecreated, + "displayName": ListManagementStationsSortByDisplayname, +} + +var mappingListManagementStationsSortByEnumLowerCase = map[string]ListManagementStationsSortByEnum{ + "timecreated": ListManagementStationsSortByTimecreated, + "displayname": ListManagementStationsSortByDisplayname, +} + +// GetListManagementStationsSortByEnumValues Enumerates the set of values for ListManagementStationsSortByEnum +func GetListManagementStationsSortByEnumValues() []ListManagementStationsSortByEnum { + values := make([]ListManagementStationsSortByEnum, 0) + for _, v := range mappingListManagementStationsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListManagementStationsSortByEnumStringValues Enumerates the set of values in String for ListManagementStationsSortByEnum +func GetListManagementStationsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListManagementStationsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagementStationsSortByEnum(val string) (ListManagementStationsSortByEnum, bool) { + enum, ok := mappingListManagementStationsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_mirrors_request_response.go b/osmanagementhub/list_mirrors_request_response.go new file mode 100644 index 0000000000..27914b6570 --- /dev/null +++ b/osmanagementhub/list_mirrors_request_response.go @@ -0,0 +1,215 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListMirrorsRequest wrapper for the ListMirrors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListMirrors.go.html to see an example of how to use ListMirrorsRequest. +type ListMirrorsRequest struct { + + // The OCID of the management station. + ManagementStationId *string `mandatory:"true" contributesTo:"path" name:"managementStationId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Example: `My new resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListMirrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListMirrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // List of Mirror state to filter by + MirrorStates []MirrorStateEnum `contributesTo:"query" name:"mirrorStates" omitEmpty:"true" collectionFormat:"multi"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListMirrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListMirrorsRequest) 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 ListMirrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMirrorsRequest) 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 ListMirrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListMirrorsSortOrderEnum(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(GetListMirrorsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListMirrorsSortByEnum(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(GetListMirrorsSortByEnumStringValues(), ","))) + } + for _, val := range request.MirrorStates { + if _, ok := GetMappingMirrorStateEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MirrorStates: %s. Supported values are: %s.", val, strings.Join(GetMirrorStateEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListMirrorsResponse wrapper for the ListMirrors operation +type ListMirrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of MirrorsCollection instances + MirrorsCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListMirrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListMirrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListMirrorsSortOrderEnum Enum with underlying type: string +type ListMirrorsSortOrderEnum string + +// Set of constants representing the allowable values for ListMirrorsSortOrderEnum +const ( + ListMirrorsSortOrderAsc ListMirrorsSortOrderEnum = "ASC" + ListMirrorsSortOrderDesc ListMirrorsSortOrderEnum = "DESC" +) + +var mappingListMirrorsSortOrderEnum = map[string]ListMirrorsSortOrderEnum{ + "ASC": ListMirrorsSortOrderAsc, + "DESC": ListMirrorsSortOrderDesc, +} + +var mappingListMirrorsSortOrderEnumLowerCase = map[string]ListMirrorsSortOrderEnum{ + "asc": ListMirrorsSortOrderAsc, + "desc": ListMirrorsSortOrderDesc, +} + +// GetListMirrorsSortOrderEnumValues Enumerates the set of values for ListMirrorsSortOrderEnum +func GetListMirrorsSortOrderEnumValues() []ListMirrorsSortOrderEnum { + values := make([]ListMirrorsSortOrderEnum, 0) + for _, v := range mappingListMirrorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListMirrorsSortOrderEnumStringValues Enumerates the set of values in String for ListMirrorsSortOrderEnum +func GetListMirrorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListMirrorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMirrorsSortOrderEnum(val string) (ListMirrorsSortOrderEnum, bool) { + enum, ok := mappingListMirrorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListMirrorsSortByEnum Enum with underlying type: string +type ListMirrorsSortByEnum string + +// Set of constants representing the allowable values for ListMirrorsSortByEnum +const ( + ListMirrorsSortByTimecreated ListMirrorsSortByEnum = "timeCreated" + ListMirrorsSortByDisplayname ListMirrorsSortByEnum = "displayName" +) + +var mappingListMirrorsSortByEnum = map[string]ListMirrorsSortByEnum{ + "timeCreated": ListMirrorsSortByTimecreated, + "displayName": ListMirrorsSortByDisplayname, +} + +var mappingListMirrorsSortByEnumLowerCase = map[string]ListMirrorsSortByEnum{ + "timecreated": ListMirrorsSortByTimecreated, + "displayname": ListMirrorsSortByDisplayname, +} + +// GetListMirrorsSortByEnumValues Enumerates the set of values for ListMirrorsSortByEnum +func GetListMirrorsSortByEnumValues() []ListMirrorsSortByEnum { + values := make([]ListMirrorsSortByEnum, 0) + for _, v := range mappingListMirrorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListMirrorsSortByEnumStringValues Enumerates the set of values in String for ListMirrorsSortByEnum +func GetListMirrorsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListMirrorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMirrorsSortByEnum(val string) (ListMirrorsSortByEnum, bool) { + enum, ok := mappingListMirrorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_module_stream_profiles_request_response.go b/osmanagementhub/list_module_stream_profiles_request_response.go new file mode 100644 index 0000000000..bdbe486f5c --- /dev/null +++ b/osmanagementhub/list_module_stream_profiles_request_response.go @@ -0,0 +1,206 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListModuleStreamProfilesRequest wrapper for the ListModuleStreamProfiles operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListModuleStreamProfiles.go.html to see an example of how to use ListModuleStreamProfilesRequest. +type ListModuleStreamProfilesRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The name of a module. This parameter is required if a + // streamName is specified. + ModuleName *string `mandatory:"false" contributesTo:"query" name:"moduleName"` + + // The name of the stream of the containing module. This parameter + // is required if a profileName is specified. + StreamName *string `mandatory:"false" contributesTo:"query" name:"streamName"` + + // The name of the entity to be queried. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListModuleStreamProfilesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for moduleName is ascending. + SortBy ListModuleStreamProfilesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListModuleStreamProfilesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListModuleStreamProfilesRequest) 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 ListModuleStreamProfilesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListModuleStreamProfilesRequest) 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 ListModuleStreamProfilesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListModuleStreamProfilesSortOrderEnum(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(GetListModuleStreamProfilesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListModuleStreamProfilesSortByEnum(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(GetListModuleStreamProfilesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListModuleStreamProfilesResponse wrapper for the ListModuleStreamProfiles operation +type ListModuleStreamProfilesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ModuleStreamProfileCollection instances + ModuleStreamProfileCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListModuleStreamProfilesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListModuleStreamProfilesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListModuleStreamProfilesSortOrderEnum Enum with underlying type: string +type ListModuleStreamProfilesSortOrderEnum string + +// Set of constants representing the allowable values for ListModuleStreamProfilesSortOrderEnum +const ( + ListModuleStreamProfilesSortOrderAsc ListModuleStreamProfilesSortOrderEnum = "ASC" + ListModuleStreamProfilesSortOrderDesc ListModuleStreamProfilesSortOrderEnum = "DESC" +) + +var mappingListModuleStreamProfilesSortOrderEnum = map[string]ListModuleStreamProfilesSortOrderEnum{ + "ASC": ListModuleStreamProfilesSortOrderAsc, + "DESC": ListModuleStreamProfilesSortOrderDesc, +} + +var mappingListModuleStreamProfilesSortOrderEnumLowerCase = map[string]ListModuleStreamProfilesSortOrderEnum{ + "asc": ListModuleStreamProfilesSortOrderAsc, + "desc": ListModuleStreamProfilesSortOrderDesc, +} + +// GetListModuleStreamProfilesSortOrderEnumValues Enumerates the set of values for ListModuleStreamProfilesSortOrderEnum +func GetListModuleStreamProfilesSortOrderEnumValues() []ListModuleStreamProfilesSortOrderEnum { + values := make([]ListModuleStreamProfilesSortOrderEnum, 0) + for _, v := range mappingListModuleStreamProfilesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListModuleStreamProfilesSortOrderEnumStringValues Enumerates the set of values in String for ListModuleStreamProfilesSortOrderEnum +func GetListModuleStreamProfilesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListModuleStreamProfilesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModuleStreamProfilesSortOrderEnum(val string) (ListModuleStreamProfilesSortOrderEnum, bool) { + enum, ok := mappingListModuleStreamProfilesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModuleStreamProfilesSortByEnum Enum with underlying type: string +type ListModuleStreamProfilesSortByEnum string + +// Set of constants representing the allowable values for ListModuleStreamProfilesSortByEnum +const ( + ListModuleStreamProfilesSortByModulename ListModuleStreamProfilesSortByEnum = "moduleName" +) + +var mappingListModuleStreamProfilesSortByEnum = map[string]ListModuleStreamProfilesSortByEnum{ + "moduleName": ListModuleStreamProfilesSortByModulename, +} + +var mappingListModuleStreamProfilesSortByEnumLowerCase = map[string]ListModuleStreamProfilesSortByEnum{ + "modulename": ListModuleStreamProfilesSortByModulename, +} + +// GetListModuleStreamProfilesSortByEnumValues Enumerates the set of values for ListModuleStreamProfilesSortByEnum +func GetListModuleStreamProfilesSortByEnumValues() []ListModuleStreamProfilesSortByEnum { + values := make([]ListModuleStreamProfilesSortByEnum, 0) + for _, v := range mappingListModuleStreamProfilesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListModuleStreamProfilesSortByEnumStringValues Enumerates the set of values in String for ListModuleStreamProfilesSortByEnum +func GetListModuleStreamProfilesSortByEnumStringValues() []string { + return []string{ + "moduleName", + } +} + +// GetMappingListModuleStreamProfilesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModuleStreamProfilesSortByEnum(val string) (ListModuleStreamProfilesSortByEnum, bool) { + enum, ok := mappingListModuleStreamProfilesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_module_streams_request_response.go b/osmanagementhub/list_module_streams_request_response.go new file mode 100644 index 0000000000..57d57faa0b --- /dev/null +++ b/osmanagementhub/list_module_streams_request_response.go @@ -0,0 +1,210 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListModuleStreamsRequest wrapper for the ListModuleStreams operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListModuleStreams.go.html to see an example of how to use ListModuleStreamsRequest. +type ListModuleStreamsRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The name of a module. This parameter is required if a + // streamName is specified. + ModuleName *string `mandatory:"false" contributesTo:"query" name:"moduleName"` + + // The name of the entity to be queried. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A boolean variable that is used to list only the latest versions of packages, module streams, + // and stream profiles when set to true. All packages, module streams, and stream profiles are + // returned when set to false. + IsLatest *bool `mandatory:"false" contributesTo:"query" name:"isLatest"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListModuleStreamsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for moduleName is ascending. + SortBy ListModuleStreamsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // A filter to return resources that may partially match the module name given. + ModuleNameContains *string `mandatory:"false" contributesTo:"query" name:"moduleNameContains"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListModuleStreamsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListModuleStreamsRequest) 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 ListModuleStreamsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListModuleStreamsRequest) 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 ListModuleStreamsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListModuleStreamsSortOrderEnum(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(GetListModuleStreamsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListModuleStreamsSortByEnum(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(GetListModuleStreamsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListModuleStreamsResponse wrapper for the ListModuleStreams operation +type ListModuleStreamsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ModuleStreamCollection instances + ModuleStreamCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListModuleStreamsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListModuleStreamsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListModuleStreamsSortOrderEnum Enum with underlying type: string +type ListModuleStreamsSortOrderEnum string + +// Set of constants representing the allowable values for ListModuleStreamsSortOrderEnum +const ( + ListModuleStreamsSortOrderAsc ListModuleStreamsSortOrderEnum = "ASC" + ListModuleStreamsSortOrderDesc ListModuleStreamsSortOrderEnum = "DESC" +) + +var mappingListModuleStreamsSortOrderEnum = map[string]ListModuleStreamsSortOrderEnum{ + "ASC": ListModuleStreamsSortOrderAsc, + "DESC": ListModuleStreamsSortOrderDesc, +} + +var mappingListModuleStreamsSortOrderEnumLowerCase = map[string]ListModuleStreamsSortOrderEnum{ + "asc": ListModuleStreamsSortOrderAsc, + "desc": ListModuleStreamsSortOrderDesc, +} + +// GetListModuleStreamsSortOrderEnumValues Enumerates the set of values for ListModuleStreamsSortOrderEnum +func GetListModuleStreamsSortOrderEnumValues() []ListModuleStreamsSortOrderEnum { + values := make([]ListModuleStreamsSortOrderEnum, 0) + for _, v := range mappingListModuleStreamsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListModuleStreamsSortOrderEnumStringValues Enumerates the set of values in String for ListModuleStreamsSortOrderEnum +func GetListModuleStreamsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListModuleStreamsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModuleStreamsSortOrderEnum(val string) (ListModuleStreamsSortOrderEnum, bool) { + enum, ok := mappingListModuleStreamsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModuleStreamsSortByEnum Enum with underlying type: string +type ListModuleStreamsSortByEnum string + +// Set of constants representing the allowable values for ListModuleStreamsSortByEnum +const ( + ListModuleStreamsSortByModulename ListModuleStreamsSortByEnum = "moduleName" +) + +var mappingListModuleStreamsSortByEnum = map[string]ListModuleStreamsSortByEnum{ + "moduleName": ListModuleStreamsSortByModulename, +} + +var mappingListModuleStreamsSortByEnumLowerCase = map[string]ListModuleStreamsSortByEnum{ + "modulename": ListModuleStreamsSortByModulename, +} + +// GetListModuleStreamsSortByEnumValues Enumerates the set of values for ListModuleStreamsSortByEnum +func GetListModuleStreamsSortByEnumValues() []ListModuleStreamsSortByEnum { + values := make([]ListModuleStreamsSortByEnum, 0) + for _, v := range mappingListModuleStreamsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListModuleStreamsSortByEnumStringValues Enumerates the set of values in String for ListModuleStreamsSortByEnum +func GetListModuleStreamsSortByEnumStringValues() []string { + return []string{ + "moduleName", + } +} + +// GetMappingListModuleStreamsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModuleStreamsSortByEnum(val string) (ListModuleStreamsSortByEnum, bool) { + enum, ok := mappingListModuleStreamsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_package_groups_request_response.go b/osmanagementhub/list_package_groups_request_response.go new file mode 100644 index 0000000000..f62981160b --- /dev/null +++ b/osmanagementhub/list_package_groups_request_response.go @@ -0,0 +1,217 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListPackageGroupsRequest wrapper for the ListPackageGroups operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListPackageGroups.go.html to see an example of how to use ListPackageGroupsRequest. +type ListPackageGroupsRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The name of the entity to be queried. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return resources that may partially match the name given. + NameContains *string `mandatory:"false" contributesTo:"query" name:"nameContains"` + + // A filter to return only package groups of the specified type. + GroupType []PackageGroupGroupTypeEnum `contributesTo:"query" name:"groupType" omitEmpty:"true" collectionFormat:"multi"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListPackageGroupsSortOrderEnum `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 ListPackageGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListPackageGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListPackageGroupsRequest) 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 ListPackageGroupsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPackageGroupsRequest) 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 ListPackageGroupsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.GroupType { + if _, ok := GetMappingPackageGroupGroupTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for GroupType: %s. Supported values are: %s.", val, strings.Join(GetPackageGroupGroupTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListPackageGroupsSortOrderEnum(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(GetListPackageGroupsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListPackageGroupsSortByEnum(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(GetListPackageGroupsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListPackageGroupsResponse wrapper for the ListPackageGroups operation +type ListPackageGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of PackageGroupCollection instances + PackageGroupCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListPackageGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListPackageGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListPackageGroupsSortOrderEnum Enum with underlying type: string +type ListPackageGroupsSortOrderEnum string + +// Set of constants representing the allowable values for ListPackageGroupsSortOrderEnum +const ( + ListPackageGroupsSortOrderAsc ListPackageGroupsSortOrderEnum = "ASC" + ListPackageGroupsSortOrderDesc ListPackageGroupsSortOrderEnum = "DESC" +) + +var mappingListPackageGroupsSortOrderEnum = map[string]ListPackageGroupsSortOrderEnum{ + "ASC": ListPackageGroupsSortOrderAsc, + "DESC": ListPackageGroupsSortOrderDesc, +} + +var mappingListPackageGroupsSortOrderEnumLowerCase = map[string]ListPackageGroupsSortOrderEnum{ + "asc": ListPackageGroupsSortOrderAsc, + "desc": ListPackageGroupsSortOrderDesc, +} + +// GetListPackageGroupsSortOrderEnumValues Enumerates the set of values for ListPackageGroupsSortOrderEnum +func GetListPackageGroupsSortOrderEnumValues() []ListPackageGroupsSortOrderEnum { + values := make([]ListPackageGroupsSortOrderEnum, 0) + for _, v := range mappingListPackageGroupsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListPackageGroupsSortOrderEnumStringValues Enumerates the set of values in String for ListPackageGroupsSortOrderEnum +func GetListPackageGroupsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListPackageGroupsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPackageGroupsSortOrderEnum(val string) (ListPackageGroupsSortOrderEnum, bool) { + enum, ok := mappingListPackageGroupsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListPackageGroupsSortByEnum Enum with underlying type: string +type ListPackageGroupsSortByEnum string + +// Set of constants representing the allowable values for ListPackageGroupsSortByEnum +const ( + ListPackageGroupsSortByTimecreated ListPackageGroupsSortByEnum = "timeCreated" + ListPackageGroupsSortByDisplayname ListPackageGroupsSortByEnum = "displayName" +) + +var mappingListPackageGroupsSortByEnum = map[string]ListPackageGroupsSortByEnum{ + "timeCreated": ListPackageGroupsSortByTimecreated, + "displayName": ListPackageGroupsSortByDisplayname, +} + +var mappingListPackageGroupsSortByEnumLowerCase = map[string]ListPackageGroupsSortByEnum{ + "timecreated": ListPackageGroupsSortByTimecreated, + "displayname": ListPackageGroupsSortByDisplayname, +} + +// GetListPackageGroupsSortByEnumValues Enumerates the set of values for ListPackageGroupsSortByEnum +func GetListPackageGroupsSortByEnumValues() []ListPackageGroupsSortByEnum { + values := make([]ListPackageGroupsSortByEnum, 0) + for _, v := range mappingListPackageGroupsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListPackageGroupsSortByEnumStringValues Enumerates the set of values in String for ListPackageGroupsSortByEnum +func GetListPackageGroupsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListPackageGroupsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPackageGroupsSortByEnum(val string) (ListPackageGroupsSortByEnum, bool) { + enum, ok := mappingListPackageGroupsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_profiles_request_response.go b/osmanagementhub/list_profiles_request_response.go new file mode 100644 index 0000000000..59ab85ccd7 --- /dev/null +++ b/osmanagementhub/list_profiles_request_response.go @@ -0,0 +1,381 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListProfilesRequest wrapper for the ListProfiles operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListProfiles.go.html to see an example of how to use ListProfilesRequest. +type ListProfilesRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // A filter to return registration profiles that match the given profileType. + ProfileType []ProfileTypeEnum `contributesTo:"query" name:"profileType" omitEmpty:"true" collectionFormat:"multi"` + + // The OCID of the registration profile. + ProfileId *string `mandatory:"false" contributesTo:"query" name:"profileId"` + + // A filter to return only profiles that match the given osFamily. + OsFamily ListProfilesOsFamilyEnum `mandatory:"false" contributesTo:"query" name:"osFamily" omitEmpty:"true"` + + // A filter to return only profiles that match the given archType. + ArchType ListProfilesArchTypeEnum `mandatory:"false" contributesTo:"query" name:"archType" omitEmpty:"true"` + + // A filter to return only profiles that match the given vendorName. + VendorName ListProfilesVendorNameEnum `mandatory:"false" contributesTo:"query" name:"vendorName" omitEmpty:"true"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only registration profile whose lifecycleState matches the given lifecycleState. + LifecycleState ProfileLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListProfilesSortOrderEnum `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 ListProfilesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListProfilesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListProfilesRequest) 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 ListProfilesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListProfilesRequest) 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 ListProfilesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.ProfileType { + if _, ok := GetMappingProfileTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ProfileType: %s. Supported values are: %s.", val, strings.Join(GetProfileTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListProfilesOsFamilyEnum(string(request.OsFamily)); !ok && request.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", request.OsFamily, strings.Join(GetListProfilesOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingListProfilesArchTypeEnum(string(request.ArchType)); !ok && request.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", request.ArchType, strings.Join(GetListProfilesArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListProfilesVendorNameEnum(string(request.VendorName)); !ok && request.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", request.VendorName, strings.Join(GetListProfilesVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingProfileLifecycleStateEnum(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(GetProfileLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListProfilesSortOrderEnum(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(GetListProfilesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListProfilesSortByEnum(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(GetListProfilesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListProfilesResponse wrapper for the ListProfiles operation +type ListProfilesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ProfileCollection instances + ProfileCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListProfilesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListProfilesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListProfilesOsFamilyEnum Enum with underlying type: string +type ListProfilesOsFamilyEnum string + +// Set of constants representing the allowable values for ListProfilesOsFamilyEnum +const ( + ListProfilesOsFamily9 ListProfilesOsFamilyEnum = "ORACLE_LINUX_9" + ListProfilesOsFamily8 ListProfilesOsFamilyEnum = "ORACLE_LINUX_8" + ListProfilesOsFamily7 ListProfilesOsFamilyEnum = "ORACLE_LINUX_7" +) + +var mappingListProfilesOsFamilyEnum = map[string]ListProfilesOsFamilyEnum{ + "ORACLE_LINUX_9": ListProfilesOsFamily9, + "ORACLE_LINUX_8": ListProfilesOsFamily8, + "ORACLE_LINUX_7": ListProfilesOsFamily7, +} + +var mappingListProfilesOsFamilyEnumLowerCase = map[string]ListProfilesOsFamilyEnum{ + "oracle_linux_9": ListProfilesOsFamily9, + "oracle_linux_8": ListProfilesOsFamily8, + "oracle_linux_7": ListProfilesOsFamily7, +} + +// GetListProfilesOsFamilyEnumValues Enumerates the set of values for ListProfilesOsFamilyEnum +func GetListProfilesOsFamilyEnumValues() []ListProfilesOsFamilyEnum { + values := make([]ListProfilesOsFamilyEnum, 0) + for _, v := range mappingListProfilesOsFamilyEnum { + values = append(values, v) + } + return values +} + +// GetListProfilesOsFamilyEnumStringValues Enumerates the set of values in String for ListProfilesOsFamilyEnum +func GetListProfilesOsFamilyEnumStringValues() []string { + return []string{ + "ORACLE_LINUX_9", + "ORACLE_LINUX_8", + "ORACLE_LINUX_7", + } +} + +// GetMappingListProfilesOsFamilyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListProfilesOsFamilyEnum(val string) (ListProfilesOsFamilyEnum, bool) { + enum, ok := mappingListProfilesOsFamilyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListProfilesArchTypeEnum Enum with underlying type: string +type ListProfilesArchTypeEnum string + +// Set of constants representing the allowable values for ListProfilesArchTypeEnum +const ( + ListProfilesArchTypeX8664 ListProfilesArchTypeEnum = "X86_64" + ListProfilesArchTypeAarch64 ListProfilesArchTypeEnum = "AARCH64" + ListProfilesArchTypeI686 ListProfilesArchTypeEnum = "I686" + ListProfilesArchTypeNoarch ListProfilesArchTypeEnum = "NOARCH" + ListProfilesArchTypeSrc ListProfilesArchTypeEnum = "SRC" +) + +var mappingListProfilesArchTypeEnum = map[string]ListProfilesArchTypeEnum{ + "X86_64": ListProfilesArchTypeX8664, + "AARCH64": ListProfilesArchTypeAarch64, + "I686": ListProfilesArchTypeI686, + "NOARCH": ListProfilesArchTypeNoarch, + "SRC": ListProfilesArchTypeSrc, +} + +var mappingListProfilesArchTypeEnumLowerCase = map[string]ListProfilesArchTypeEnum{ + "x86_64": ListProfilesArchTypeX8664, + "aarch64": ListProfilesArchTypeAarch64, + "i686": ListProfilesArchTypeI686, + "noarch": ListProfilesArchTypeNoarch, + "src": ListProfilesArchTypeSrc, +} + +// GetListProfilesArchTypeEnumValues Enumerates the set of values for ListProfilesArchTypeEnum +func GetListProfilesArchTypeEnumValues() []ListProfilesArchTypeEnum { + values := make([]ListProfilesArchTypeEnum, 0) + for _, v := range mappingListProfilesArchTypeEnum { + values = append(values, v) + } + return values +} + +// GetListProfilesArchTypeEnumStringValues Enumerates the set of values in String for ListProfilesArchTypeEnum +func GetListProfilesArchTypeEnumStringValues() []string { + return []string{ + "X86_64", + "AARCH64", + "I686", + "NOARCH", + "SRC", + } +} + +// GetMappingListProfilesArchTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListProfilesArchTypeEnum(val string) (ListProfilesArchTypeEnum, bool) { + enum, ok := mappingListProfilesArchTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListProfilesVendorNameEnum Enum with underlying type: string +type ListProfilesVendorNameEnum string + +// Set of constants representing the allowable values for ListProfilesVendorNameEnum +const ( + ListProfilesVendorNameOracle ListProfilesVendorNameEnum = "ORACLE" +) + +var mappingListProfilesVendorNameEnum = map[string]ListProfilesVendorNameEnum{ + "ORACLE": ListProfilesVendorNameOracle, +} + +var mappingListProfilesVendorNameEnumLowerCase = map[string]ListProfilesVendorNameEnum{ + "oracle": ListProfilesVendorNameOracle, +} + +// GetListProfilesVendorNameEnumValues Enumerates the set of values for ListProfilesVendorNameEnum +func GetListProfilesVendorNameEnumValues() []ListProfilesVendorNameEnum { + values := make([]ListProfilesVendorNameEnum, 0) + for _, v := range mappingListProfilesVendorNameEnum { + values = append(values, v) + } + return values +} + +// GetListProfilesVendorNameEnumStringValues Enumerates the set of values in String for ListProfilesVendorNameEnum +func GetListProfilesVendorNameEnumStringValues() []string { + return []string{ + "ORACLE", + } +} + +// GetMappingListProfilesVendorNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListProfilesVendorNameEnum(val string) (ListProfilesVendorNameEnum, bool) { + enum, ok := mappingListProfilesVendorNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListProfilesSortOrderEnum Enum with underlying type: string +type ListProfilesSortOrderEnum string + +// Set of constants representing the allowable values for ListProfilesSortOrderEnum +const ( + ListProfilesSortOrderAsc ListProfilesSortOrderEnum = "ASC" + ListProfilesSortOrderDesc ListProfilesSortOrderEnum = "DESC" +) + +var mappingListProfilesSortOrderEnum = map[string]ListProfilesSortOrderEnum{ + "ASC": ListProfilesSortOrderAsc, + "DESC": ListProfilesSortOrderDesc, +} + +var mappingListProfilesSortOrderEnumLowerCase = map[string]ListProfilesSortOrderEnum{ + "asc": ListProfilesSortOrderAsc, + "desc": ListProfilesSortOrderDesc, +} + +// GetListProfilesSortOrderEnumValues Enumerates the set of values for ListProfilesSortOrderEnum +func GetListProfilesSortOrderEnumValues() []ListProfilesSortOrderEnum { + values := make([]ListProfilesSortOrderEnum, 0) + for _, v := range mappingListProfilesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListProfilesSortOrderEnumStringValues Enumerates the set of values in String for ListProfilesSortOrderEnum +func GetListProfilesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListProfilesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListProfilesSortOrderEnum(val string) (ListProfilesSortOrderEnum, bool) { + enum, ok := mappingListProfilesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListProfilesSortByEnum Enum with underlying type: string +type ListProfilesSortByEnum string + +// Set of constants representing the allowable values for ListProfilesSortByEnum +const ( + ListProfilesSortByTimecreated ListProfilesSortByEnum = "timeCreated" + ListProfilesSortByDisplayname ListProfilesSortByEnum = "displayName" +) + +var mappingListProfilesSortByEnum = map[string]ListProfilesSortByEnum{ + "timeCreated": ListProfilesSortByTimecreated, + "displayName": ListProfilesSortByDisplayname, +} + +var mappingListProfilesSortByEnumLowerCase = map[string]ListProfilesSortByEnum{ + "timecreated": ListProfilesSortByTimecreated, + "displayname": ListProfilesSortByDisplayname, +} + +// GetListProfilesSortByEnumValues Enumerates the set of values for ListProfilesSortByEnum +func GetListProfilesSortByEnumValues() []ListProfilesSortByEnum { + values := make([]ListProfilesSortByEnum, 0) + for _, v := range mappingListProfilesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListProfilesSortByEnumStringValues Enumerates the set of values in String for ListProfilesSortByEnum +func GetListProfilesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListProfilesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListProfilesSortByEnum(val string) (ListProfilesSortByEnum, bool) { + enum, ok := mappingListProfilesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_scheduled_jobs_request_response.go b/osmanagementhub/list_scheduled_jobs_request_response.go new file mode 100644 index 0000000000..2f8860e939 --- /dev/null +++ b/osmanagementhub/list_scheduled_jobs_request_response.go @@ -0,0 +1,393 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListScheduledJobsRequest wrapper for the ListScheduledJobs operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListScheduledJobs.go.html to see an example of how to use ListScheduledJobsRequest. +type ListScheduledJobsRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Example: `My new resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // A filter to return only resources their lifecycleState matches the given lifecycleState. + LifecycleState ScheduledJobLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The OCID of the managed instance for which to list resources. + ManagedInstanceId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceId"` + + // The OCID of the managed instance group for which to list resources. + ManagedInstanceGroupId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceGroupId"` + + // The OCID of the managed compartment for which to list resources. + ManagedCompartmentId *string `mandatory:"false" contributesTo:"query" name:"managedCompartmentId"` + + // The OCID of the lifecycle stage for which to list resources. + LifecycleStageId *string `mandatory:"false" contributesTo:"query" name:"lifecycleStageId"` + + // The operation type for which to list resources. + OperationType ListScheduledJobsOperationTypeEnum `mandatory:"false" contributesTo:"query" name:"operationType" omitEmpty:"true"` + + // The schedule type for which to list resources. + ScheduleType ListScheduledJobsScheduleTypeEnum `mandatory:"false" contributesTo:"query" name:"scheduleType" omitEmpty:"true"` + + // The start time after which to list all schedules, in ISO 8601 format. + // Example: 2017-07-14T02:40:00.000Z + TimeStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeStart"` + + // The cut-off time before which to list all upcoming schedules, in ISO 8601 format. + // Example: 2017-07-14T02:40:00.000Z + TimeEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeEnd"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListScheduledJobsSortOrderEnum `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 ListScheduledJobsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // If true, will only filter out restricted scheduled job. + IsRestricted *bool `mandatory:"false" contributesTo:"query" name:"isRestricted"` + + // The OCID of the scheduled job. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // Default is false. When set to true ,returns results from {compartmentId} or any of its subcompartment. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // 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 ListScheduledJobsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListScheduledJobsRequest) 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 ListScheduledJobsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListScheduledJobsRequest) 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 ListScheduledJobsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduledJobLifecycleStateEnum(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(GetScheduledJobLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListScheduledJobsOperationTypeEnum(string(request.OperationType)); !ok && request.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", request.OperationType, strings.Join(GetListScheduledJobsOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListScheduledJobsScheduleTypeEnum(string(request.ScheduleType)); !ok && request.ScheduleType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduleType: %s. Supported values are: %s.", request.ScheduleType, strings.Join(GetListScheduledJobsScheduleTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListScheduledJobsSortOrderEnum(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(GetListScheduledJobsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListScheduledJobsSortByEnum(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(GetListScheduledJobsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListScheduledJobsResponse wrapper for the ListScheduledJobs operation +type ListScheduledJobsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ScheduledJobCollection instances + ScheduledJobCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListScheduledJobsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListScheduledJobsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListScheduledJobsOperationTypeEnum Enum with underlying type: string +type ListScheduledJobsOperationTypeEnum string + +// Set of constants representing the allowable values for ListScheduledJobsOperationTypeEnum +const ( + ListScheduledJobsOperationTypeInstallPackages ListScheduledJobsOperationTypeEnum = "INSTALL_PACKAGES" + ListScheduledJobsOperationTypeUpdatePackages ListScheduledJobsOperationTypeEnum = "UPDATE_PACKAGES" + ListScheduledJobsOperationTypeRemovePackages ListScheduledJobsOperationTypeEnum = "REMOVE_PACKAGES" + ListScheduledJobsOperationTypeUpdateAll ListScheduledJobsOperationTypeEnum = "UPDATE_ALL" + ListScheduledJobsOperationTypeUpdateSecurity ListScheduledJobsOperationTypeEnum = "UPDATE_SECURITY" + ListScheduledJobsOperationTypeUpdateBugfix ListScheduledJobsOperationTypeEnum = "UPDATE_BUGFIX" + ListScheduledJobsOperationTypeUpdateEnhancement ListScheduledJobsOperationTypeEnum = "UPDATE_ENHANCEMENT" + ListScheduledJobsOperationTypeUpdateOther ListScheduledJobsOperationTypeEnum = "UPDATE_OTHER" + ListScheduledJobsOperationTypeUpdateKspliceUserspace ListScheduledJobsOperationTypeEnum = "UPDATE_KSPLICE_USERSPACE" + ListScheduledJobsOperationTypeUpdateKspliceKernel ListScheduledJobsOperationTypeEnum = "UPDATE_KSPLICE_KERNEL" + ListScheduledJobsOperationTypeManageModuleStreams ListScheduledJobsOperationTypeEnum = "MANAGE_MODULE_STREAMS" + ListScheduledJobsOperationTypeSwitchModuleStream ListScheduledJobsOperationTypeEnum = "SWITCH_MODULE_STREAM" + ListScheduledJobsOperationTypeAttachSoftwareSources ListScheduledJobsOperationTypeEnum = "ATTACH_SOFTWARE_SOURCES" + ListScheduledJobsOperationTypeDetachSoftwareSources ListScheduledJobsOperationTypeEnum = "DETACH_SOFTWARE_SOURCES" + ListScheduledJobsOperationTypeSyncManagementStationMirror ListScheduledJobsOperationTypeEnum = "SYNC_MANAGEMENT_STATION_MIRROR" + ListScheduledJobsOperationTypePromoteLifecycle ListScheduledJobsOperationTypeEnum = "PROMOTE_LIFECYCLE" +) + +var mappingListScheduledJobsOperationTypeEnum = map[string]ListScheduledJobsOperationTypeEnum{ + "INSTALL_PACKAGES": ListScheduledJobsOperationTypeInstallPackages, + "UPDATE_PACKAGES": ListScheduledJobsOperationTypeUpdatePackages, + "REMOVE_PACKAGES": ListScheduledJobsOperationTypeRemovePackages, + "UPDATE_ALL": ListScheduledJobsOperationTypeUpdateAll, + "UPDATE_SECURITY": ListScheduledJobsOperationTypeUpdateSecurity, + "UPDATE_BUGFIX": ListScheduledJobsOperationTypeUpdateBugfix, + "UPDATE_ENHANCEMENT": ListScheduledJobsOperationTypeUpdateEnhancement, + "UPDATE_OTHER": ListScheduledJobsOperationTypeUpdateOther, + "UPDATE_KSPLICE_USERSPACE": ListScheduledJobsOperationTypeUpdateKspliceUserspace, + "UPDATE_KSPLICE_KERNEL": ListScheduledJobsOperationTypeUpdateKspliceKernel, + "MANAGE_MODULE_STREAMS": ListScheduledJobsOperationTypeManageModuleStreams, + "SWITCH_MODULE_STREAM": ListScheduledJobsOperationTypeSwitchModuleStream, + "ATTACH_SOFTWARE_SOURCES": ListScheduledJobsOperationTypeAttachSoftwareSources, + "DETACH_SOFTWARE_SOURCES": ListScheduledJobsOperationTypeDetachSoftwareSources, + "SYNC_MANAGEMENT_STATION_MIRROR": ListScheduledJobsOperationTypeSyncManagementStationMirror, + "PROMOTE_LIFECYCLE": ListScheduledJobsOperationTypePromoteLifecycle, +} + +var mappingListScheduledJobsOperationTypeEnumLowerCase = map[string]ListScheduledJobsOperationTypeEnum{ + "install_packages": ListScheduledJobsOperationTypeInstallPackages, + "update_packages": ListScheduledJobsOperationTypeUpdatePackages, + "remove_packages": ListScheduledJobsOperationTypeRemovePackages, + "update_all": ListScheduledJobsOperationTypeUpdateAll, + "update_security": ListScheduledJobsOperationTypeUpdateSecurity, + "update_bugfix": ListScheduledJobsOperationTypeUpdateBugfix, + "update_enhancement": ListScheduledJobsOperationTypeUpdateEnhancement, + "update_other": ListScheduledJobsOperationTypeUpdateOther, + "update_ksplice_userspace": ListScheduledJobsOperationTypeUpdateKspliceUserspace, + "update_ksplice_kernel": ListScheduledJobsOperationTypeUpdateKspliceKernel, + "manage_module_streams": ListScheduledJobsOperationTypeManageModuleStreams, + "switch_module_stream": ListScheduledJobsOperationTypeSwitchModuleStream, + "attach_software_sources": ListScheduledJobsOperationTypeAttachSoftwareSources, + "detach_software_sources": ListScheduledJobsOperationTypeDetachSoftwareSources, + "sync_management_station_mirror": ListScheduledJobsOperationTypeSyncManagementStationMirror, + "promote_lifecycle": ListScheduledJobsOperationTypePromoteLifecycle, +} + +// GetListScheduledJobsOperationTypeEnumValues Enumerates the set of values for ListScheduledJobsOperationTypeEnum +func GetListScheduledJobsOperationTypeEnumValues() []ListScheduledJobsOperationTypeEnum { + values := make([]ListScheduledJobsOperationTypeEnum, 0) + for _, v := range mappingListScheduledJobsOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetListScheduledJobsOperationTypeEnumStringValues Enumerates the set of values in String for ListScheduledJobsOperationTypeEnum +func GetListScheduledJobsOperationTypeEnumStringValues() []string { + return []string{ + "INSTALL_PACKAGES", + "UPDATE_PACKAGES", + "REMOVE_PACKAGES", + "UPDATE_ALL", + "UPDATE_SECURITY", + "UPDATE_BUGFIX", + "UPDATE_ENHANCEMENT", + "UPDATE_OTHER", + "UPDATE_KSPLICE_USERSPACE", + "UPDATE_KSPLICE_KERNEL", + "MANAGE_MODULE_STREAMS", + "SWITCH_MODULE_STREAM", + "ATTACH_SOFTWARE_SOURCES", + "DETACH_SOFTWARE_SOURCES", + "SYNC_MANAGEMENT_STATION_MIRROR", + "PROMOTE_LIFECYCLE", + } +} + +// GetMappingListScheduledJobsOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListScheduledJobsOperationTypeEnum(val string) (ListScheduledJobsOperationTypeEnum, bool) { + enum, ok := mappingListScheduledJobsOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListScheduledJobsScheduleTypeEnum Enum with underlying type: string +type ListScheduledJobsScheduleTypeEnum string + +// Set of constants representing the allowable values for ListScheduledJobsScheduleTypeEnum +const ( + ListScheduledJobsScheduleTypeOnetime ListScheduledJobsScheduleTypeEnum = "ONETIME" + ListScheduledJobsScheduleTypeRecurring ListScheduledJobsScheduleTypeEnum = "RECURRING" +) + +var mappingListScheduledJobsScheduleTypeEnum = map[string]ListScheduledJobsScheduleTypeEnum{ + "ONETIME": ListScheduledJobsScheduleTypeOnetime, + "RECURRING": ListScheduledJobsScheduleTypeRecurring, +} + +var mappingListScheduledJobsScheduleTypeEnumLowerCase = map[string]ListScheduledJobsScheduleTypeEnum{ + "onetime": ListScheduledJobsScheduleTypeOnetime, + "recurring": ListScheduledJobsScheduleTypeRecurring, +} + +// GetListScheduledJobsScheduleTypeEnumValues Enumerates the set of values for ListScheduledJobsScheduleTypeEnum +func GetListScheduledJobsScheduleTypeEnumValues() []ListScheduledJobsScheduleTypeEnum { + values := make([]ListScheduledJobsScheduleTypeEnum, 0) + for _, v := range mappingListScheduledJobsScheduleTypeEnum { + values = append(values, v) + } + return values +} + +// GetListScheduledJobsScheduleTypeEnumStringValues Enumerates the set of values in String for ListScheduledJobsScheduleTypeEnum +func GetListScheduledJobsScheduleTypeEnumStringValues() []string { + return []string{ + "ONETIME", + "RECURRING", + } +} + +// GetMappingListScheduledJobsScheduleTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListScheduledJobsScheduleTypeEnum(val string) (ListScheduledJobsScheduleTypeEnum, bool) { + enum, ok := mappingListScheduledJobsScheduleTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListScheduledJobsSortOrderEnum Enum with underlying type: string +type ListScheduledJobsSortOrderEnum string + +// Set of constants representing the allowable values for ListScheduledJobsSortOrderEnum +const ( + ListScheduledJobsSortOrderAsc ListScheduledJobsSortOrderEnum = "ASC" + ListScheduledJobsSortOrderDesc ListScheduledJobsSortOrderEnum = "DESC" +) + +var mappingListScheduledJobsSortOrderEnum = map[string]ListScheduledJobsSortOrderEnum{ + "ASC": ListScheduledJobsSortOrderAsc, + "DESC": ListScheduledJobsSortOrderDesc, +} + +var mappingListScheduledJobsSortOrderEnumLowerCase = map[string]ListScheduledJobsSortOrderEnum{ + "asc": ListScheduledJobsSortOrderAsc, + "desc": ListScheduledJobsSortOrderDesc, +} + +// GetListScheduledJobsSortOrderEnumValues Enumerates the set of values for ListScheduledJobsSortOrderEnum +func GetListScheduledJobsSortOrderEnumValues() []ListScheduledJobsSortOrderEnum { + values := make([]ListScheduledJobsSortOrderEnum, 0) + for _, v := range mappingListScheduledJobsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListScheduledJobsSortOrderEnumStringValues Enumerates the set of values in String for ListScheduledJobsSortOrderEnum +func GetListScheduledJobsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListScheduledJobsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListScheduledJobsSortOrderEnum(val string) (ListScheduledJobsSortOrderEnum, bool) { + enum, ok := mappingListScheduledJobsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListScheduledJobsSortByEnum Enum with underlying type: string +type ListScheduledJobsSortByEnum string + +// Set of constants representing the allowable values for ListScheduledJobsSortByEnum +const ( + ListScheduledJobsSortByTimecreated ListScheduledJobsSortByEnum = "timeCreated" + ListScheduledJobsSortByDisplayname ListScheduledJobsSortByEnum = "displayName" +) + +var mappingListScheduledJobsSortByEnum = map[string]ListScheduledJobsSortByEnum{ + "timeCreated": ListScheduledJobsSortByTimecreated, + "displayName": ListScheduledJobsSortByDisplayname, +} + +var mappingListScheduledJobsSortByEnumLowerCase = map[string]ListScheduledJobsSortByEnum{ + "timecreated": ListScheduledJobsSortByTimecreated, + "displayname": ListScheduledJobsSortByDisplayname, +} + +// GetListScheduledJobsSortByEnumValues Enumerates the set of values for ListScheduledJobsSortByEnum +func GetListScheduledJobsSortByEnumValues() []ListScheduledJobsSortByEnum { + values := make([]ListScheduledJobsSortByEnum, 0) + for _, v := range mappingListScheduledJobsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListScheduledJobsSortByEnumStringValues Enumerates the set of values in String for ListScheduledJobsSortByEnum +func GetListScheduledJobsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListScheduledJobsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListScheduledJobsSortByEnum(val string) (ListScheduledJobsSortByEnum, bool) { + enum, ok := mappingListScheduledJobsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_software_packages_request_response.go b/osmanagementhub/list_software_packages_request_response.go new file mode 100644 index 0000000000..a09b31ea86 --- /dev/null +++ b/osmanagementhub/list_software_packages_request_response.go @@ -0,0 +1,211 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSoftwarePackagesRequest wrapper for the ListSoftwarePackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListSoftwarePackages.go.html to see an example of how to use ListSoftwarePackagesRequest. +type ListSoftwarePackagesRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Example: `My new resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // A boolean variable that is used to list only the latest versions of packages, module streams, + // and stream profiles when set to true. All packages, module streams, and stream profiles are + // returned when set to false. + IsLatest *bool `mandatory:"false" contributesTo:"query" name:"isLatest"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListSoftwarePackagesSortOrderEnum `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 ListSoftwarePackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 ListSoftwarePackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSoftwarePackagesRequest) 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 ListSoftwarePackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSoftwarePackagesRequest) 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 ListSoftwarePackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSoftwarePackagesSortOrderEnum(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(GetListSoftwarePackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListSoftwarePackagesSortByEnum(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(GetListSoftwarePackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSoftwarePackagesResponse wrapper for the ListSoftwarePackages operation +type ListSoftwarePackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SoftwarePackageCollection instances + SoftwarePackageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListSoftwarePackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSoftwarePackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSoftwarePackagesSortOrderEnum Enum with underlying type: string +type ListSoftwarePackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListSoftwarePackagesSortOrderEnum +const ( + ListSoftwarePackagesSortOrderAsc ListSoftwarePackagesSortOrderEnum = "ASC" + ListSoftwarePackagesSortOrderDesc ListSoftwarePackagesSortOrderEnum = "DESC" +) + +var mappingListSoftwarePackagesSortOrderEnum = map[string]ListSoftwarePackagesSortOrderEnum{ + "ASC": ListSoftwarePackagesSortOrderAsc, + "DESC": ListSoftwarePackagesSortOrderDesc, +} + +var mappingListSoftwarePackagesSortOrderEnumLowerCase = map[string]ListSoftwarePackagesSortOrderEnum{ + "asc": ListSoftwarePackagesSortOrderAsc, + "desc": ListSoftwarePackagesSortOrderDesc, +} + +// GetListSoftwarePackagesSortOrderEnumValues Enumerates the set of values for ListSoftwarePackagesSortOrderEnum +func GetListSoftwarePackagesSortOrderEnumValues() []ListSoftwarePackagesSortOrderEnum { + values := make([]ListSoftwarePackagesSortOrderEnum, 0) + for _, v := range mappingListSoftwarePackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSoftwarePackagesSortOrderEnumStringValues Enumerates the set of values in String for ListSoftwarePackagesSortOrderEnum +func GetListSoftwarePackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSoftwarePackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSoftwarePackagesSortOrderEnum(val string) (ListSoftwarePackagesSortOrderEnum, bool) { + enum, ok := mappingListSoftwarePackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSoftwarePackagesSortByEnum Enum with underlying type: string +type ListSoftwarePackagesSortByEnum string + +// Set of constants representing the allowable values for ListSoftwarePackagesSortByEnum +const ( + ListSoftwarePackagesSortByTimecreated ListSoftwarePackagesSortByEnum = "timeCreated" + ListSoftwarePackagesSortByDisplayname ListSoftwarePackagesSortByEnum = "displayName" +) + +var mappingListSoftwarePackagesSortByEnum = map[string]ListSoftwarePackagesSortByEnum{ + "timeCreated": ListSoftwarePackagesSortByTimecreated, + "displayName": ListSoftwarePackagesSortByDisplayname, +} + +var mappingListSoftwarePackagesSortByEnumLowerCase = map[string]ListSoftwarePackagesSortByEnum{ + "timecreated": ListSoftwarePackagesSortByTimecreated, + "displayname": ListSoftwarePackagesSortByDisplayname, +} + +// GetListSoftwarePackagesSortByEnumValues Enumerates the set of values for ListSoftwarePackagesSortByEnum +func GetListSoftwarePackagesSortByEnumValues() []ListSoftwarePackagesSortByEnum { + values := make([]ListSoftwarePackagesSortByEnum, 0) + for _, v := range mappingListSoftwarePackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSoftwarePackagesSortByEnumStringValues Enumerates the set of values in String for ListSoftwarePackagesSortByEnum +func GetListSoftwarePackagesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListSoftwarePackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSoftwarePackagesSortByEnum(val string) (ListSoftwarePackagesSortByEnum, bool) { + enum, ok := mappingListSoftwarePackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_software_source_vendors_request_response.go b/osmanagementhub/list_software_source_vendors_request_response.go new file mode 100644 index 0000000000..c36b5bc371 --- /dev/null +++ b/osmanagementhub/list_software_source_vendors_request_response.go @@ -0,0 +1,185 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSoftwareSourceVendorsRequest wrapper for the ListSoftwareSourceVendors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListSoftwareSourceVendors.go.html to see an example of how to use ListSoftwareSourceVendorsRequest. +type ListSoftwareSourceVendorsRequest struct { + + // The OCID of the compartment that contains the resources to list. This parameter is required. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListSoftwareSourceVendorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort software source vendors by. Only one sort order may be provided. Default order for name is ascending. + SortBy ListSoftwareSourceVendorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The name of the entity to be queried. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // 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 ListSoftwareSourceVendorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSoftwareSourceVendorsRequest) 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 ListSoftwareSourceVendorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSoftwareSourceVendorsRequest) 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 ListSoftwareSourceVendorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSoftwareSourceVendorsSortOrderEnum(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(GetListSoftwareSourceVendorsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListSoftwareSourceVendorsSortByEnum(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(GetListSoftwareSourceVendorsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSoftwareSourceVendorsResponse wrapper for the ListSoftwareSourceVendors operation +type ListSoftwareSourceVendorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SoftwareSourceVendorCollection instance + SoftwareSourceVendorCollection `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 ListSoftwareSourceVendorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSoftwareSourceVendorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSoftwareSourceVendorsSortOrderEnum Enum with underlying type: string +type ListSoftwareSourceVendorsSortOrderEnum string + +// Set of constants representing the allowable values for ListSoftwareSourceVendorsSortOrderEnum +const ( + ListSoftwareSourceVendorsSortOrderAsc ListSoftwareSourceVendorsSortOrderEnum = "ASC" + ListSoftwareSourceVendorsSortOrderDesc ListSoftwareSourceVendorsSortOrderEnum = "DESC" +) + +var mappingListSoftwareSourceVendorsSortOrderEnum = map[string]ListSoftwareSourceVendorsSortOrderEnum{ + "ASC": ListSoftwareSourceVendorsSortOrderAsc, + "DESC": ListSoftwareSourceVendorsSortOrderDesc, +} + +var mappingListSoftwareSourceVendorsSortOrderEnumLowerCase = map[string]ListSoftwareSourceVendorsSortOrderEnum{ + "asc": ListSoftwareSourceVendorsSortOrderAsc, + "desc": ListSoftwareSourceVendorsSortOrderDesc, +} + +// GetListSoftwareSourceVendorsSortOrderEnumValues Enumerates the set of values for ListSoftwareSourceVendorsSortOrderEnum +func GetListSoftwareSourceVendorsSortOrderEnumValues() []ListSoftwareSourceVendorsSortOrderEnum { + values := make([]ListSoftwareSourceVendorsSortOrderEnum, 0) + for _, v := range mappingListSoftwareSourceVendorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSoftwareSourceVendorsSortOrderEnumStringValues Enumerates the set of values in String for ListSoftwareSourceVendorsSortOrderEnum +func GetListSoftwareSourceVendorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSoftwareSourceVendorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSoftwareSourceVendorsSortOrderEnum(val string) (ListSoftwareSourceVendorsSortOrderEnum, bool) { + enum, ok := mappingListSoftwareSourceVendorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSoftwareSourceVendorsSortByEnum Enum with underlying type: string +type ListSoftwareSourceVendorsSortByEnum string + +// Set of constants representing the allowable values for ListSoftwareSourceVendorsSortByEnum +const ( + ListSoftwareSourceVendorsSortByName ListSoftwareSourceVendorsSortByEnum = "name" +) + +var mappingListSoftwareSourceVendorsSortByEnum = map[string]ListSoftwareSourceVendorsSortByEnum{ + "name": ListSoftwareSourceVendorsSortByName, +} + +var mappingListSoftwareSourceVendorsSortByEnumLowerCase = map[string]ListSoftwareSourceVendorsSortByEnum{ + "name": ListSoftwareSourceVendorsSortByName, +} + +// GetListSoftwareSourceVendorsSortByEnumValues Enumerates the set of values for ListSoftwareSourceVendorsSortByEnum +func GetListSoftwareSourceVendorsSortByEnumValues() []ListSoftwareSourceVendorsSortByEnum { + values := make([]ListSoftwareSourceVendorsSortByEnum, 0) + for _, v := range mappingListSoftwareSourceVendorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSoftwareSourceVendorsSortByEnumStringValues Enumerates the set of values in String for ListSoftwareSourceVendorsSortByEnum +func GetListSoftwareSourceVendorsSortByEnumStringValues() []string { + return []string{ + "name", + } +} + +// GetMappingListSoftwareSourceVendorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSoftwareSourceVendorsSortByEnum(val string) (ListSoftwareSourceVendorsSortByEnum, bool) { + enum, ok := mappingListSoftwareSourceVendorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_software_sources_request_response.go b/osmanagementhub/list_software_sources_request_response.go new file mode 100644 index 0000000000..de205c9c60 --- /dev/null +++ b/osmanagementhub/list_software_sources_request_response.go @@ -0,0 +1,301 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSoftwareSourcesRequest wrapper for the ListSoftwareSources operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListSoftwareSources.go.html to see an example of how to use ListSoftwareSourcesRequest. +type ListSoftwareSourcesRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID for the software source. + SoftwareSourceId *string `mandatory:"false" contributesTo:"query" name:"softwareSourceId"` + + // The type of the software source. + SoftwareSourceType []SoftwareSourceTypeEnum `contributesTo:"query" name:"softwareSourceType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only profiles that match the given vendorName. + VendorName ListSoftwareSourcesVendorNameEnum `mandatory:"false" contributesTo:"query" name:"vendorName" omitEmpty:"true"` + + // A filter to return only instances whose OS family type matches the given OS family. + OsFamily []OsFamilyEnum `contributesTo:"query" name:"osFamily" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only instances whose architecture type matches the given architecture. + ArchType []ArchTypeEnum `contributesTo:"query" name:"archType" omitEmpty:"true" collectionFormat:"multi"` + + // The availabilities of the software source for a tenant. + Availability []AvailabilityEnum `contributesTo:"query" name:"availability" omitEmpty:"true" collectionFormat:"multi"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Example: `My new resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // A multi filter to return resources that do not contains the given display names. + DisplayNameNotEqualTo []string `contributesTo:"query" name:"displayNameNotEqualTo" collectionFormat:"multi"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListSoftwareSourcesSortOrderEnum `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 ListSoftwareSourcesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // A filter to return only resources whose lifecycleState matches the given lifecycleStates. + LifecycleState []SoftwareSourceLifecycleStateEnum `contributesTo:"query" name:"lifecycleState" omitEmpty:"true" collectionFormat:"multi"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListSoftwareSourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSoftwareSourcesRequest) 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 ListSoftwareSourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSoftwareSourcesRequest) 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 ListSoftwareSourcesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.SoftwareSourceType { + if _, ok := GetMappingSoftwareSourceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SoftwareSourceType: %s. Supported values are: %s.", val, strings.Join(GetSoftwareSourceTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListSoftwareSourcesVendorNameEnum(string(request.VendorName)); !ok && request.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", request.VendorName, strings.Join(GetListSoftwareSourcesVendorNameEnumStringValues(), ","))) + } + for _, val := range request.OsFamily { + if _, ok := GetMappingOsFamilyEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", val, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + } + + for _, val := range request.ArchType { + if _, ok := GetMappingArchTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", val, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + } + + for _, val := range request.Availability { + if _, ok := GetMappingAvailabilityEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", val, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListSoftwareSourcesSortOrderEnum(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(GetListSoftwareSourcesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListSoftwareSourcesSortByEnum(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(GetListSoftwareSourcesSortByEnumStringValues(), ","))) + } + for _, val := range request.LifecycleState { + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", val, strings.Join(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSoftwareSourcesResponse wrapper for the ListSoftwareSources operation +type ListSoftwareSourcesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SoftwareSourceCollection instances + SoftwareSourceCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListSoftwareSourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSoftwareSourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSoftwareSourcesVendorNameEnum Enum with underlying type: string +type ListSoftwareSourcesVendorNameEnum string + +// Set of constants representing the allowable values for ListSoftwareSourcesVendorNameEnum +const ( + ListSoftwareSourcesVendorNameOracle ListSoftwareSourcesVendorNameEnum = "ORACLE" +) + +var mappingListSoftwareSourcesVendorNameEnum = map[string]ListSoftwareSourcesVendorNameEnum{ + "ORACLE": ListSoftwareSourcesVendorNameOracle, +} + +var mappingListSoftwareSourcesVendorNameEnumLowerCase = map[string]ListSoftwareSourcesVendorNameEnum{ + "oracle": ListSoftwareSourcesVendorNameOracle, +} + +// GetListSoftwareSourcesVendorNameEnumValues Enumerates the set of values for ListSoftwareSourcesVendorNameEnum +func GetListSoftwareSourcesVendorNameEnumValues() []ListSoftwareSourcesVendorNameEnum { + values := make([]ListSoftwareSourcesVendorNameEnum, 0) + for _, v := range mappingListSoftwareSourcesVendorNameEnum { + values = append(values, v) + } + return values +} + +// GetListSoftwareSourcesVendorNameEnumStringValues Enumerates the set of values in String for ListSoftwareSourcesVendorNameEnum +func GetListSoftwareSourcesVendorNameEnumStringValues() []string { + return []string{ + "ORACLE", + } +} + +// GetMappingListSoftwareSourcesVendorNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSoftwareSourcesVendorNameEnum(val string) (ListSoftwareSourcesVendorNameEnum, bool) { + enum, ok := mappingListSoftwareSourcesVendorNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSoftwareSourcesSortOrderEnum Enum with underlying type: string +type ListSoftwareSourcesSortOrderEnum string + +// Set of constants representing the allowable values for ListSoftwareSourcesSortOrderEnum +const ( + ListSoftwareSourcesSortOrderAsc ListSoftwareSourcesSortOrderEnum = "ASC" + ListSoftwareSourcesSortOrderDesc ListSoftwareSourcesSortOrderEnum = "DESC" +) + +var mappingListSoftwareSourcesSortOrderEnum = map[string]ListSoftwareSourcesSortOrderEnum{ + "ASC": ListSoftwareSourcesSortOrderAsc, + "DESC": ListSoftwareSourcesSortOrderDesc, +} + +var mappingListSoftwareSourcesSortOrderEnumLowerCase = map[string]ListSoftwareSourcesSortOrderEnum{ + "asc": ListSoftwareSourcesSortOrderAsc, + "desc": ListSoftwareSourcesSortOrderDesc, +} + +// GetListSoftwareSourcesSortOrderEnumValues Enumerates the set of values for ListSoftwareSourcesSortOrderEnum +func GetListSoftwareSourcesSortOrderEnumValues() []ListSoftwareSourcesSortOrderEnum { + values := make([]ListSoftwareSourcesSortOrderEnum, 0) + for _, v := range mappingListSoftwareSourcesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSoftwareSourcesSortOrderEnumStringValues Enumerates the set of values in String for ListSoftwareSourcesSortOrderEnum +func GetListSoftwareSourcesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSoftwareSourcesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSoftwareSourcesSortOrderEnum(val string) (ListSoftwareSourcesSortOrderEnum, bool) { + enum, ok := mappingListSoftwareSourcesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSoftwareSourcesSortByEnum Enum with underlying type: string +type ListSoftwareSourcesSortByEnum string + +// Set of constants representing the allowable values for ListSoftwareSourcesSortByEnum +const ( + ListSoftwareSourcesSortByTimecreated ListSoftwareSourcesSortByEnum = "timeCreated" + ListSoftwareSourcesSortByDisplayname ListSoftwareSourcesSortByEnum = "displayName" +) + +var mappingListSoftwareSourcesSortByEnum = map[string]ListSoftwareSourcesSortByEnum{ + "timeCreated": ListSoftwareSourcesSortByTimecreated, + "displayName": ListSoftwareSourcesSortByDisplayname, +} + +var mappingListSoftwareSourcesSortByEnumLowerCase = map[string]ListSoftwareSourcesSortByEnum{ + "timecreated": ListSoftwareSourcesSortByTimecreated, + "displayname": ListSoftwareSourcesSortByDisplayname, +} + +// GetListSoftwareSourcesSortByEnumValues Enumerates the set of values for ListSoftwareSourcesSortByEnum +func GetListSoftwareSourcesSortByEnumValues() []ListSoftwareSourcesSortByEnum { + values := make([]ListSoftwareSourcesSortByEnum, 0) + for _, v := range mappingListSoftwareSourcesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSoftwareSourcesSortByEnumStringValues Enumerates the set of values in String for ListSoftwareSourcesSortByEnum +func GetListSoftwareSourcesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListSoftwareSourcesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSoftwareSourcesSortByEnum(val string) (ListSoftwareSourcesSortByEnum, bool) { + enum, ok := mappingListSoftwareSourcesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/list_work_request_errors_request_response.go b/osmanagementhub/list_work_request_errors_request_response.go new file mode 100644 index 0000000000..04b8eed731 --- /dev/null +++ b/osmanagementhub/list_work_request_errors_request_response.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +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/osmanagementhub/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. + // Default order for timeCreated is descending. + SortBy ListWorkRequestErrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestErrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestErrorsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestErrorsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestErrorsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestErrorsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimecreated ListWorkRequestErrorsSortByEnum = "timeCreated" + ListWorkRequestErrorsSortByDisplayname ListWorkRequestErrorsSortByEnum = "displayName" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timeCreated": ListWorkRequestErrorsSortByTimecreated, + "displayName": ListWorkRequestErrorsSortByDisplayname, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timecreated": ListWorkRequestErrorsSortByTimecreated, + "displayname": ListWorkRequestErrorsSortByDisplayname, +} + +// 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{ + "timeCreated", + "displayName", + } +} + +// 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/osmanagementhub/list_work_request_logs_request_response.go b/osmanagementhub/list_work_request_logs_request_response.go new file mode 100644 index 0000000000..6cbbdca4dd --- /dev/null +++ b/osmanagementhub/list_work_request_logs_request_response.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +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/osmanagementhub/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. + // Default order for timeCreated is descending. + SortBy ListWorkRequestLogsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestLogsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestLogsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestLogsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestLogsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimecreated ListWorkRequestLogsSortByEnum = "timeCreated" + ListWorkRequestLogsSortByDisplayname ListWorkRequestLogsSortByEnum = "displayName" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timeCreated": ListWorkRequestLogsSortByTimecreated, + "displayName": ListWorkRequestLogsSortByDisplayname, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timecreated": ListWorkRequestLogsSortByTimecreated, + "displayname": ListWorkRequestLogsSortByDisplayname, +} + +// 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{ + "timeCreated", + "displayName", + } +} + +// 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/osmanagementhub/list_work_requests_request_response.go b/osmanagementhub/list_work_requests_request_response.go new file mode 100644 index 0000000000..bca36aef15 --- /dev/null +++ b/osmanagementhub/list_work_requests_request_response.go @@ -0,0 +1,236 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +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/osmanagementhub/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The OCID of the compartment that contains the resources to list. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID of the work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // A filter to return work requests that match the given status. + Status []OperationStatusEnum `contributesTo:"query" name:"status" omitEmpty:"true" collectionFormat:"multi"` + + // The OCID of the resource affected by the work request. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + 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 timeCreated is descending. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The OCID of the schedule job that initiated the work request. + InitiatorId *string `mandatory:"false" contributesTo:"query" name:"initiatorId"` + + // The OCID of the parent work request. + ParentId *string `mandatory:"false" contributesTo:"query" name:"parentId"` + + // A filter to return the resources whose parent resources are not the same as the given resource OCID(s). + ParentResourcesNotEqualTo []string `contributesTo:"query" name:"parentResourcesNotEqualTo" collectionFormat:"multi"` + + // The asynchronous operation tracked by this work request. The filter returns only resources that match the given OperationType. + OperationType []WorkRequestOperationTypeEnum `contributesTo:"query" name:"operationType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // 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{} + for _, val := range request.Status { + if _, ok := GetMappingOperationStatusEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", val, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + } + + 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(), ","))) + } + for _, val := range request.OperationType { + if _, ok := GetMappingWorkRequestOperationTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", val, strings.Join(GetWorkRequestOperationTypeEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// 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 ( + ListWorkRequestsSortByTimecreated ListWorkRequestsSortByEnum = "timeCreated" + ListWorkRequestsSortByDisplayname ListWorkRequestsSortByEnum = "displayName" +) + +var mappingListWorkRequestsSortByEnum = map[string]ListWorkRequestsSortByEnum{ + "timeCreated": ListWorkRequestsSortByTimecreated, + "displayName": ListWorkRequestsSortByDisplayname, +} + +var mappingListWorkRequestsSortByEnumLowerCase = map[string]ListWorkRequestsSortByEnum{ + "timecreated": ListWorkRequestsSortByTimecreated, + "displayname": ListWorkRequestsSortByDisplayname, +} + +// 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{ + "timeCreated", + "displayName", + } +} + +// 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/osmanagementhub/manage_module_streams_in_scheduled_job_details.go b/osmanagementhub/manage_module_streams_in_scheduled_job_details.go new file mode 100644 index 0000000000..e900b60032 --- /dev/null +++ b/osmanagementhub/manage_module_streams_in_scheduled_job_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManageModuleStreamsInScheduledJobDetails The set of changes to make to the state of the modules, streams, and profiles on the managed target. +type ManageModuleStreamsInScheduledJobDetails struct { + + // The set of module streams to enable. + Enable []ModuleStreamDetails `mandatory:"false" json:"enable"` + + // The set of module streams to disable. + Disable []ModuleStreamDetails `mandatory:"false" json:"disable"` + + // The set of module stream profiles to install. + Install []ModuleStreamProfileDetails `mandatory:"false" json:"install"` + + // The set of module stream profiles to remove. + Remove []ModuleStreamProfileDetails `mandatory:"false" json:"remove"` +} + +func (m ManageModuleStreamsInScheduledJobDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManageModuleStreamsInScheduledJobDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/manage_module_streams_on_managed_instance_details.go b/osmanagementhub/manage_module_streams_on_managed_instance_details.go new file mode 100644 index 0000000000..11f006fc84 --- /dev/null +++ b/osmanagementhub/manage_module_streams_on_managed_instance_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManageModuleStreamsOnManagedInstanceDetails The set of changes to make to the state of the modules, streams, and profiles on a managed instance +type ManageModuleStreamsOnManagedInstanceDetails struct { + + // Indicates if this operation is a dry run or if the operation + // should be committed. If set to true, the result of the operation + // will be evaluated but not committed. If set to false, the + // operation is committed to the managed instance. The default is + // false. + IsDryRun *bool `mandatory:"false" json:"isDryRun"` + + // The set of module streams to enable. + Enable []ModuleStreamDetails `mandatory:"false" json:"enable"` + + // The set of module streams to disable. + Disable []ModuleStreamDetails `mandatory:"false" json:"disable"` + + // The set of module stream profiles to install. + Install []ModuleStreamProfileDetails `mandatory:"false" json:"install"` + + // The set of module stream profiles to remove. + Remove []ModuleStreamProfileDetails `mandatory:"false" json:"remove"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m ManageModuleStreamsOnManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManageModuleStreamsOnManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/manage_module_streams_on_managed_instance_group_details.go b/osmanagementhub/manage_module_streams_on_managed_instance_group_details.go new file mode 100644 index 0000000000..7dec09b6cc --- /dev/null +++ b/osmanagementhub/manage_module_streams_on_managed_instance_group_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManageModuleStreamsOnManagedInstanceGroupDetails The set of changes to make to the state of the modules, streams, and profiles on a managed instance group. +type ManageModuleStreamsOnManagedInstanceGroupDetails struct { + + // Indicates if this operation is a dry run or if the operation + // should be committed. If set to true, the result of the operation + // will be evaluated but not committed. If set to false, the + // operation is committed to the managed instance(s). The default is + // false. + IsDryRun *bool `mandatory:"false" json:"isDryRun"` + + // The set of module streams to enable. + Enable []ModuleStreamDetails `mandatory:"false" json:"enable"` + + // The set of module streams to disable. + Disable []ModuleStreamDetails `mandatory:"false" json:"disable"` + + // The set of module stream profiles to install. + Install []ModuleStreamProfileDetails `mandatory:"false" json:"install"` + + // The set of module stream profiles to remove. + Remove []ModuleStreamProfileDetails `mandatory:"false" json:"remove"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m ManageModuleStreamsOnManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManageModuleStreamsOnManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/manage_module_streams_on_managed_instance_group_request_response.go b/osmanagementhub/manage_module_streams_on_managed_instance_group_request_response.go new file mode 100644 index 0000000000..ebc51e2724 --- /dev/null +++ b/osmanagementhub/manage_module_streams_on_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ManageModuleStreamsOnManagedInstanceGroupRequest wrapper for the ManageModuleStreamsOnManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ManageModuleStreamsOnManagedInstanceGroup.go.html to see an example of how to use ManageModuleStreamsOnManagedInstanceGroupRequest. +type ManageModuleStreamsOnManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // A description of an operation to perform against the modules, streams, and profiles of a managed instance group + ManageModuleStreamsOnManagedInstanceGroupDetails `contributesTo:"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 `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 ManageModuleStreamsOnManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ManageModuleStreamsOnManagedInstanceGroupRequest) 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 ManageModuleStreamsOnManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ManageModuleStreamsOnManagedInstanceGroupRequest) 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 ManageModuleStreamsOnManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ManageModuleStreamsOnManagedInstanceGroupResponse wrapper for the ManageModuleStreamsOnManagedInstanceGroup operation +type ManageModuleStreamsOnManagedInstanceGroupResponse 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 ManageModuleStreamsOnManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ManageModuleStreamsOnManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/manage_module_streams_on_managed_instance_request_response.go b/osmanagementhub/manage_module_streams_on_managed_instance_request_response.go new file mode 100644 index 0000000000..514b1c2894 --- /dev/null +++ b/osmanagementhub/manage_module_streams_on_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ManageModuleStreamsOnManagedInstanceRequest wrapper for the ManageModuleStreamsOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ManageModuleStreamsOnManagedInstance.go.html to see an example of how to use ManageModuleStreamsOnManagedInstanceRequest. +type ManageModuleStreamsOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // A description of an operation to perform against the modules, streams, and profiles of a managed instance. + ManageModuleStreamsOnManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ManageModuleStreamsOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ManageModuleStreamsOnManagedInstanceRequest) 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 ManageModuleStreamsOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ManageModuleStreamsOnManagedInstanceRequest) 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 ManageModuleStreamsOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ManageModuleStreamsOnManagedInstanceResponse wrapper for the ManageModuleStreamsOnManagedInstance operation +type ManageModuleStreamsOnManagedInstanceResponse 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 ManageModuleStreamsOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ManageModuleStreamsOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/managed_instance.go b/osmanagementhub/managed_instance.go new file mode 100644 index 0000000000..74dca4c27f --- /dev/null +++ b/osmanagementhub/managed_instance.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstance Detail information for an OCI Compute instance that is being managed. +type ManagedInstance struct { + + // The OCID for the managed instance. + Id *string `mandatory:"true" json:"id"` + + // Managed instance identifier. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID for the tenancy this managed instance resides in. + TenancyId *string `mandatory:"true" json:"tenancyId"` + + // The OCID for the compartment this managed instance resides in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // status of the managed instance. + Status ManagedInstanceStatusEnum `mandatory:"true" json:"status"` + + // Information specified by the user about the managed instance. + Description *string `mandatory:"false" json:"description"` + + // location of the managed instance. + Location ManagedInstanceLocationEnum `mandatory:"false" json:"location,omitempty"` + + // Time at which the instance last checked in, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeLastCheckin *common.SDKTime `mandatory:"false" json:"timeLastCheckin"` + + // Time at which the instance last booted, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeLastBoot *common.SDKTime `mandatory:"false" json:"timeLastBoot"` + + // Operating System Name. + OsName *string `mandatory:"false" json:"osName"` + + // Operating System Version. + OsVersion *string `mandatory:"false" json:"osVersion"` + + // Operating System Kernel Version. + OsKernelVersion *string `mandatory:"false" json:"osKernelVersion"` + + // The ksplice effective kernel version. + KspliceEffectiveKernelVersion *string `mandatory:"false" json:"kspliceEffectiveKernelVersion"` + + // The CPU architecture type of the managed instance. + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` + + // The Operating System type of the managed instance. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The content profile of this instance. + Profile *string `mandatory:"false" json:"profile"` + + // Whether this managed instance is acting as an on-premise management station. + IsManagementStation *bool `mandatory:"false" json:"isManagementStation"` + + // The OCID of a management station to be used as the preferred primary. + PrimaryManagementStationId *string `mandatory:"false" json:"primaryManagementStationId"` + + // The OCID of a management station to be used as the preferred secondary. + SecondaryManagementStationId *string `mandatory:"false" json:"secondaryManagementStationId"` + + // The list of software sources currently attached to the managed instance. + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` + + ManagedInstanceGroup *Id `mandatory:"false" json:"managedInstanceGroup"` + + LifecycleEnvironment *Id `mandatory:"false" json:"lifecycleEnvironment"` + + LifecycleStage *Id `mandatory:"false" json:"lifecycleStage"` + + // Indicates whether a reboot is required to complete installation of updates. + IsRebootRequired *bool `mandatory:"false" json:"isRebootRequired"` + + // Number of packages installed on the system. + InstalledPackages *int `mandatory:"false" json:"installedPackages"` + + // Number of updates available to be installed. + UpdatesAvailable *int `mandatory:"false" json:"updatesAvailable"` + + // Number of security type updates available to be installed. + SecurityUpdatesAvailable *int `mandatory:"false" json:"securityUpdatesAvailable"` + + // Number of bug fix type updates available to be installed. + BugUpdatesAvailable *int `mandatory:"false" json:"bugUpdatesAvailable"` + + // Number of enhancement type updates available to be installed. + EnhancementUpdatesAvailable *int `mandatory:"false" json:"enhancementUpdatesAvailable"` + + // Number of non-classified updates available to be installed. + OtherUpdatesAvailable *int `mandatory:"false" json:"otherUpdatesAvailable"` + + // Number of scheduled jobs associated with this instance. + ScheduledJobCount *int `mandatory:"false" json:"scheduledJobCount"` + + // Number of work requests associated with this instance. + WorkRequestCount *int `mandatory:"false" json:"workRequestCount"` + + // The date and time the work request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time the work request was updated, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m ManagedInstance) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstance) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingManagedInstanceStatusEnum(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(GetManagedInstanceStatusEnumStringValues(), ","))) + } + + if _, ok := GetMappingManagedInstanceLocationEnum(string(m.Location)); !ok && m.Location != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Location: %s. Supported values are: %s.", m.Location, strings.Join(GetManagedInstanceLocationEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_analytic_collection.go b/osmanagementhub/managed_instance_analytic_collection.go new file mode 100644 index 0000000000..51e0c8c148 --- /dev/null +++ b/osmanagementhub/managed_instance_analytic_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceAnalyticCollection Collection of ManagedInstanceAnalyticSummary. +type ManagedInstanceAnalyticCollection struct { + + // List of managed instance analytic summary. + Items []ManagedInstanceAnalyticSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceAnalyticCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceAnalyticCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_analytic_summary.go b/osmanagementhub/managed_instance_analytic_summary.go new file mode 100644 index 0000000000..2ac5971e98 --- /dev/null +++ b/osmanagementhub/managed_instance_analytic_summary.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceAnalyticSummary A metric emitted by managed instance resource. +type ManagedInstanceAnalyticSummary struct { + + // The name of this metric. + Name MetricNameEnum `mandatory:"true" json:"name"` + + // Qualifiers provided in a metric definition. Available dimensions vary by metric namespace. + // Each dimension takes the form of a key-value pair. + // Example: `"managedInstanceId": "ocid1.managementagent.123"` + Dimensions map[string]string `mandatory:"true" json:"dimensions"` + + // The value of this metric. + Count *int `mandatory:"true" json:"count"` +} + +func (m ManagedInstanceAnalyticSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceAnalyticSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingMetricNameEnum(string(m.Name)); !ok && m.Name != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Name: %s. Supported values are: %s.", m.Name, strings.Join(GetMetricNameEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_collection.go b/osmanagementhub/managed_instance_collection.go new file mode 100644 index 0000000000..6f60f70700 --- /dev/null +++ b/osmanagementhub/managed_instance_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceCollection Results of a managed instance search. Contains both managed instance summary items and other data. +type ManagedInstanceCollection struct { + + // List of managed instances. + Items []ManagedInstanceSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_details.go b/osmanagementhub/managed_instance_details.go new file mode 100644 index 0000000000..6b56f44aee --- /dev/null +++ b/osmanagementhub/managed_instance_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceDetails Identifying information for the specified managed instance. +type ManagedInstanceDetails struct { + + // The OCID of the managed instance. + Id *string `mandatory:"true" json:"id"` + + // Managed instance name. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m ManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_erratum_summary.go b/osmanagementhub/managed_instance_erratum_summary.go new file mode 100644 index 0000000000..f8c6a9ad6c --- /dev/null +++ b/osmanagementhub/managed_instance_erratum_summary.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceErratumSummary An erratum associated with a managed instance. +type ManagedInstanceErratumSummary struct { + + // The identifier of the erratum. + Name *string `mandatory:"true" json:"name"` + + // The type of the erratum. + AdvisoryType ClassificationTypesEnum `mandatory:"true" json:"advisoryType"` + + // The list of Packages affected by this erratum. + Packages []PackageNameSummary `mandatory:"true" json:"packages"` + + // The date and time the package was issued by a providing erratum (if available), as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeIssued *common.SDKTime `mandatory:"false" json:"timeIssued"` + + // Summary description of the erratum. + Synopsis *string `mandatory:"false" json:"synopsis"` + + // List of CVEs applicable to this erratum. + RelatedCves []string `mandatory:"false" json:"relatedCves"` +} + +func (m ManagedInstanceErratumSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceErratumSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingClassificationTypesEnum(string(m.AdvisoryType)); !ok && m.AdvisoryType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdvisoryType: %s. Supported values are: %s.", m.AdvisoryType, strings.Join(GetClassificationTypesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_erratum_summary_collection.go b/osmanagementhub/managed_instance_erratum_summary_collection.go new file mode 100644 index 0000000000..b5a9723860 --- /dev/null +++ b/osmanagementhub/managed_instance_erratum_summary_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceErratumSummaryCollection Results of an errata search on a managed instance. +type ManagedInstanceErratumSummaryCollection struct { + + // List of errata. + Items []ManagedInstanceErratumSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceErratumSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceErratumSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group.go b/osmanagementhub/managed_instance_group.go new file mode 100644 index 0000000000..d46e7a54bb --- /dev/null +++ b/osmanagementhub/managed_instance_group.go @@ -0,0 +1,163 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroup Description of managed instance group. +type ManagedInstanceGroup struct { + + // The managed instance group OCID that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the managed instance group. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the managed instance group. + LifecycleState ManagedInstanceGroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Details describing the managed instance group. + Description *string `mandatory:"false" json:"description"` + + // The time the managed instance group was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the managed instance group was last modified. An RFC3339 formatted datetime string. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // The operating system type of the instances in the managed instance group. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The CPU architecture of the instances in the managed instance group. + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"false" json:"vendorName,omitempty"` + + // The list of software sources that the managed instance group will use. + SoftwareSourceIds []SoftwareSourceDetails `mandatory:"false" json:"softwareSourceIds"` + + // The list of managed instances OCIDs attached to the managed instance group. + ManagedInstanceIds []string `mandatory:"false" json:"managedInstanceIds"` + + // The number of Managed Instances in the managed instance group. + ManagedInstanceCount *int `mandatory:"false" json:"managedInstanceCount"` + + // The number of scheduled jobs pending against the managed instance group. + PendingJobCount *int `mandatory:"false" json:"pendingJobCount"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ManagedInstanceGroup) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroup) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingManagedInstanceGroupLifecycleStateEnum(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(GetManagedInstanceGroupLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ManagedInstanceGroupLifecycleStateEnum Enum with underlying type: string +type ManagedInstanceGroupLifecycleStateEnum string + +// Set of constants representing the allowable values for ManagedInstanceGroupLifecycleStateEnum +const ( + ManagedInstanceGroupLifecycleStateCreating ManagedInstanceGroupLifecycleStateEnum = "CREATING" + ManagedInstanceGroupLifecycleStateUpdating ManagedInstanceGroupLifecycleStateEnum = "UPDATING" + ManagedInstanceGroupLifecycleStateActive ManagedInstanceGroupLifecycleStateEnum = "ACTIVE" + ManagedInstanceGroupLifecycleStateDeleting ManagedInstanceGroupLifecycleStateEnum = "DELETING" + ManagedInstanceGroupLifecycleStateDeleted ManagedInstanceGroupLifecycleStateEnum = "DELETED" + ManagedInstanceGroupLifecycleStateFailed ManagedInstanceGroupLifecycleStateEnum = "FAILED" +) + +var mappingManagedInstanceGroupLifecycleStateEnum = map[string]ManagedInstanceGroupLifecycleStateEnum{ + "CREATING": ManagedInstanceGroupLifecycleStateCreating, + "UPDATING": ManagedInstanceGroupLifecycleStateUpdating, + "ACTIVE": ManagedInstanceGroupLifecycleStateActive, + "DELETING": ManagedInstanceGroupLifecycleStateDeleting, + "DELETED": ManagedInstanceGroupLifecycleStateDeleted, + "FAILED": ManagedInstanceGroupLifecycleStateFailed, +} + +var mappingManagedInstanceGroupLifecycleStateEnumLowerCase = map[string]ManagedInstanceGroupLifecycleStateEnum{ + "creating": ManagedInstanceGroupLifecycleStateCreating, + "updating": ManagedInstanceGroupLifecycleStateUpdating, + "active": ManagedInstanceGroupLifecycleStateActive, + "deleting": ManagedInstanceGroupLifecycleStateDeleting, + "deleted": ManagedInstanceGroupLifecycleStateDeleted, + "failed": ManagedInstanceGroupLifecycleStateFailed, +} + +// GetManagedInstanceGroupLifecycleStateEnumValues Enumerates the set of values for ManagedInstanceGroupLifecycleStateEnum +func GetManagedInstanceGroupLifecycleStateEnumValues() []ManagedInstanceGroupLifecycleStateEnum { + values := make([]ManagedInstanceGroupLifecycleStateEnum, 0) + for _, v := range mappingManagedInstanceGroupLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetManagedInstanceGroupLifecycleStateEnumStringValues Enumerates the set of values in String for ManagedInstanceGroupLifecycleStateEnum +func GetManagedInstanceGroupLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingManagedInstanceGroupLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingManagedInstanceGroupLifecycleStateEnum(val string) (ManagedInstanceGroupLifecycleStateEnum, bool) { + enum, ok := mappingManagedInstanceGroupLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/managed_instance_group_available_module_collection.go b/osmanagementhub/managed_instance_group_available_module_collection.go new file mode 100644 index 0000000000..6c82a0952d --- /dev/null +++ b/osmanagementhub/managed_instance_group_available_module_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupAvailableModuleCollection Results of a module stream profile search. Contains both ModuleStreamProfileSummary items and other information, such as metadata. +type ManagedInstanceGroupAvailableModuleCollection struct { + + // List of module stream profile. + Items []ManagedInstanceGroupAvailableModuleSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceGroupAvailableModuleCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupAvailableModuleCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_available_module_summary.go b/osmanagementhub/managed_instance_group_available_module_summary.go new file mode 100644 index 0000000000..8b1ee7a395 --- /dev/null +++ b/osmanagementhub/managed_instance_group_available_module_summary.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupAvailableModuleSummary Summary information pertaining to a module stream profile provided by a software source. +type ManagedInstanceGroupAvailableModuleSummary struct { + + // The name of the module that is available to be enabled on the managed instance group. + Name *string `mandatory:"true" json:"name"` + + // The OCID of the software source that provides this module. + SoftwareSourceId *string `mandatory:"false" json:"softwareSourceId"` +} + +func (m ManagedInstanceGroupAvailableModuleSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupAvailableModuleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_available_package_collection.go b/osmanagementhub/managed_instance_group_available_package_collection.go new file mode 100644 index 0000000000..3d1c187f12 --- /dev/null +++ b/osmanagementhub/managed_instance_group_available_package_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupAvailablePackageCollection Results of an available package search on a managed instance group. +type ManagedInstanceGroupAvailablePackageCollection struct { + + // List of available packages. + Items []ManagedInstanceGroupAvailablePackageSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceGroupAvailablePackageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupAvailablePackageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_available_package_summary.go b/osmanagementhub/managed_instance_group_available_package_summary.go new file mode 100644 index 0000000000..7190a70945 --- /dev/null +++ b/osmanagementhub/managed_instance_group_available_package_summary.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupAvailablePackageSummary Summary information pertaining to an available package for a managed instance group. +type ManagedInstanceGroupAvailablePackageSummary struct { + + // Package name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Unique identifier for the package. NOTE - This is not an OCID. + Name *string `mandatory:"true" json:"name"` + + // Type of the package. + Type *string `mandatory:"true" json:"type"` + + // Version of the installed package. + Version *string `mandatory:"true" json:"version"` + + // The architecture for which this package was built. + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` + + // List of software sources that provide the software package. + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` + + // Flag to return only latest package versions. + IsLatest *bool `mandatory:"false" json:"isLatest"` +} + +func (m ManagedInstanceGroupAvailablePackageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupAvailablePackageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_collection.go b/osmanagementhub/managed_instance_group_collection.go new file mode 100644 index 0000000000..6c03183418 --- /dev/null +++ b/osmanagementhub/managed_instance_group_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupCollection Results of a managed instance group search. Contains both managed instance group summary items and other data. +type ManagedInstanceGroupCollection struct { + + // List of managed instance groups. + Items []ManagedInstanceGroupSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceGroupCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_details.go b/osmanagementhub/managed_instance_group_details.go new file mode 100644 index 0000000000..9a9c2bc7a8 --- /dev/null +++ b/osmanagementhub/managed_instance_group_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupDetails Identifying information for the specified managed instance group. +type ManagedInstanceGroupDetails struct { + + // The OCID of the managed instance group. + Id *string `mandatory:"true" json:"id"` + + // Managed instance group displayName. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m ManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_installed_package_collection.go b/osmanagementhub/managed_instance_group_installed_package_collection.go new file mode 100644 index 0000000000..35f13fe591 --- /dev/null +++ b/osmanagementhub/managed_instance_group_installed_package_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupInstalledPackageCollection Results of a search for installed packages on a managed instance group. +type ManagedInstanceGroupInstalledPackageCollection struct { + + // List of installed packages. + Items []ManagedInstanceGroupInstalledPackageSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceGroupInstalledPackageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupInstalledPackageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_installed_package_summary.go b/osmanagementhub/managed_instance_group_installed_package_summary.go new file mode 100644 index 0000000000..b1c0e4354b --- /dev/null +++ b/osmanagementhub/managed_instance_group_installed_package_summary.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupInstalledPackageSummary Summary information pertaining to an installed package on a managed instance group. +type ManagedInstanceGroupInstalledPackageSummary struct { + + // The name of the package that is installed on the managed instance group. + Name *string `mandatory:"true" json:"name"` + + // The architecture of the package that is installed on the managed instance group. + Architecture *string `mandatory:"true" json:"architecture"` +} + +func (m ManagedInstanceGroupInstalledPackageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupInstalledPackageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_module_collection.go b/osmanagementhub/managed_instance_group_module_collection.go new file mode 100644 index 0000000000..bea7db7be5 --- /dev/null +++ b/osmanagementhub/managed_instance_group_module_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupModuleCollection Results of a search for module streams on a managed instance group. +// Contains both ModuleStreamOnManagedInstanceGroupSummary items and other data. +type ManagedInstanceGroupModuleCollection struct { + + // List of module streams. + Items []ManagedInstanceGroupModuleSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceGroupModuleCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupModuleCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_module_summary.go b/osmanagementhub/managed_instance_group_module_summary.go new file mode 100644 index 0000000000..4a63f3a997 --- /dev/null +++ b/osmanagementhub/managed_instance_group_module_summary.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupModuleSummary Summary information pertaining to a module on a managed instance group. +type ManagedInstanceGroupModuleSummary struct { + + // The name of the module that contains the stream. + Name *string `mandatory:"true" json:"name"` + + // The name of the module that contains the stream. + EnabledStream *string `mandatory:"false" json:"enabledStream"` + + // The list of installed profiles under the currently enabled module stream. + InstalledProfiles []string `mandatory:"false" json:"installedProfiles"` + + // The OCID of the software source that provides this module stream. + SoftwareSourceId *string `mandatory:"false" json:"softwareSourceId"` +} + +func (m ManagedInstanceGroupModuleSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupModuleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_group_summary.go b/osmanagementhub/managed_instance_group_summary.go new file mode 100644 index 0000000000..048465e574 --- /dev/null +++ b/osmanagementhub/managed_instance_group_summary.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceGroupSummary Summary of the managed instance group. +type ManagedInstanceGroupSummary struct { + + // Unique identifier that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy containing the managed instance groups to list. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the managed instance group. + LifecycleState ManagedInstanceGroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // A user-friendly name for the managed instance group. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // managed instance group Description. + Description *string `mandatory:"false" json:"description"` + + // The number of Managed Instances in the managed instance group. + ManagedInstanceCount *int `mandatory:"false" json:"managedInstanceCount"` + + // The time the managed instance group was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the managed instance group was last modified. An RFC3339 formatted datetime string. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // The operating system type of the instances in the managed instance group. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The CPU architecture of the instances in the managed instance group. + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"false" json:"vendorName,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // 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 ManagedInstanceGroupSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceGroupSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingManagedInstanceGroupLifecycleStateEnum(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(GetManagedInstanceGroupLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_location.go b/osmanagementhub/managed_instance_location.go new file mode 100644 index 0000000000..16cd6d2ec3 --- /dev/null +++ b/osmanagementhub/managed_instance_location.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ManagedInstanceLocationEnum Enum with underlying type: string +type ManagedInstanceLocationEnum string + +// Set of constants representing the allowable values for ManagedInstanceLocationEnum +const ( + ManagedInstanceLocationOnPremise ManagedInstanceLocationEnum = "ON_PREMISE" + ManagedInstanceLocationOciCompute ManagedInstanceLocationEnum = "OCI_COMPUTE" + ManagedInstanceLocationAzure ManagedInstanceLocationEnum = "AZURE" + ManagedInstanceLocationEc2 ManagedInstanceLocationEnum = "EC2" +) + +var mappingManagedInstanceLocationEnum = map[string]ManagedInstanceLocationEnum{ + "ON_PREMISE": ManagedInstanceLocationOnPremise, + "OCI_COMPUTE": ManagedInstanceLocationOciCompute, + "AZURE": ManagedInstanceLocationAzure, + "EC2": ManagedInstanceLocationEc2, +} + +var mappingManagedInstanceLocationEnumLowerCase = map[string]ManagedInstanceLocationEnum{ + "on_premise": ManagedInstanceLocationOnPremise, + "oci_compute": ManagedInstanceLocationOciCompute, + "azure": ManagedInstanceLocationAzure, + "ec2": ManagedInstanceLocationEc2, +} + +// GetManagedInstanceLocationEnumValues Enumerates the set of values for ManagedInstanceLocationEnum +func GetManagedInstanceLocationEnumValues() []ManagedInstanceLocationEnum { + values := make([]ManagedInstanceLocationEnum, 0) + for _, v := range mappingManagedInstanceLocationEnum { + values = append(values, v) + } + return values +} + +// GetManagedInstanceLocationEnumStringValues Enumerates the set of values in String for ManagedInstanceLocationEnum +func GetManagedInstanceLocationEnumStringValues() []string { + return []string{ + "ON_PREMISE", + "OCI_COMPUTE", + "AZURE", + "EC2", + } +} + +// GetMappingManagedInstanceLocationEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingManagedInstanceLocationEnum(val string) (ManagedInstanceLocationEnum, bool) { + enum, ok := mappingManagedInstanceLocationEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/managed_instance_module_collection.go b/osmanagementhub/managed_instance_module_collection.go new file mode 100644 index 0000000000..3b21b78286 --- /dev/null +++ b/osmanagementhub/managed_instance_module_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceModuleCollection Results of a search for module streams on a managed instance. +// Contains both ManagedInstanceModuleSummary items and other data. +type ManagedInstanceModuleCollection struct { + + // List of module streams. + Items []ManagedInstanceModuleSummary `mandatory:"true" json:"items"` +} + +func (m ManagedInstanceModuleCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceModuleCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_module_summary.go b/osmanagementhub/managed_instance_module_summary.go new file mode 100644 index 0000000000..292ec7addb --- /dev/null +++ b/osmanagementhub/managed_instance_module_summary.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceModuleSummary Summary information pertaining to a module on a managed instance. +type ManagedInstanceModuleSummary struct { + + // The module name. + Name *string `mandatory:"true" json:"name"` + + // The stream that is enabled in the module. + EnabledStream *string `mandatory:"false" json:"enabledStream"` + + // List of installed profiles in the enabled stream of the module. + InstalledProfiles []string `mandatory:"false" json:"installedProfiles"` + + // List of streams that are active in the module. + ActiveStreams []string `mandatory:"false" json:"activeStreams"` + + // List of streams that are disabled in the module. + DisabledStreams []string `mandatory:"false" json:"disabledStreams"` + + // The OCID of the software source that provides this module and the associated streams. + SoftwareSourceId *string `mandatory:"false" json:"softwareSourceId"` +} + +func (m ManagedInstanceModuleSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceModuleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instance_status.go b/osmanagementhub/managed_instance_status.go new file mode 100644 index 0000000000..ddc8486ba1 --- /dev/null +++ b/osmanagementhub/managed_instance_status.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ManagedInstanceStatusEnum Enum with underlying type: string +type ManagedInstanceStatusEnum string + +// Set of constants representing the allowable values for ManagedInstanceStatusEnum +const ( + ManagedInstanceStatusNormal ManagedInstanceStatusEnum = "NORMAL" + ManagedInstanceStatusUnreachable ManagedInstanceStatusEnum = "UNREACHABLE" + ManagedInstanceStatusError ManagedInstanceStatusEnum = "ERROR" + ManagedInstanceStatusWarning ManagedInstanceStatusEnum = "WARNING" + ManagedInstanceStatusRegistrationError ManagedInstanceStatusEnum = "REGISTRATION_ERROR" +) + +var mappingManagedInstanceStatusEnum = map[string]ManagedInstanceStatusEnum{ + "NORMAL": ManagedInstanceStatusNormal, + "UNREACHABLE": ManagedInstanceStatusUnreachable, + "ERROR": ManagedInstanceStatusError, + "WARNING": ManagedInstanceStatusWarning, + "REGISTRATION_ERROR": ManagedInstanceStatusRegistrationError, +} + +var mappingManagedInstanceStatusEnumLowerCase = map[string]ManagedInstanceStatusEnum{ + "normal": ManagedInstanceStatusNormal, + "unreachable": ManagedInstanceStatusUnreachable, + "error": ManagedInstanceStatusError, + "warning": ManagedInstanceStatusWarning, + "registration_error": ManagedInstanceStatusRegistrationError, +} + +// GetManagedInstanceStatusEnumValues Enumerates the set of values for ManagedInstanceStatusEnum +func GetManagedInstanceStatusEnumValues() []ManagedInstanceStatusEnum { + values := make([]ManagedInstanceStatusEnum, 0) + for _, v := range mappingManagedInstanceStatusEnum { + values = append(values, v) + } + return values +} + +// GetManagedInstanceStatusEnumStringValues Enumerates the set of values in String for ManagedInstanceStatusEnum +func GetManagedInstanceStatusEnumStringValues() []string { + return []string{ + "NORMAL", + "UNREACHABLE", + "ERROR", + "WARNING", + "REGISTRATION_ERROR", + } +} + +// GetMappingManagedInstanceStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingManagedInstanceStatusEnum(val string) (ManagedInstanceStatusEnum, bool) { + enum, ok := mappingManagedInstanceStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/managed_instance_summary.go b/osmanagementhub/managed_instance_summary.go new file mode 100644 index 0000000000..856a4d77f6 --- /dev/null +++ b/osmanagementhub/managed_instance_summary.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstanceSummary Summary of the ManagedInstance. +type ManagedInstanceSummary struct { + + // The OCID for the managed instance. + Id *string `mandatory:"true" json:"id"` + + // Managed instance identifier. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID for the tenancy this managed instance resides in. + TenancyId *string `mandatory:"true" json:"tenancyId"` + + // The OCID for the compartment this managed instance resides in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // status of the managed instance. + Status ManagedInstanceStatusEnum `mandatory:"true" json:"status"` + + // Information specified by the user about the managed instance. + Description *string `mandatory:"false" json:"description"` + + // Location of the managed instance. + Location ManagedInstanceLocationEnum `mandatory:"false" json:"location,omitempty"` + + // The CPU architecture type of the managed instance. + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` + + // The Operating System type of the managed instance. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + ManagedInstanceGroup *Id `mandatory:"false" json:"managedInstanceGroup"` + + LifecycleEnvironment *Id `mandatory:"false" json:"lifecycleEnvironment"` + + LifecycleStage *Id `mandatory:"false" json:"lifecycleStage"` + + // Indicates whether a reboot is required to complete installation of updates. + IsRebootRequired *bool `mandatory:"false" json:"isRebootRequired"` + + // Number of updates available to be installed. + UpdatesAvailable *int `mandatory:"false" json:"updatesAvailable"` + + // Whether this managed instance is acting as an on-premise management station. + IsManagementStation *bool `mandatory:"false" json:"isManagementStation"` +} + +func (m ManagedInstanceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstanceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingManagedInstanceStatusEnum(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(GetManagedInstanceStatusEnumStringValues(), ","))) + } + + if _, ok := GetMappingManagedInstanceLocationEnum(string(m.Location)); !ok && m.Location != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Location: %s. Supported values are: %s.", m.Location, strings.Join(GetManagedInstanceLocationEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/managed_instances_details.go b/osmanagementhub/managed_instances_details.go new file mode 100644 index 0000000000..5a8954393b --- /dev/null +++ b/osmanagementhub/managed_instances_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagedInstancesDetails The details about the managed instances. +type ManagedInstancesDetails struct { + + // The list of managed instance OCIDs to be attached/detached. + ManagedInstances []string `mandatory:"true" json:"managedInstances"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m ManagedInstancesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagedInstancesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/management_station.go b/osmanagementhub/management_station.go new file mode 100644 index 0000000000..d12cd00698 --- /dev/null +++ b/osmanagementhub/management_station.go @@ -0,0 +1,160 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagementStation Detailed information about an ManagementStation config +type ManagementStation struct { + + // OCID for the ManagementStation config + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the Management Station. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // ManagementStation name + DisplayName *string `mandatory:"true" json:"displayName"` + + // Name of the host + Hostname *string `mandatory:"true" json:"hostname"` + + Proxy *ProxyConfiguration `mandatory:"true" json:"proxy"` + + Mirror *MirrorConfiguration `mandatory:"true" json:"mirror"` + + // OCID for the Instance associated with the Management Station. + ManagedInstanceId *string `mandatory:"false" json:"managedInstanceId"` + + // OCID of the Scheduled Job for mirror sync + ScheduledJobId *string `mandatory:"false" json:"scheduledJobId"` + + // OCID of the Profile associated with the Station + ProfileId *string `mandatory:"false" json:"profileId"` + + // Details describing the ManagementStation config. + Description *string `mandatory:"false" json:"description"` + + // Current state of the mirroring + OverallState OverallStateEnum `mandatory:"false" json:"overallState,omitempty"` + + // A decimal number representing the completeness percentage + OverallPercentage *int `mandatory:"false" json:"overallPercentage"` + + // A decimal number representing the mirror capacity + MirrorCapacity *int `mandatory:"false" json:"mirrorCapacity"` + + // A decimal number representing the total of repos + TotalMirrors *int `mandatory:"false" json:"totalMirrors"` + + MirrorSyncStatus *MirrorSyncStatus `mandatory:"false" json:"mirrorSyncStatus"` + + // The current state of the Management Station config. + LifecycleState ManagementStationLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ManagementStation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagementStation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingOverallStateEnum(string(m.OverallState)); !ok && m.OverallState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OverallState: %s. Supported values are: %s.", m.OverallState, strings.Join(GetOverallStateEnumStringValues(), ","))) + } + if _, ok := GetMappingManagementStationLifecycleStateEnum(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(GetManagementStationLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ManagementStationLifecycleStateEnum Enum with underlying type: string +type ManagementStationLifecycleStateEnum string + +// Set of constants representing the allowable values for ManagementStationLifecycleStateEnum +const ( + ManagementStationLifecycleStateCreating ManagementStationLifecycleStateEnum = "CREATING" + ManagementStationLifecycleStateUpdating ManagementStationLifecycleStateEnum = "UPDATING" + ManagementStationLifecycleStateActive ManagementStationLifecycleStateEnum = "ACTIVE" + ManagementStationLifecycleStateDeleting ManagementStationLifecycleStateEnum = "DELETING" + ManagementStationLifecycleStateDeleted ManagementStationLifecycleStateEnum = "DELETED" + ManagementStationLifecycleStateFailed ManagementStationLifecycleStateEnum = "FAILED" +) + +var mappingManagementStationLifecycleStateEnum = map[string]ManagementStationLifecycleStateEnum{ + "CREATING": ManagementStationLifecycleStateCreating, + "UPDATING": ManagementStationLifecycleStateUpdating, + "ACTIVE": ManagementStationLifecycleStateActive, + "DELETING": ManagementStationLifecycleStateDeleting, + "DELETED": ManagementStationLifecycleStateDeleted, + "FAILED": ManagementStationLifecycleStateFailed, +} + +var mappingManagementStationLifecycleStateEnumLowerCase = map[string]ManagementStationLifecycleStateEnum{ + "creating": ManagementStationLifecycleStateCreating, + "updating": ManagementStationLifecycleStateUpdating, + "active": ManagementStationLifecycleStateActive, + "deleting": ManagementStationLifecycleStateDeleting, + "deleted": ManagementStationLifecycleStateDeleted, + "failed": ManagementStationLifecycleStateFailed, +} + +// GetManagementStationLifecycleStateEnumValues Enumerates the set of values for ManagementStationLifecycleStateEnum +func GetManagementStationLifecycleStateEnumValues() []ManagementStationLifecycleStateEnum { + values := make([]ManagementStationLifecycleStateEnum, 0) + for _, v := range mappingManagementStationLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetManagementStationLifecycleStateEnumStringValues Enumerates the set of values in String for ManagementStationLifecycleStateEnum +func GetManagementStationLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingManagementStationLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingManagementStationLifecycleStateEnum(val string) (ManagementStationLifecycleStateEnum, bool) { + enum, ok := mappingManagementStationLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/management_station_collection.go b/osmanagementhub/management_station_collection.go new file mode 100644 index 0000000000..be224edc8e --- /dev/null +++ b/osmanagementhub/management_station_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagementStationCollection Results of a managementstation search. Contains boh ManagementStationSummary items and other information, such as metadata. +type ManagementStationCollection struct { + + // List of managementStations. + Items []ManagementStationSummary `mandatory:"true" json:"items"` +} + +func (m ManagementStationCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagementStationCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/management_station_details.go b/osmanagementhub/management_station_details.go new file mode 100644 index 0000000000..14f26b6bfd --- /dev/null +++ b/osmanagementhub/management_station_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagementStationDetails The config details of the management stations to be configured for a managed instance. +type ManagementStationDetails struct { + + // The OCID of a management station to be used as the preferred primary. + PrimaryManagementStationId *string `mandatory:"true" json:"primaryManagementStationId"` + + // The OCID of a management station to be used as the preferred secondary. + SecondaryManagementStationId *string `mandatory:"false" json:"secondaryManagementStationId"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m ManagementStationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagementStationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/management_station_summary.go b/osmanagementhub/management_station_summary.go new file mode 100644 index 0000000000..158dc68ef7 --- /dev/null +++ b/osmanagementhub/management_station_summary.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ManagementStationSummary Summary of the Management Station. +type ManagementStationSummary struct { + + // OCID for the Management Station + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the Management Station. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // ManagementStation name + DisplayName *string `mandatory:"true" json:"displayName"` + + // Name of the host + Hostname *string `mandatory:"true" json:"hostname"` + + // OCID for the Instance associated with the Management Station + ManagedInstanceId *string `mandatory:"false" json:"managedInstanceId"` + + // OCID of the Registration Profile associated with the Management Station + ProfileId *string `mandatory:"false" json:"profileId"` + + // OCID of the Scheduled Job for mirror sync + ScheduledJobId *string `mandatory:"false" json:"scheduledJobId"` + + // the time/date of the next scheduled execution of the Scheduled Job + TimeNextExecution *common.SDKTime `mandatory:"false" json:"timeNextExecution"` + + // Details describing the Management Station config. + Description *string `mandatory:"false" json:"description"` + + // Current state of the mirroring + OverallState OverallStateEnum `mandatory:"false" json:"overallState,omitempty"` + + // A decimal number representing the completeness percentage + OverallPercentage *int `mandatory:"false" json:"overallPercentage"` + + // A decimal number representing the mirror capacity + MirrorCapacity *int `mandatory:"false" json:"mirrorCapacity"` + + // The current state of the Management Station config. + LifecycleState ManagementStationLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ManagementStationSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ManagementStationSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingOverallStateEnum(string(m.OverallState)); !ok && m.OverallState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OverallState: %s. Supported values are: %s.", m.OverallState, strings.Join(GetOverallStateEnumStringValues(), ","))) + } + if _, ok := GetMappingManagementStationLifecycleStateEnum(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(GetManagementStationLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/metric_name.go b/osmanagementhub/metric_name.go new file mode 100644 index 0000000000..900189490e --- /dev/null +++ b/osmanagementhub/metric_name.go @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// MetricNameEnum Enum with underlying type: string +type MetricNameEnum string + +// Set of constants representing the allowable values for MetricNameEnum +const ( + MetricNameTotalInstanceCount MetricNameEnum = "TOTAL_INSTANCE_COUNT" + MetricNameInstanceWithAvailableSecurityUpdatesCount MetricNameEnum = "INSTANCE_WITH_AVAILABLE_SECURITY_UPDATES_COUNT" + MetricNameInstanceWithAvailableBugfixUpdatesCount MetricNameEnum = "INSTANCE_WITH_AVAILABLE_BUGFIX_UPDATES_COUNT" + MetricNameNormalInstanceCount MetricNameEnum = "NORMAL_INSTANCE_COUNT" + MetricNameErrorInstanceCount MetricNameEnum = "ERROR_INSTANCE_COUNT" + MetricNameWarningInstanceCount MetricNameEnum = "WARNING_INSTANCE_COUNT" + MetricNameUnreachableInstanceCount MetricNameEnum = "UNREACHABLE_INSTANCE_COUNT" + MetricNameRegistrationFailedInstanceCount MetricNameEnum = "REGISTRATION_FAILED_INSTANCE_COUNT" + MetricNameInstanceSecurityUpdatesCount MetricNameEnum = "INSTANCE_SECURITY_UPDATES_COUNT" + MetricNameInstanceBugfixUpdatesCount MetricNameEnum = "INSTANCE_BUGFIX_UPDATES_COUNT" +) + +var mappingMetricNameEnum = map[string]MetricNameEnum{ + "TOTAL_INSTANCE_COUNT": MetricNameTotalInstanceCount, + "INSTANCE_WITH_AVAILABLE_SECURITY_UPDATES_COUNT": MetricNameInstanceWithAvailableSecurityUpdatesCount, + "INSTANCE_WITH_AVAILABLE_BUGFIX_UPDATES_COUNT": MetricNameInstanceWithAvailableBugfixUpdatesCount, + "NORMAL_INSTANCE_COUNT": MetricNameNormalInstanceCount, + "ERROR_INSTANCE_COUNT": MetricNameErrorInstanceCount, + "WARNING_INSTANCE_COUNT": MetricNameWarningInstanceCount, + "UNREACHABLE_INSTANCE_COUNT": MetricNameUnreachableInstanceCount, + "REGISTRATION_FAILED_INSTANCE_COUNT": MetricNameRegistrationFailedInstanceCount, + "INSTANCE_SECURITY_UPDATES_COUNT": MetricNameInstanceSecurityUpdatesCount, + "INSTANCE_BUGFIX_UPDATES_COUNT": MetricNameInstanceBugfixUpdatesCount, +} + +var mappingMetricNameEnumLowerCase = map[string]MetricNameEnum{ + "total_instance_count": MetricNameTotalInstanceCount, + "instance_with_available_security_updates_count": MetricNameInstanceWithAvailableSecurityUpdatesCount, + "instance_with_available_bugfix_updates_count": MetricNameInstanceWithAvailableBugfixUpdatesCount, + "normal_instance_count": MetricNameNormalInstanceCount, + "error_instance_count": MetricNameErrorInstanceCount, + "warning_instance_count": MetricNameWarningInstanceCount, + "unreachable_instance_count": MetricNameUnreachableInstanceCount, + "registration_failed_instance_count": MetricNameRegistrationFailedInstanceCount, + "instance_security_updates_count": MetricNameInstanceSecurityUpdatesCount, + "instance_bugfix_updates_count": MetricNameInstanceBugfixUpdatesCount, +} + +// GetMetricNameEnumValues Enumerates the set of values for MetricNameEnum +func GetMetricNameEnumValues() []MetricNameEnum { + values := make([]MetricNameEnum, 0) + for _, v := range mappingMetricNameEnum { + values = append(values, v) + } + return values +} + +// GetMetricNameEnumStringValues Enumerates the set of values in String for MetricNameEnum +func GetMetricNameEnumStringValues() []string { + return []string{ + "TOTAL_INSTANCE_COUNT", + "INSTANCE_WITH_AVAILABLE_SECURITY_UPDATES_COUNT", + "INSTANCE_WITH_AVAILABLE_BUGFIX_UPDATES_COUNT", + "NORMAL_INSTANCE_COUNT", + "ERROR_INSTANCE_COUNT", + "WARNING_INSTANCE_COUNT", + "UNREACHABLE_INSTANCE_COUNT", + "REGISTRATION_FAILED_INSTANCE_COUNT", + "INSTANCE_SECURITY_UPDATES_COUNT", + "INSTANCE_BUGFIX_UPDATES_COUNT", + } +} + +// GetMappingMetricNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingMetricNameEnum(val string) (MetricNameEnum, bool) { + enum, ok := mappingMetricNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/mirror_configuration.go b/osmanagementhub/mirror_configuration.go new file mode 100644 index 0000000000..3bed25c27e --- /dev/null +++ b/osmanagementhub/mirror_configuration.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MirrorConfiguration Information for a mirror configuration +type MirrorConfiguration struct { + + // Directory for the mirroring + Directory *string `mandatory:"true" json:"directory"` + + // Default port for the mirror + Port *string `mandatory:"true" json:"port"` + + // Default sslport for the mirror + Sslport *string `mandatory:"true" json:"sslport"` + + // Local path for the sslcert + Sslcert *string `mandatory:"false" json:"sslcert"` +} + +func (m MirrorConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MirrorConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/mirror_state.go b/osmanagementhub/mirror_state.go new file mode 100644 index 0000000000..931aaf19ed --- /dev/null +++ b/osmanagementhub/mirror_state.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// MirrorStateEnum Enum with underlying type: string +type MirrorStateEnum string + +// Set of constants representing the allowable values for MirrorStateEnum +const ( + MirrorStateUnsynced MirrorStateEnum = "UNSYNCED" + MirrorStateQueued MirrorStateEnum = "QUEUED" + MirrorStateSyncing MirrorStateEnum = "SYNCING" + MirrorStateSynced MirrorStateEnum = "SYNCED" + MirrorStateFailed MirrorStateEnum = "FAILED" +) + +var mappingMirrorStateEnum = map[string]MirrorStateEnum{ + "UNSYNCED": MirrorStateUnsynced, + "QUEUED": MirrorStateQueued, + "SYNCING": MirrorStateSyncing, + "SYNCED": MirrorStateSynced, + "FAILED": MirrorStateFailed, +} + +var mappingMirrorStateEnumLowerCase = map[string]MirrorStateEnum{ + "unsynced": MirrorStateUnsynced, + "queued": MirrorStateQueued, + "syncing": MirrorStateSyncing, + "synced": MirrorStateSynced, + "failed": MirrorStateFailed, +} + +// GetMirrorStateEnumValues Enumerates the set of values for MirrorStateEnum +func GetMirrorStateEnumValues() []MirrorStateEnum { + values := make([]MirrorStateEnum, 0) + for _, v := range mappingMirrorStateEnum { + values = append(values, v) + } + return values +} + +// GetMirrorStateEnumStringValues Enumerates the set of values in String for MirrorStateEnum +func GetMirrorStateEnumStringValues() []string { + return []string{ + "UNSYNCED", + "QUEUED", + "SYNCING", + "SYNCED", + "FAILED", + } +} + +// GetMappingMirrorStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingMirrorStateEnum(val string) (MirrorStateEnum, bool) { + enum, ok := mappingMirrorStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/mirror_summary.go b/osmanagementhub/mirror_summary.go new file mode 100644 index 0000000000..fd5eb730e2 --- /dev/null +++ b/osmanagementhub/mirror_summary.go @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MirrorSummary Summary of a Mirror +type MirrorSummary struct { + + // OCID of a software source + Id *string `mandatory:"true" json:"id"` + + // Current state of the mirror + State MirrorStateEnum `mandatory:"true" json:"state"` + + // A decimal number representing the completness percentage + Percentage *int `mandatory:"true" json:"percentage"` + + // Timestamp of the last time the mirror was sync + TimeLastSynced *common.SDKTime `mandatory:"true" json:"timeLastSynced"` + + // The current log from the management station plugin. + Log *string `mandatory:"true" json:"log"` + + // Display name of the mirror + DisplayName *string `mandatory:"false" json:"displayName"` + + // Type of the mirror + Type MirrorTypeEnum `mandatory:"false" json:"type,omitempty"` + + // The OS family the Software Source belongs to + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The architecture type supported by the Software Source + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` +} + +func (m MirrorSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MirrorSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingMirrorStateEnum(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(GetMirrorStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingMirrorTypeEnum(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(GetMirrorTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/mirror_sync_status.go b/osmanagementhub/mirror_sync_status.go new file mode 100644 index 0000000000..be1161c22b --- /dev/null +++ b/osmanagementhub/mirror_sync_status.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MirrorSyncStatus Status summary of all repos +type MirrorSyncStatus struct { + + // Total of mirrors in 'failed' state + Unsynced *int `mandatory:"true" json:"unsynced"` + + // Total of mirrors in 'queued' state + Queued *int `mandatory:"true" json:"queued"` + + // Total of mirrors in 'syncing' state + Syncing *int `mandatory:"true" json:"syncing"` + + // Total of mirrors in 'synced' state + Synced *int `mandatory:"true" json:"synced"` + + // Total of mirrors in 'failed' state + Failed *int `mandatory:"true" json:"failed"` +} + +func (m MirrorSyncStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MirrorSyncStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/mirror_type.go b/osmanagementhub/mirror_type.go new file mode 100644 index 0000000000..e7c28f9f5a --- /dev/null +++ b/osmanagementhub/mirror_type.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// MirrorTypeEnum Enum with underlying type: string +type MirrorTypeEnum string + +// Set of constants representing the allowable values for MirrorTypeEnum +const ( + MirrorTypeCustom MirrorTypeEnum = "CUSTOM" + MirrorTypeVendor MirrorTypeEnum = "VENDOR" + MirrorTypeVersioned MirrorTypeEnum = "VERSIONED" +) + +var mappingMirrorTypeEnum = map[string]MirrorTypeEnum{ + "CUSTOM": MirrorTypeCustom, + "VENDOR": MirrorTypeVendor, + "VERSIONED": MirrorTypeVersioned, +} + +var mappingMirrorTypeEnumLowerCase = map[string]MirrorTypeEnum{ + "custom": MirrorTypeCustom, + "vendor": MirrorTypeVendor, + "versioned": MirrorTypeVersioned, +} + +// GetMirrorTypeEnumValues Enumerates the set of values for MirrorTypeEnum +func GetMirrorTypeEnumValues() []MirrorTypeEnum { + values := make([]MirrorTypeEnum, 0) + for _, v := range mappingMirrorTypeEnum { + values = append(values, v) + } + return values +} + +// GetMirrorTypeEnumStringValues Enumerates the set of values in String for MirrorTypeEnum +func GetMirrorTypeEnumStringValues() []string { + return []string{ + "CUSTOM", + "VENDOR", + "VERSIONED", + } +} + +// GetMappingMirrorTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingMirrorTypeEnum(val string) (MirrorTypeEnum, bool) { + enum, ok := mappingMirrorTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/mirrors_collection.go b/osmanagementhub/mirrors_collection.go new file mode 100644 index 0000000000..ea1900002f --- /dev/null +++ b/osmanagementhub/mirrors_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MirrorsCollection List of mirrors associated with a Management Station +type MirrorsCollection struct { + + // List of mirrors + Items []MirrorSummary `mandatory:"true" json:"items"` +} + +func (m MirrorsCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MirrorsCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_collection.go b/osmanagementhub/module_collection.go new file mode 100644 index 0000000000..d47ce9e617 --- /dev/null +++ b/osmanagementhub/module_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleCollection Results of a Module search. Contains module summary items and other information, such as metadata. +type ModuleCollection struct { + + // List of Modules. + Items []ModuleSummary `mandatory:"true" json:"items"` +} + +func (m ModuleCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_spec_details.go b/osmanagementhub/module_spec_details.go new file mode 100644 index 0000000000..b6fa40ae84 --- /dev/null +++ b/osmanagementhub/module_spec_details.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleSpecDetails Details about a specific appstream module. +type ModuleSpecDetails struct { + + // Name of the module. + Name *string `mandatory:"true" json:"name"` + + // The stream of the module. + Stream *string `mandatory:"false" json:"stream"` + + // The module profile to be used. + Profile *string `mandatory:"false" json:"profile"` +} + +func (m ModuleSpecDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleSpecDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream.go b/osmanagementhub/module_stream.go new file mode 100644 index 0000000000..75752d3e13 --- /dev/null +++ b/osmanagementhub/module_stream.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStream A module stream provided by a software source. +type ModuleStream struct { + + // The name of the module that contains the stream. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of the stream. + Name *string `mandatory:"true" json:"name"` + + // Indicates if this stream is the default for its module. + IsDefault *bool `mandatory:"false" json:"isDefault"` + + // The OCID of the software source that provides this module stream. + SoftwareSourceId *string `mandatory:"false" json:"softwareSourceId"` + + // The architecture for which the packages in this module stream were built. + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` + + // A description of the contents of the module stream. + Description *string `mandatory:"false" json:"description"` + + // A list of profiles that are part of the stream. Each element in + // the list is the name of a profile. The name is suitable to use as + // an argument to other OS Management Hub APIs that interact directly with + // module stream profiles. However, it is not URL encoded. + Profiles []string `mandatory:"false" json:"profiles"` + + // A list of packages that are contained by the stream. Each element + // in the list is the name of a package. The name is suitable to use + // as an argument to other OS Management Hub APIs that interact directly + // with packages. + Packages []string `mandatory:"false" json:"packages"` + + // Indicates whether this module stream is the latest. + IsLatest *bool `mandatory:"false" json:"isLatest"` +} + +func (m ModuleStream) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStream) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_collection.go b/osmanagementhub/module_stream_collection.go new file mode 100644 index 0000000000..25b51fa0c7 --- /dev/null +++ b/osmanagementhub/module_stream_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamCollection Results of a ModuleStream search. Contains both ModuleStreamSummary items and other information, such as metadata. +type ModuleStreamCollection struct { + + // List of ModuleStream. + Items []ModuleStreamSummary `mandatory:"true" json:"items"` +} + +func (m ModuleStreamCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_details.go b/osmanagementhub/module_stream_details.go new file mode 100644 index 0000000000..db19029f29 --- /dev/null +++ b/osmanagementhub/module_stream_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamDetails Updatable information for a module stream. +type ModuleStreamDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"true" json:"streamName"` +} + +func (m ModuleStreamDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_details_body.go b/osmanagementhub/module_stream_details_body.go new file mode 100644 index 0000000000..3aad063452 --- /dev/null +++ b/osmanagementhub/module_stream_details_body.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamDetailsBody The details of the module stream to be enabled/disabled on a managed instance. +type ModuleStreamDetailsBody struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m ModuleStreamDetailsBody) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamDetailsBody) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_profile.go b/osmanagementhub/module_stream_profile.go new file mode 100644 index 0000000000..a6dd78f074 --- /dev/null +++ b/osmanagementhub/module_stream_profile.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamProfile A module stream profile provided by a software source. +type ModuleStreamProfile struct { + + // The name of the module that contains the stream profile. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of the stream that contains the profile. + StreamName *string `mandatory:"true" json:"streamName"` + + // The name of the profile. + Name *string `mandatory:"true" json:"name"` + + // A list of packages that constitute the profile. Each element + // in the list is the name of a package. The name is suitable to + // use as an argument to other OS Management Hub APIs that interact + // directly with packages. + Packages []string `mandatory:"true" json:"packages"` + + // Indicates if this profile is the default for its module stream. + IsDefault *bool `mandatory:"false" json:"isDefault"` + + // A description of the contents of the module stream profile. + Description *string `mandatory:"false" json:"description"` +} + +func (m ModuleStreamProfile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamProfile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_profile_collection.go b/osmanagementhub/module_stream_profile_collection.go new file mode 100644 index 0000000000..cee3b47c41 --- /dev/null +++ b/osmanagementhub/module_stream_profile_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamProfileCollection Results of a ModuleStreamProfile search. Contains both ModuleStreamProfileSummary items and other information, such as metadata. +type ModuleStreamProfileCollection struct { + + // List of ModuleStreamProfile. + Items []ModuleStreamProfileSummary `mandatory:"true" json:"items"` +} + +func (m ModuleStreamProfileCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamProfileCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_profile_details.go b/osmanagementhub/module_stream_profile_details.go new file mode 100644 index 0000000000..3c193e4f71 --- /dev/null +++ b/osmanagementhub/module_stream_profile_details.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamProfileDetails Updatable information for a module stream profile. +type ModuleStreamProfileDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"true" json:"streamName"` + + // The name of a profile of the specified module stream. + ProfileName *string `mandatory:"true" json:"profileName"` +} + +func (m ModuleStreamProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamProfileDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_profile_details_body.go b/osmanagementhub/module_stream_profile_details_body.go new file mode 100644 index 0000000000..fafda47dba --- /dev/null +++ b/osmanagementhub/module_stream_profile_details_body.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamProfileDetailsBody The details of the module stream profile to be installed/removed on a managed instance. +type ModuleStreamProfileDetailsBody struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + // The name of a profile of the specified module stream. + ProfileName *string `mandatory:"false" json:"profileName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m ModuleStreamProfileDetailsBody) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamProfileDetailsBody) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_profile_filter.go b/osmanagementhub/module_stream_profile_filter.go new file mode 100644 index 0000000000..353dd20401 --- /dev/null +++ b/osmanagementhub/module_stream_profile_filter.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamProfileFilter Used to select module stream/profiles from VendorSoftwareSources to create/update CustomSoftwareSources. +type ModuleStreamProfileFilter struct { + + // Module name. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The type of the filter, which can be of two types - INCLUDE or EXCLUDE. + FilterType FilterTypeEnum `mandatory:"true" json:"filterType"` + + // Profile name. + ProfileName *string `mandatory:"false" json:"profileName"` + + // Stream name. + StreamName *string `mandatory:"false" json:"streamName"` +} + +func (m ModuleStreamProfileFilter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamProfileFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingFilterTypeEnum(string(m.FilterType)); !ok && m.FilterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FilterType: %s. Supported values are: %s.", m.FilterType, strings.Join(GetFilterTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_profile_status.go b/osmanagementhub/module_stream_profile_status.go new file mode 100644 index 0000000000..03694132c8 --- /dev/null +++ b/osmanagementhub/module_stream_profile_status.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ModuleStreamProfileStatusEnum Enum with underlying type: string +type ModuleStreamProfileStatusEnum string + +// Set of constants representing the allowable values for ModuleStreamProfileStatusEnum +const ( + ModuleStreamProfileStatusInstalled ModuleStreamProfileStatusEnum = "INSTALLED" + ModuleStreamProfileStatusAvailable ModuleStreamProfileStatusEnum = "AVAILABLE" +) + +var mappingModuleStreamProfileStatusEnum = map[string]ModuleStreamProfileStatusEnum{ + "INSTALLED": ModuleStreamProfileStatusInstalled, + "AVAILABLE": ModuleStreamProfileStatusAvailable, +} + +var mappingModuleStreamProfileStatusEnumLowerCase = map[string]ModuleStreamProfileStatusEnum{ + "installed": ModuleStreamProfileStatusInstalled, + "available": ModuleStreamProfileStatusAvailable, +} + +// GetModuleStreamProfileStatusEnumValues Enumerates the set of values for ModuleStreamProfileStatusEnum +func GetModuleStreamProfileStatusEnumValues() []ModuleStreamProfileStatusEnum { + values := make([]ModuleStreamProfileStatusEnum, 0) + for _, v := range mappingModuleStreamProfileStatusEnum { + values = append(values, v) + } + return values +} + +// GetModuleStreamProfileStatusEnumStringValues Enumerates the set of values in String for ModuleStreamProfileStatusEnum +func GetModuleStreamProfileStatusEnumStringValues() []string { + return []string{ + "INSTALLED", + "AVAILABLE", + } +} + +// GetMappingModuleStreamProfileStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModuleStreamProfileStatusEnum(val string) (ModuleStreamProfileStatusEnum, bool) { + enum, ok := mappingModuleStreamProfileStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/module_stream_profile_summary.go b/osmanagementhub/module_stream_profile_summary.go new file mode 100644 index 0000000000..79b3d35642 --- /dev/null +++ b/osmanagementhub/module_stream_profile_summary.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamProfileSummary Summary information pertaining to a module stream profile provided by a software source. +type ModuleStreamProfileSummary struct { + + // The name of the module that contains the stream profile. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of the stream that contains the profile. + StreamName *string `mandatory:"true" json:"streamName"` + + // The name of the profile. + Name *string `mandatory:"true" json:"name"` + + // Indicates if this profile is the default for its module stream. + IsDefault *bool `mandatory:"false" json:"isDefault"` +} + +func (m ModuleStreamProfileSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamProfileSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_stream_status.go b/osmanagementhub/module_stream_status.go new file mode 100644 index 0000000000..fa79a39857 --- /dev/null +++ b/osmanagementhub/module_stream_status.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ModuleStreamStatusEnum Enum with underlying type: string +type ModuleStreamStatusEnum string + +// Set of constants representing the allowable values for ModuleStreamStatusEnum +const ( + ModuleStreamStatusEnabled ModuleStreamStatusEnum = "ENABLED" + ModuleStreamStatusDisabled ModuleStreamStatusEnum = "DISABLED" + ModuleStreamStatusActive ModuleStreamStatusEnum = "ACTIVE" +) + +var mappingModuleStreamStatusEnum = map[string]ModuleStreamStatusEnum{ + "ENABLED": ModuleStreamStatusEnabled, + "DISABLED": ModuleStreamStatusDisabled, + "ACTIVE": ModuleStreamStatusActive, +} + +var mappingModuleStreamStatusEnumLowerCase = map[string]ModuleStreamStatusEnum{ + "enabled": ModuleStreamStatusEnabled, + "disabled": ModuleStreamStatusDisabled, + "active": ModuleStreamStatusActive, +} + +// GetModuleStreamStatusEnumValues Enumerates the set of values for ModuleStreamStatusEnum +func GetModuleStreamStatusEnumValues() []ModuleStreamStatusEnum { + values := make([]ModuleStreamStatusEnum, 0) + for _, v := range mappingModuleStreamStatusEnum { + values = append(values, v) + } + return values +} + +// GetModuleStreamStatusEnumStringValues Enumerates the set of values in String for ModuleStreamStatusEnum +func GetModuleStreamStatusEnumStringValues() []string { + return []string{ + "ENABLED", + "DISABLED", + "ACTIVE", + } +} + +// GetMappingModuleStreamStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModuleStreamStatusEnum(val string) (ModuleStreamStatusEnum, bool) { + enum, ok := mappingModuleStreamStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/module_stream_summary.go b/osmanagementhub/module_stream_summary.go new file mode 100644 index 0000000000..40d765c7c9 --- /dev/null +++ b/osmanagementhub/module_stream_summary.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleStreamSummary Summary information pertaining to a module stream provided by a software source. +type ModuleStreamSummary struct { + + // The name of the stream. + Name *string `mandatory:"true" json:"name"` + + // The name of the module that contains the stream. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // List of profiles in the stream. + Profiles []string `mandatory:"true" json:"profiles"` + + // Indicates whether this module stream is the latest. + IsLatest *bool `mandatory:"false" json:"isLatest"` + + // The software source id for the the module stream. + SoftwareSourceId *string `mandatory:"false" json:"softwareSourceId"` +} + +func (m ModuleStreamSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleStreamSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/module_summary.go b/osmanagementhub/module_summary.go new file mode 100644 index 0000000000..ce4dd1a689 --- /dev/null +++ b/osmanagementhub/module_summary.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModuleSummary Summary information pertaining to a module provided by a software source. +type ModuleSummary struct { + + // The name of the module. + Name *string `mandatory:"true" json:"name"` + + // The software source that provides the module. + SoftwareSourceId *string `mandatory:"true" json:"softwareSourceId"` + + // List of stream names. + Streams []string `mandatory:"false" json:"streams"` +} + +func (m ModuleSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModuleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/operation_status.go b/osmanagementhub/operation_status.go new file mode 100644 index 0000000000..6e3563cb03 --- /dev/null +++ b/osmanagementhub/operation_status.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/operation_types.go b/osmanagementhub/operation_types.go new file mode 100644 index 0000000000..bedd3d0851 --- /dev/null +++ b/osmanagementhub/operation_types.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// OperationTypesEnum Enum with underlying type: string +type OperationTypesEnum string + +// Set of constants representing the allowable values for OperationTypesEnum +const ( + OperationTypesInstallPackages OperationTypesEnum = "INSTALL_PACKAGES" + OperationTypesUpdatePackages OperationTypesEnum = "UPDATE_PACKAGES" + OperationTypesRemovePackages OperationTypesEnum = "REMOVE_PACKAGES" + OperationTypesUpdateAll OperationTypesEnum = "UPDATE_ALL" + OperationTypesUpdateSecurity OperationTypesEnum = "UPDATE_SECURITY" + OperationTypesUpdateBugfix OperationTypesEnum = "UPDATE_BUGFIX" + OperationTypesUpdateEnhancement OperationTypesEnum = "UPDATE_ENHANCEMENT" + OperationTypesUpdateOther OperationTypesEnum = "UPDATE_OTHER" + OperationTypesUpdateKspliceUserspace OperationTypesEnum = "UPDATE_KSPLICE_USERSPACE" + OperationTypesUpdateKspliceKernel OperationTypesEnum = "UPDATE_KSPLICE_KERNEL" + OperationTypesManageModuleStreams OperationTypesEnum = "MANAGE_MODULE_STREAMS" + OperationTypesSwitchModuleStream OperationTypesEnum = "SWITCH_MODULE_STREAM" + OperationTypesAttachSoftwareSources OperationTypesEnum = "ATTACH_SOFTWARE_SOURCES" + OperationTypesDetachSoftwareSources OperationTypesEnum = "DETACH_SOFTWARE_SOURCES" + OperationTypesSyncManagementStationMirror OperationTypesEnum = "SYNC_MANAGEMENT_STATION_MIRROR" + OperationTypesPromoteLifecycle OperationTypesEnum = "PROMOTE_LIFECYCLE" +) + +var mappingOperationTypesEnum = map[string]OperationTypesEnum{ + "INSTALL_PACKAGES": OperationTypesInstallPackages, + "UPDATE_PACKAGES": OperationTypesUpdatePackages, + "REMOVE_PACKAGES": OperationTypesRemovePackages, + "UPDATE_ALL": OperationTypesUpdateAll, + "UPDATE_SECURITY": OperationTypesUpdateSecurity, + "UPDATE_BUGFIX": OperationTypesUpdateBugfix, + "UPDATE_ENHANCEMENT": OperationTypesUpdateEnhancement, + "UPDATE_OTHER": OperationTypesUpdateOther, + "UPDATE_KSPLICE_USERSPACE": OperationTypesUpdateKspliceUserspace, + "UPDATE_KSPLICE_KERNEL": OperationTypesUpdateKspliceKernel, + "MANAGE_MODULE_STREAMS": OperationTypesManageModuleStreams, + "SWITCH_MODULE_STREAM": OperationTypesSwitchModuleStream, + "ATTACH_SOFTWARE_SOURCES": OperationTypesAttachSoftwareSources, + "DETACH_SOFTWARE_SOURCES": OperationTypesDetachSoftwareSources, + "SYNC_MANAGEMENT_STATION_MIRROR": OperationTypesSyncManagementStationMirror, + "PROMOTE_LIFECYCLE": OperationTypesPromoteLifecycle, +} + +var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ + "install_packages": OperationTypesInstallPackages, + "update_packages": OperationTypesUpdatePackages, + "remove_packages": OperationTypesRemovePackages, + "update_all": OperationTypesUpdateAll, + "update_security": OperationTypesUpdateSecurity, + "update_bugfix": OperationTypesUpdateBugfix, + "update_enhancement": OperationTypesUpdateEnhancement, + "update_other": OperationTypesUpdateOther, + "update_ksplice_userspace": OperationTypesUpdateKspliceUserspace, + "update_ksplice_kernel": OperationTypesUpdateKspliceKernel, + "manage_module_streams": OperationTypesManageModuleStreams, + "switch_module_stream": OperationTypesSwitchModuleStream, + "attach_software_sources": OperationTypesAttachSoftwareSources, + "detach_software_sources": OperationTypesDetachSoftwareSources, + "sync_management_station_mirror": OperationTypesSyncManagementStationMirror, + "promote_lifecycle": OperationTypesPromoteLifecycle, +} + +// GetOperationTypesEnumValues Enumerates the set of values for OperationTypesEnum +func GetOperationTypesEnumValues() []OperationTypesEnum { + values := make([]OperationTypesEnum, 0) + for _, v := range mappingOperationTypesEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypesEnumStringValues Enumerates the set of values in String for OperationTypesEnum +func GetOperationTypesEnumStringValues() []string { + return []string{ + "INSTALL_PACKAGES", + "UPDATE_PACKAGES", + "REMOVE_PACKAGES", + "UPDATE_ALL", + "UPDATE_SECURITY", + "UPDATE_BUGFIX", + "UPDATE_ENHANCEMENT", + "UPDATE_OTHER", + "UPDATE_KSPLICE_USERSPACE", + "UPDATE_KSPLICE_KERNEL", + "MANAGE_MODULE_STREAMS", + "SWITCH_MODULE_STREAM", + "ATTACH_SOFTWARE_SOURCES", + "DETACH_SOFTWARE_SOURCES", + "SYNC_MANAGEMENT_STATION_MIRROR", + "PROMOTE_LIFECYCLE", + } +} + +// GetMappingOperationTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypesEnum(val string) (OperationTypesEnum, bool) { + enum, ok := mappingOperationTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/os_family.go b/osmanagementhub/os_family.go new file mode 100644 index 0000000000..6d1665cd09 --- /dev/null +++ b/osmanagementhub/os_family.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// OsFamilyEnum Enum with underlying type: string +type OsFamilyEnum string + +// Set of constants representing the allowable values for OsFamilyEnum +const ( + OsFamilyOracleLinux9 OsFamilyEnum = "ORACLE_LINUX_9" + OsFamilyOracleLinux8 OsFamilyEnum = "ORACLE_LINUX_8" + OsFamilyOracleLinux7 OsFamilyEnum = "ORACLE_LINUX_7" +) + +var mappingOsFamilyEnum = map[string]OsFamilyEnum{ + "ORACLE_LINUX_9": OsFamilyOracleLinux9, + "ORACLE_LINUX_8": OsFamilyOracleLinux8, + "ORACLE_LINUX_7": OsFamilyOracleLinux7, +} + +var mappingOsFamilyEnumLowerCase = map[string]OsFamilyEnum{ + "oracle_linux_9": OsFamilyOracleLinux9, + "oracle_linux_8": OsFamilyOracleLinux8, + "oracle_linux_7": OsFamilyOracleLinux7, +} + +// GetOsFamilyEnumValues Enumerates the set of values for OsFamilyEnum +func GetOsFamilyEnumValues() []OsFamilyEnum { + values := make([]OsFamilyEnum, 0) + for _, v := range mappingOsFamilyEnum { + values = append(values, v) + } + return values +} + +// GetOsFamilyEnumStringValues Enumerates the set of values in String for OsFamilyEnum +func GetOsFamilyEnumStringValues() []string { + return []string{ + "ORACLE_LINUX_9", + "ORACLE_LINUX_8", + "ORACLE_LINUX_7", + } +} + +// GetMappingOsFamilyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOsFamilyEnum(val string) (OsFamilyEnum, bool) { + enum, ok := mappingOsFamilyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/osmanagementhub_lifecycleenvironment_client.go b/osmanagementhub/osmanagementhub_lifecycleenvironment_client.go new file mode 100644 index 0000000000..87ffaf0ab3 --- /dev/null +++ b/osmanagementhub/osmanagementhub_lifecycleenvironment_client.go @@ -0,0 +1,753 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// LifecycleEnvironmentClient a client for LifecycleEnvironment +type LifecycleEnvironmentClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewLifecycleEnvironmentClientWithConfigurationProvider Creates a new default LifecycleEnvironment client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewLifecycleEnvironmentClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client LifecycleEnvironmentClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newLifecycleEnvironmentClientFromBaseClient(baseClient, provider) +} + +// NewLifecycleEnvironmentClientWithOboToken Creates a new default LifecycleEnvironment 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 NewLifecycleEnvironmentClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client LifecycleEnvironmentClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newLifecycleEnvironmentClientFromBaseClient(baseClient, configProvider) +} + +func newLifecycleEnvironmentClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client LifecycleEnvironmentClient, err error) { + // LifecycleEnvironment service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("LifecycleEnvironment")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = LifecycleEnvironmentClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *LifecycleEnvironmentClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *LifecycleEnvironmentClient) 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 *LifecycleEnvironmentClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// AttachManagedInstancesToLifecycleStage Attach(add) managed instances to a lifecycle stage. +// Once added operations can be applied to all managed instances in the lifecycle stage. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachManagedInstancesToLifecycleStage.go.html to see an example of how to use AttachManagedInstancesToLifecycleStage API. +// A default retry strategy applies to this operation AttachManagedInstancesToLifecycleStage() +func (client LifecycleEnvironmentClient) AttachManagedInstancesToLifecycleStage(ctx context.Context, request AttachManagedInstancesToLifecycleStageRequest) (response AttachManagedInstancesToLifecycleStageResponse, 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.attachManagedInstancesToLifecycleStage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AttachManagedInstancesToLifecycleStageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AttachManagedInstancesToLifecycleStageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AttachManagedInstancesToLifecycleStageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachManagedInstancesToLifecycleStageResponse") + } + return +} + +// attachManagedInstancesToLifecycleStage implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) attachManagedInstancesToLifecycleStage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/lifecycleStages/{lifecycleStageId}/actions/attachManagedInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AttachManagedInstancesToLifecycleStageResponse + 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, "LifecycleEnvironment", "AttachManagedInstancesToLifecycleStage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateLifecycleEnvironment Creates a new lifecycle environment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateLifecycleEnvironment.go.html to see an example of how to use CreateLifecycleEnvironment API. +// A default retry strategy applies to this operation CreateLifecycleEnvironment() +func (client LifecycleEnvironmentClient) CreateLifecycleEnvironment(ctx context.Context, request CreateLifecycleEnvironmentRequest) (response CreateLifecycleEnvironmentResponse, 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.createLifecycleEnvironment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateLifecycleEnvironmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateLifecycleEnvironmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateLifecycleEnvironmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateLifecycleEnvironmentResponse") + } + return +} + +// createLifecycleEnvironment implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) createLifecycleEnvironment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/lifecycleEnvironments", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateLifecycleEnvironmentResponse + 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, "LifecycleEnvironment", "CreateLifecycleEnvironment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteLifecycleEnvironment Deletes a lifecycle environment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteLifecycleEnvironment.go.html to see an example of how to use DeleteLifecycleEnvironment API. +// A default retry strategy applies to this operation DeleteLifecycleEnvironment() +func (client LifecycleEnvironmentClient) DeleteLifecycleEnvironment(ctx context.Context, request DeleteLifecycleEnvironmentRequest) (response DeleteLifecycleEnvironmentResponse, 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.deleteLifecycleEnvironment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteLifecycleEnvironmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteLifecycleEnvironmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteLifecycleEnvironmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteLifecycleEnvironmentResponse") + } + return +} + +// deleteLifecycleEnvironment implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) deleteLifecycleEnvironment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/lifecycleEnvironments/{lifecycleEnvironmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteLifecycleEnvironmentResponse + 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, "LifecycleEnvironment", "DeleteLifecycleEnvironment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DetachManagedInstancesFromLifecycleStage Detach(remove) managed instance from a lifecycle stage. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachManagedInstancesFromLifecycleStage.go.html to see an example of how to use DetachManagedInstancesFromLifecycleStage API. +// A default retry strategy applies to this operation DetachManagedInstancesFromLifecycleStage() +func (client LifecycleEnvironmentClient) DetachManagedInstancesFromLifecycleStage(ctx context.Context, request DetachManagedInstancesFromLifecycleStageRequest) (response DetachManagedInstancesFromLifecycleStageResponse, 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.detachManagedInstancesFromLifecycleStage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DetachManagedInstancesFromLifecycleStageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DetachManagedInstancesFromLifecycleStageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DetachManagedInstancesFromLifecycleStageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachManagedInstancesFromLifecycleStageResponse") + } + return +} + +// detachManagedInstancesFromLifecycleStage implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) detachManagedInstancesFromLifecycleStage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/lifecycleStages/{lifecycleStageId}/actions/detachManagedInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DetachManagedInstancesFromLifecycleStageResponse + 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, "LifecycleEnvironment", "DetachManagedInstancesFromLifecycleStage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetLifecycleEnvironment Gets information about the specified lifecycle environment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetLifecycleEnvironment.go.html to see an example of how to use GetLifecycleEnvironment API. +// A default retry strategy applies to this operation GetLifecycleEnvironment() +func (client LifecycleEnvironmentClient) GetLifecycleEnvironment(ctx context.Context, request GetLifecycleEnvironmentRequest) (response GetLifecycleEnvironmentResponse, 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.getLifecycleEnvironment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetLifecycleEnvironmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetLifecycleEnvironmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetLifecycleEnvironmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetLifecycleEnvironmentResponse") + } + return +} + +// getLifecycleEnvironment implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) getLifecycleEnvironment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/lifecycleEnvironments/{lifecycleEnvironmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetLifecycleEnvironmentResponse + 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, "LifecycleEnvironment", "GetLifecycleEnvironment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetLifecycleStage Gets information about the specified lifecycle stage. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetLifecycleStage.go.html to see an example of how to use GetLifecycleStage API. +// A default retry strategy applies to this operation GetLifecycleStage() +func (client LifecycleEnvironmentClient) GetLifecycleStage(ctx context.Context, request GetLifecycleStageRequest) (response GetLifecycleStageResponse, 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.getLifecycleStage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetLifecycleStageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetLifecycleStageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetLifecycleStageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetLifecycleStageResponse") + } + return +} + +// getLifecycleStage implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) getLifecycleStage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/lifecycleStages/{lifecycleStageId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetLifecycleStageResponse + 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, "LifecycleEnvironment", "GetLifecycleStage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListLifecycleEnvironments Lists lifecycle environments that match the specified compartment or lifecycle environment OCID. Filter the list +// against a variety of criteria including but not limited to its name, status, architecture, and OS family. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListLifecycleEnvironments.go.html to see an example of how to use ListLifecycleEnvironments API. +// A default retry strategy applies to this operation ListLifecycleEnvironments() +func (client LifecycleEnvironmentClient) ListLifecycleEnvironments(ctx context.Context, request ListLifecycleEnvironmentsRequest) (response ListLifecycleEnvironmentsResponse, 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.listLifecycleEnvironments, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListLifecycleEnvironmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListLifecycleEnvironmentsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListLifecycleEnvironmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListLifecycleEnvironmentsResponse") + } + return +} + +// listLifecycleEnvironments implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) listLifecycleEnvironments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/lifecycleEnvironments", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListLifecycleEnvironmentsResponse + 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, "LifecycleEnvironment", "ListLifecycleEnvironments", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListLifecycleStageInstalledPackages Lists installed packages on managed instances in a specified lifecycle stage. Filter the list against a variety +// of criteria including but not limited to the package name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListLifecycleStageInstalledPackages.go.html to see an example of how to use ListLifecycleStageInstalledPackages API. +// A default retry strategy applies to this operation ListLifecycleStageInstalledPackages() +func (client LifecycleEnvironmentClient) ListLifecycleStageInstalledPackages(ctx context.Context, request ListLifecycleStageInstalledPackagesRequest) (response ListLifecycleStageInstalledPackagesResponse, 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.listLifecycleStageInstalledPackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListLifecycleStageInstalledPackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListLifecycleStageInstalledPackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListLifecycleStageInstalledPackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListLifecycleStageInstalledPackagesResponse") + } + return +} + +// listLifecycleStageInstalledPackages implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) listLifecycleStageInstalledPackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/lifecycleStages/{lifecycleStageId}/installedPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListLifecycleStageInstalledPackagesResponse + 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, "LifecycleEnvironment", "ListLifecycleStageInstalledPackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListLifecycleStages Lists lifecycle stages that match the specified compartment or lifecycle stage OCID. Filter the list against +// a variety of criteria including but not limited to its name, status, architecture, and OS family. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListLifecycleStages.go.html to see an example of how to use ListLifecycleStages API. +// A default retry strategy applies to this operation ListLifecycleStages() +func (client LifecycleEnvironmentClient) ListLifecycleStages(ctx context.Context, request ListLifecycleStagesRequest) (response ListLifecycleStagesResponse, 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.listLifecycleStages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListLifecycleStagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListLifecycleStagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListLifecycleStagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListLifecycleStagesResponse") + } + return +} + +// listLifecycleStages implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) listLifecycleStages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/lifecycleStages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListLifecycleStagesResponse + 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, "LifecycleEnvironment", "ListLifecycleStages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PromoteSoftwareSourceToLifecycleStage Updates the versioned custom software source content +// for specified lifecycle stage. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/PromoteSoftwareSourceToLifecycleStage.go.html to see an example of how to use PromoteSoftwareSourceToLifecycleStage API. +// A default retry strategy applies to this operation PromoteSoftwareSourceToLifecycleStage() +func (client LifecycleEnvironmentClient) PromoteSoftwareSourceToLifecycleStage(ctx context.Context, request PromoteSoftwareSourceToLifecycleStageRequest) (response PromoteSoftwareSourceToLifecycleStageResponse, 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.promoteSoftwareSourceToLifecycleStage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PromoteSoftwareSourceToLifecycleStageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PromoteSoftwareSourceToLifecycleStageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PromoteSoftwareSourceToLifecycleStageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PromoteSoftwareSourceToLifecycleStageResponse") + } + return +} + +// promoteSoftwareSourceToLifecycleStage implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) promoteSoftwareSourceToLifecycleStage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/lifecycleStages/{lifecycleStageId}/actions/promoteSoftwareSource", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PromoteSoftwareSourceToLifecycleStageResponse + 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, "LifecycleEnvironment", "PromoteSoftwareSourceToLifecycleStage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateLifecycleEnvironment Updates the specified lifecycle environment's name, description, stages, or tags. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateLifecycleEnvironment.go.html to see an example of how to use UpdateLifecycleEnvironment API. +// A default retry strategy applies to this operation UpdateLifecycleEnvironment() +func (client LifecycleEnvironmentClient) UpdateLifecycleEnvironment(ctx context.Context, request UpdateLifecycleEnvironmentRequest) (response UpdateLifecycleEnvironmentResponse, 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.updateLifecycleEnvironment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateLifecycleEnvironmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateLifecycleEnvironmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateLifecycleEnvironmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateLifecycleEnvironmentResponse") + } + return +} + +// updateLifecycleEnvironment implements the OCIOperation interface (enables retrying operations) +func (client LifecycleEnvironmentClient) updateLifecycleEnvironment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/lifecycleEnvironments/{lifecycleEnvironmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateLifecycleEnvironmentResponse + 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, "LifecycleEnvironment", "UpdateLifecycleEnvironment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_managedinstance_client.go b/osmanagementhub/osmanagementhub_managedinstance_client.go new file mode 100644 index 0000000000..9b6dcde86d --- /dev/null +++ b/osmanagementhub/osmanagementhub_managedinstance_client.go @@ -0,0 +1,1507 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ManagedInstanceClient a client for ManagedInstance +type ManagedInstanceClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewManagedInstanceClientWithConfigurationProvider Creates a new default ManagedInstance client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewManagedInstanceClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ManagedInstanceClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newManagedInstanceClientFromBaseClient(baseClient, provider) +} + +// NewManagedInstanceClientWithOboToken Creates a new default ManagedInstance 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 NewManagedInstanceClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ManagedInstanceClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newManagedInstanceClientFromBaseClient(baseClient, configProvider) +} + +func newManagedInstanceClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ManagedInstanceClient, err error) { + // ManagedInstance service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ManagedInstance")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ManagedInstanceClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ManagedInstanceClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ManagedInstanceClient) 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 *ManagedInstanceClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// AttachSoftwareSourcesToManagedInstance Adds software sources to a managed instance. After the software source has been added, +// then packages from that software source can be installed on the managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachSoftwareSourcesToManagedInstance.go.html to see an example of how to use AttachSoftwareSourcesToManagedInstance API. +// A default retry strategy applies to this operation AttachSoftwareSourcesToManagedInstance() +func (client ManagedInstanceClient) AttachSoftwareSourcesToManagedInstance(ctx context.Context, request AttachSoftwareSourcesToManagedInstanceRequest) (response AttachSoftwareSourcesToManagedInstanceResponse, 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.attachSoftwareSourcesToManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AttachSoftwareSourcesToManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AttachSoftwareSourcesToManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AttachSoftwareSourcesToManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachSoftwareSourcesToManagedInstanceResponse") + } + return +} + +// attachSoftwareSourcesToManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) attachSoftwareSourcesToManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/attachSoftwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AttachSoftwareSourcesToManagedInstanceResponse + 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, "ManagedInstance", "AttachSoftwareSourcesToManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DetachSoftwareSourcesFromManagedInstance Removes software sources from a managed instance. +// Packages will no longer be able to be installed from these software sources. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachSoftwareSourcesFromManagedInstance.go.html to see an example of how to use DetachSoftwareSourcesFromManagedInstance API. +// A default retry strategy applies to this operation DetachSoftwareSourcesFromManagedInstance() +func (client ManagedInstanceClient) DetachSoftwareSourcesFromManagedInstance(ctx context.Context, request DetachSoftwareSourcesFromManagedInstanceRequest) (response DetachSoftwareSourcesFromManagedInstanceResponse, 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.detachSoftwareSourcesFromManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DetachSoftwareSourcesFromManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DetachSoftwareSourcesFromManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DetachSoftwareSourcesFromManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachSoftwareSourcesFromManagedInstanceResponse") + } + return +} + +// detachSoftwareSourcesFromManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) detachSoftwareSourcesFromManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/detachSoftwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DetachSoftwareSourcesFromManagedInstanceResponse + 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, "ManagedInstance", "DetachSoftwareSourcesFromManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableModuleStreamOnManagedInstance Disables a module stream on a managed instance. After the stream is +// disabled, it is no longer possible to install the profiles that are +// contained by the stream. All installed profiles must be removed prior +// to disabling a module stream. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DisableModuleStreamOnManagedInstance.go.html to see an example of how to use DisableModuleStreamOnManagedInstance API. +// A default retry strategy applies to this operation DisableModuleStreamOnManagedInstance() +func (client ManagedInstanceClient) DisableModuleStreamOnManagedInstance(ctx context.Context, request DisableModuleStreamOnManagedInstanceRequest) (response DisableModuleStreamOnManagedInstanceResponse, 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.disableModuleStreamOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableModuleStreamOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableModuleStreamOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableModuleStreamOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableModuleStreamOnManagedInstanceResponse") + } + return +} + +// disableModuleStreamOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) disableModuleStreamOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/disableModuleStreams", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableModuleStreamOnManagedInstanceResponse + 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, "ManagedInstance", "DisableModuleStreamOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// EnableModuleStreamOnManagedInstance Enables a module stream on a managed instance. After the stream is +// enabled, it is possible to install the profiles that are contained +// by the stream. Enabling a stream that is already enabled will +// succeed. Attempting to enable a different stream for a module that +// already has a stream enabled results in an error. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/EnableModuleStreamOnManagedInstance.go.html to see an example of how to use EnableModuleStreamOnManagedInstance API. +// A default retry strategy applies to this operation EnableModuleStreamOnManagedInstance() +func (client ManagedInstanceClient) EnableModuleStreamOnManagedInstance(ctx context.Context, request EnableModuleStreamOnManagedInstanceRequest) (response EnableModuleStreamOnManagedInstanceResponse, 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.enableModuleStreamOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableModuleStreamOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableModuleStreamOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableModuleStreamOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableModuleStreamOnManagedInstanceResponse") + } + return +} + +// enableModuleStreamOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) enableModuleStreamOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/enableModuleStreams", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableModuleStreamOnManagedInstanceResponse + 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, "ManagedInstance", "EnableModuleStreamOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetManagedInstance Gets information about the specified managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstance.go.html to see an example of how to use GetManagedInstance API. +// A default retry strategy applies to this operation GetManagedInstance() +func (client ManagedInstanceClient) GetManagedInstance(ctx context.Context, request GetManagedInstanceRequest) (response GetManagedInstanceResponse, 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.getManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetManagedInstanceResponse") + } + return +} + +// getManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) getManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetManagedInstanceResponse + 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, "ManagedInstance", "GetManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// InstallModuleStreamProfileOnManagedInstance Installs a profile for an module stream. The stream must be +// enabled before a profile can be installed. If a module stream +// defines multiple profiles, each one can be installed independently. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallModuleStreamProfileOnManagedInstance.go.html to see an example of how to use InstallModuleStreamProfileOnManagedInstance API. +// A default retry strategy applies to this operation InstallModuleStreamProfileOnManagedInstance() +func (client ManagedInstanceClient) InstallModuleStreamProfileOnManagedInstance(ctx context.Context, request InstallModuleStreamProfileOnManagedInstanceRequest) (response InstallModuleStreamProfileOnManagedInstanceResponse, 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.installModuleStreamProfileOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = InstallModuleStreamProfileOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = InstallModuleStreamProfileOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(InstallModuleStreamProfileOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into InstallModuleStreamProfileOnManagedInstanceResponse") + } + return +} + +// installModuleStreamProfileOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) installModuleStreamProfileOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/installStreamProfiles", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response InstallModuleStreamProfileOnManagedInstanceResponse + 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, "ManagedInstance", "InstallModuleStreamProfileOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// InstallPackagesOnManagedInstance Installs packages on a managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallPackagesOnManagedInstance.go.html to see an example of how to use InstallPackagesOnManagedInstance API. +// A default retry strategy applies to this operation InstallPackagesOnManagedInstance() +func (client ManagedInstanceClient) InstallPackagesOnManagedInstance(ctx context.Context, request InstallPackagesOnManagedInstanceRequest) (response InstallPackagesOnManagedInstanceResponse, 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.installPackagesOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = InstallPackagesOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = InstallPackagesOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(InstallPackagesOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into InstallPackagesOnManagedInstanceResponse") + } + return +} + +// installPackagesOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) installPackagesOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/installPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response InstallPackagesOnManagedInstanceResponse + 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, "ManagedInstance", "InstallPackagesOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceAvailablePackages Returns a list of available packages for a managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceAvailablePackages.go.html to see an example of how to use ListManagedInstanceAvailablePackages API. +// A default retry strategy applies to this operation ListManagedInstanceAvailablePackages() +func (client ManagedInstanceClient) ListManagedInstanceAvailablePackages(ctx context.Context, request ListManagedInstanceAvailablePackagesRequest) (response ListManagedInstanceAvailablePackagesResponse, 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.listManagedInstanceAvailablePackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceAvailablePackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceAvailablePackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceAvailablePackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceAvailablePackagesResponse") + } + return +} + +// listManagedInstanceAvailablePackages implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) listManagedInstanceAvailablePackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}/availablePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceAvailablePackagesResponse + 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, "ManagedInstance", "ListManagedInstanceAvailablePackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceAvailableSoftwareSources Returns a list of available software sources for a managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceAvailableSoftwareSources.go.html to see an example of how to use ListManagedInstanceAvailableSoftwareSources API. +// A default retry strategy applies to this operation ListManagedInstanceAvailableSoftwareSources() +func (client ManagedInstanceClient) ListManagedInstanceAvailableSoftwareSources(ctx context.Context, request ListManagedInstanceAvailableSoftwareSourcesRequest) (response ListManagedInstanceAvailableSoftwareSourcesResponse, 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.listManagedInstanceAvailableSoftwareSources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceAvailableSoftwareSourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceAvailableSoftwareSourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceAvailableSoftwareSourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceAvailableSoftwareSourcesResponse") + } + return +} + +// listManagedInstanceAvailableSoftwareSources implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) listManagedInstanceAvailableSoftwareSources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}/availableSoftwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceAvailableSoftwareSourcesResponse + 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, "ManagedInstance", "ListManagedInstanceAvailableSoftwareSources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceErrata Returns a list of applicable errata on the managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceErrata.go.html to see an example of how to use ListManagedInstanceErrata API. +// A default retry strategy applies to this operation ListManagedInstanceErrata() +func (client ManagedInstanceClient) ListManagedInstanceErrata(ctx context.Context, request ListManagedInstanceErrataRequest) (response ListManagedInstanceErrataResponse, 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.listManagedInstanceErrata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceErrataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceErrataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceErrataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceErrataResponse") + } + return +} + +// listManagedInstanceErrata implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) listManagedInstanceErrata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}/errata", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceErrataResponse + 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, "ManagedInstance", "ListManagedInstanceErrata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceInstalledPackages Lists the packages that are installed on the managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceInstalledPackages.go.html to see an example of how to use ListManagedInstanceInstalledPackages API. +// A default retry strategy applies to this operation ListManagedInstanceInstalledPackages() +func (client ManagedInstanceClient) ListManagedInstanceInstalledPackages(ctx context.Context, request ListManagedInstanceInstalledPackagesRequest) (response ListManagedInstanceInstalledPackagesResponse, 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.listManagedInstanceInstalledPackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceInstalledPackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceInstalledPackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceInstalledPackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceInstalledPackagesResponse") + } + return +} + +// listManagedInstanceInstalledPackages implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) listManagedInstanceInstalledPackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}/installedPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceInstalledPackagesResponse + 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, "ManagedInstance", "ListManagedInstanceInstalledPackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceModules Retrieve a list of modules, along with streams of the modules, +// from a managed instance. Filters may be applied to select +// a subset of modules based on the filter criteria. +// The 'name' attribute filters against the name of a module. +// It accepts strings of the format "". +// The 'nameContains' attribute filters against the name of a module +// based on partial match. It accepts strings of the format "". +// If this attribute is defined, only matching modules are included +// in the result set. If it is not defined, the request is not subject +// to this filter. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceModules.go.html to see an example of how to use ListManagedInstanceModules API. +// A default retry strategy applies to this operation ListManagedInstanceModules() +func (client ManagedInstanceClient) ListManagedInstanceModules(ctx context.Context, request ListManagedInstanceModulesRequest) (response ListManagedInstanceModulesResponse, 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.listManagedInstanceModules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceModulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceModulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceModulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceModulesResponse") + } + return +} + +// listManagedInstanceModules implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) listManagedInstanceModules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}/modules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceModulesResponse + 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, "ManagedInstance", "ListManagedInstanceModules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceUpdatablePackages Returns a list of updatable packages for a managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceUpdatablePackages.go.html to see an example of how to use ListManagedInstanceUpdatablePackages API. +// A default retry strategy applies to this operation ListManagedInstanceUpdatablePackages() +func (client ManagedInstanceClient) ListManagedInstanceUpdatablePackages(ctx context.Context, request ListManagedInstanceUpdatablePackagesRequest) (response ListManagedInstanceUpdatablePackagesResponse, 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.listManagedInstanceUpdatablePackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceUpdatablePackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceUpdatablePackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceUpdatablePackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceUpdatablePackagesResponse") + } + return +} + +// listManagedInstanceUpdatablePackages implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) listManagedInstanceUpdatablePackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}/updatablePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceUpdatablePackagesResponse + 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, "ManagedInstance", "ListManagedInstanceUpdatablePackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstances Lists managed instances that match the specified compartment or managed instance OCID. Filter the list against a variety of criteria including but not limited to its name, status, architecture, and OS version. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstances.go.html to see an example of how to use ListManagedInstances API. +// A default retry strategy applies to this operation ListManagedInstances() +func (client ManagedInstanceClient) ListManagedInstances(ctx context.Context, request ListManagedInstancesRequest) (response ListManagedInstancesResponse, 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.listManagedInstances, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstancesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstancesResponse") + } + return +} + +// listManagedInstances implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) listManagedInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstancesResponse + 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, "ManagedInstance", "ListManagedInstances", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ManageModuleStreamsOnManagedInstance Perform an operation involving modules, streams, and profiles on a +// managed instance. Each operation may enable or disable an arbitrary +// amount of module streams, and install or remove an arbitrary number +// of module stream profiles. When the operation is complete, the +// state of the modules, streams, and profiles on the managed instance +// will match the state indicated in the operation. +// Each module stream specified in the list of module streams to enable +// will be in the "ENABLED" state upon completion of the operation. +// If there was already a stream of that module enabled, any work +// required to switch from the current stream to the new stream is +// performed implicitly. +// Each module stream specified in the list of module streams to disable +// will be in the "DISABLED" state upon completion of the operation. +// Any profiles that are installed for the module stream will be removed +// as part of the operation. +// Each module stream profile specified in the list of profiles to install +// will be in the "INSTALLED" state upon completion of the operation, +// indicating that any packages that are part of the profile are installed +// on the managed instance. If the module stream containing the profile +// is not enabled, it will be enabled as part of the operation. There +// is an exception when attempting to install a stream of a profile when +// another stream of the same module is enabled. It is an error to attempt +// to install a profile of another module stream, unless enabling the +// new module stream is explicitly included in this operation. +// Each module stream profile specified in the list of profiles to remove +// will be in the "AVAILABLE" state upon completion of the operation. +// The status of packages within the profile after the operation is +// complete is defined by the package manager on the managed instance. +// Operations that contain one or more elements that are not allowed +// are rejected. +// The result of this request is a work request object. The returned +// work request is the parent of a structure of other WorkRequests. Taken +// as a whole, this structure indicates the entire set of work to be +// performed to complete the operation. +// This interface can also be used to perform a dry run of the operation +// rather than committing it to a managed instance. If a dry run is +// requested, the OS Management Hub service will evaluate the operation +// against the current module, stream, and profile state on the managed +// instance. It will calculate the impact of the operation on all +// modules, streams, and profiles on the managed instance, including those +// that are implicitly impacted by the operation. +// The WorkRequest resulting from a dry run behaves differently than +// a WorkRequest resulting from a committable operation. Dry run +// WorkRequests are always singletons and never have children. The +// impact of the operation is returned using the log and error +// facilities of work requests. The impact of operations that are +// allowed by the OS Management Hub service are communicated as one or +// more work request log entries. Operations that are not allowed +// by the OS Management Hub service are communicated as one or more +// work request error entries. Each entry, for either logs or errors, +// contains a structured message containing the results of one +// or more operations. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ManageModuleStreamsOnManagedInstance.go.html to see an example of how to use ManageModuleStreamsOnManagedInstance API. +// A default retry strategy applies to this operation ManageModuleStreamsOnManagedInstance() +func (client ManagedInstanceClient) ManageModuleStreamsOnManagedInstance(ctx context.Context, request ManageModuleStreamsOnManagedInstanceRequest) (response ManageModuleStreamsOnManagedInstanceResponse, 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.manageModuleStreamsOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ManageModuleStreamsOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ManageModuleStreamsOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ManageModuleStreamsOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ManageModuleStreamsOnManagedInstanceResponse") + } + return +} + +// manageModuleStreamsOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) manageModuleStreamsOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/manageModuleStreams", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ManageModuleStreamsOnManagedInstanceResponse + 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, "ManagedInstance", "ManageModuleStreamsOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RefreshSoftwareOnManagedInstance Refresh all installed and updatable software information on a managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RefreshSoftwareOnManagedInstance.go.html to see an example of how to use RefreshSoftwareOnManagedInstance API. +// A default retry strategy applies to this operation RefreshSoftwareOnManagedInstance() +func (client ManagedInstanceClient) RefreshSoftwareOnManagedInstance(ctx context.Context, request RefreshSoftwareOnManagedInstanceRequest) (response RefreshSoftwareOnManagedInstanceResponse, 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.refreshSoftwareOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RefreshSoftwareOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RefreshSoftwareOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RefreshSoftwareOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RefreshSoftwareOnManagedInstanceResponse") + } + return +} + +// refreshSoftwareOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) refreshSoftwareOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/refreshSoftware", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RefreshSoftwareOnManagedInstanceResponse + 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, "ManagedInstance", "RefreshSoftwareOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveModuleStreamProfileFromManagedInstance Removes a profile for a module stream that is installed on a managed instance. +// If a module stream is provided, rather than a fully qualified profile, all +// profiles that have been installed for the module stream will be removed. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemoveModuleStreamProfileFromManagedInstance.go.html to see an example of how to use RemoveModuleStreamProfileFromManagedInstance API. +// A default retry strategy applies to this operation RemoveModuleStreamProfileFromManagedInstance() +func (client ManagedInstanceClient) RemoveModuleStreamProfileFromManagedInstance(ctx context.Context, request RemoveModuleStreamProfileFromManagedInstanceRequest) (response RemoveModuleStreamProfileFromManagedInstanceResponse, 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.removeModuleStreamProfileFromManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveModuleStreamProfileFromManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveModuleStreamProfileFromManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveModuleStreamProfileFromManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveModuleStreamProfileFromManagedInstanceResponse") + } + return +} + +// removeModuleStreamProfileFromManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) removeModuleStreamProfileFromManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/removeStreamProfiles", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveModuleStreamProfileFromManagedInstanceResponse + 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, "ManagedInstance", "RemoveModuleStreamProfileFromManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemovePackagesFromManagedInstance Removes an installed package from a managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemovePackagesFromManagedInstance.go.html to see an example of how to use RemovePackagesFromManagedInstance API. +// A default retry strategy applies to this operation RemovePackagesFromManagedInstance() +func (client ManagedInstanceClient) RemovePackagesFromManagedInstance(ctx context.Context, request RemovePackagesFromManagedInstanceRequest) (response RemovePackagesFromManagedInstanceResponse, 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.removePackagesFromManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemovePackagesFromManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemovePackagesFromManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemovePackagesFromManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemovePackagesFromManagedInstanceResponse") + } + return +} + +// removePackagesFromManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) removePackagesFromManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/removePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemovePackagesFromManagedInstanceResponse + 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, "ManagedInstance", "RemovePackagesFromManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SwitchModuleStreamOnManagedInstance Enables a new stream for a module that already has a stream enabled. +// If any profiles or packages from the original module are installed, +// switching to a new stream will remove the existing packages and +// install their counterparts in the new stream. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SwitchModuleStreamOnManagedInstance.go.html to see an example of how to use SwitchModuleStreamOnManagedInstance API. +// A default retry strategy applies to this operation SwitchModuleStreamOnManagedInstance() +func (client ManagedInstanceClient) SwitchModuleStreamOnManagedInstance(ctx context.Context, request SwitchModuleStreamOnManagedInstanceRequest) (response SwitchModuleStreamOnManagedInstanceResponse, 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.switchModuleStreamOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SwitchModuleStreamOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SwitchModuleStreamOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SwitchModuleStreamOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SwitchModuleStreamOnManagedInstanceResponse") + } + return +} + +// switchModuleStreamOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) switchModuleStreamOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/switchModuleStreams", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SwitchModuleStreamOnManagedInstanceResponse + 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, "ManagedInstance", "SwitchModuleStreamOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAllPackagesOnManagedInstancesInCompartment Install all of the available package updates for all of the managed instances in a compartment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateAllPackagesOnManagedInstancesInCompartment.go.html to see an example of how to use UpdateAllPackagesOnManagedInstancesInCompartment API. +// A default retry strategy applies to this operation UpdateAllPackagesOnManagedInstancesInCompartment() +func (client ManagedInstanceClient) UpdateAllPackagesOnManagedInstancesInCompartment(ctx context.Context, request UpdateAllPackagesOnManagedInstancesInCompartmentRequest) (response UpdateAllPackagesOnManagedInstancesInCompartmentResponse, 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.updateAllPackagesOnManagedInstancesInCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateAllPackagesOnManagedInstancesInCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateAllPackagesOnManagedInstancesInCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAllPackagesOnManagedInstancesInCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAllPackagesOnManagedInstancesInCompartmentResponse") + } + return +} + +// updateAllPackagesOnManagedInstancesInCompartment implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) updateAllPackagesOnManagedInstancesInCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/actions/updatePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateAllPackagesOnManagedInstancesInCompartmentResponse + 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, "ManagedInstance", "UpdateAllPackagesOnManagedInstancesInCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateManagedInstance Updates the managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateManagedInstance.go.html to see an example of how to use UpdateManagedInstance API. +// A default retry strategy applies to this operation UpdateManagedInstance() +func (client ManagedInstanceClient) UpdateManagedInstance(ctx context.Context, request UpdateManagedInstanceRequest) (response UpdateManagedInstanceResponse, 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.updateManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateManagedInstanceResponse") + } + return +} + +// updateManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) updateManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/managedInstances/{managedInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateManagedInstanceResponse + 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, "ManagedInstance", "UpdateManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdatePackagesOnManagedInstance Updates a package on a managed instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdatePackagesOnManagedInstance.go.html to see an example of how to use UpdatePackagesOnManagedInstance API. +// A default retry strategy applies to this operation UpdatePackagesOnManagedInstance() +func (client ManagedInstanceClient) UpdatePackagesOnManagedInstance(ctx context.Context, request UpdatePackagesOnManagedInstanceRequest) (response UpdatePackagesOnManagedInstanceResponse, 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.updatePackagesOnManagedInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdatePackagesOnManagedInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdatePackagesOnManagedInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdatePackagesOnManagedInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePackagesOnManagedInstanceResponse") + } + return +} + +// updatePackagesOnManagedInstance implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceClient) updatePackagesOnManagedInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstances/{managedInstanceId}/actions/updatePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdatePackagesOnManagedInstanceResponse + 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, "ManagedInstance", "UpdatePackagesOnManagedInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_managedinstancegroup_client.go b/osmanagementhub/osmanagementhub_managedinstancegroup_client.go new file mode 100644 index 0000000000..573be29298 --- /dev/null +++ b/osmanagementhub/osmanagementhub_managedinstancegroup_client.go @@ -0,0 +1,1519 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ManagedInstanceGroupClient a client for ManagedInstanceGroup +type ManagedInstanceGroupClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewManagedInstanceGroupClientWithConfigurationProvider Creates a new default ManagedInstanceGroup client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewManagedInstanceGroupClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ManagedInstanceGroupClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newManagedInstanceGroupClientFromBaseClient(baseClient, provider) +} + +// NewManagedInstanceGroupClientWithOboToken Creates a new default ManagedInstanceGroup 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 NewManagedInstanceGroupClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ManagedInstanceGroupClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newManagedInstanceGroupClientFromBaseClient(baseClient, configProvider) +} + +func newManagedInstanceGroupClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ManagedInstanceGroupClient, err error) { + // ManagedInstanceGroup service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ManagedInstanceGroup")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ManagedInstanceGroupClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ManagedInstanceGroupClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ManagedInstanceGroupClient) 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 *ManagedInstanceGroupClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// AttachManagedInstancesToManagedInstanceGroup Adds managed instances to the specified managed instance group. After the managed +// instances have been added, then operations can be performed on the managed +// instance group which will then apply to all managed instances in the +// group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachManagedInstancesToManagedInstanceGroup.go.html to see an example of how to use AttachManagedInstancesToManagedInstanceGroup API. +// A default retry strategy applies to this operation AttachManagedInstancesToManagedInstanceGroup() +func (client ManagedInstanceGroupClient) AttachManagedInstancesToManagedInstanceGroup(ctx context.Context, request AttachManagedInstancesToManagedInstanceGroupRequest) (response AttachManagedInstancesToManagedInstanceGroupResponse, 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.attachManagedInstancesToManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AttachManagedInstancesToManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AttachManagedInstancesToManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AttachManagedInstancesToManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachManagedInstancesToManagedInstanceGroupResponse") + } + return +} + +// attachManagedInstancesToManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) attachManagedInstancesToManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/attachManagedInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AttachManagedInstancesToManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "AttachManagedInstancesToManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// AttachSoftwareSourcesToManagedInstanceGroup Attaches software sources to the specified managed instance group. The software sources must be compatible with the content for the managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/AttachSoftwareSourcesToManagedInstanceGroup.go.html to see an example of how to use AttachSoftwareSourcesToManagedInstanceGroup API. +// A default retry strategy applies to this operation AttachSoftwareSourcesToManagedInstanceGroup() +func (client ManagedInstanceGroupClient) AttachSoftwareSourcesToManagedInstanceGroup(ctx context.Context, request AttachSoftwareSourcesToManagedInstanceGroupRequest) (response AttachSoftwareSourcesToManagedInstanceGroupResponse, 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.attachSoftwareSourcesToManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AttachSoftwareSourcesToManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AttachSoftwareSourcesToManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AttachSoftwareSourcesToManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachSoftwareSourcesToManagedInstanceGroupResponse") + } + return +} + +// attachSoftwareSourcesToManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) attachSoftwareSourcesToManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/attachSoftwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AttachSoftwareSourcesToManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "AttachSoftwareSourcesToManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateManagedInstanceGroup Creates a new managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateManagedInstanceGroup.go.html to see an example of how to use CreateManagedInstanceGroup API. +// A default retry strategy applies to this operation CreateManagedInstanceGroup() +func (client ManagedInstanceGroupClient) CreateManagedInstanceGroup(ctx context.Context, request CreateManagedInstanceGroupRequest) (response CreateManagedInstanceGroupResponse, 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.createManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateManagedInstanceGroupResponse") + } + return +} + +// createManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) createManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "CreateManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteManagedInstanceGroup Deletes a specified managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteManagedInstanceGroup.go.html to see an example of how to use DeleteManagedInstanceGroup API. +// A default retry strategy applies to this operation DeleteManagedInstanceGroup() +func (client ManagedInstanceGroupClient) DeleteManagedInstanceGroup(ctx context.Context, request DeleteManagedInstanceGroupRequest) (response DeleteManagedInstanceGroupResponse, 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.deleteManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteManagedInstanceGroupResponse") + } + return +} + +// deleteManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) deleteManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/managedInstanceGroups/{managedInstanceGroupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "DeleteManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DetachManagedInstancesFromManagedInstanceGroup Removes a managed instance from the specified managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachManagedInstancesFromManagedInstanceGroup.go.html to see an example of how to use DetachManagedInstancesFromManagedInstanceGroup API. +// A default retry strategy applies to this operation DetachManagedInstancesFromManagedInstanceGroup() +func (client ManagedInstanceGroupClient) DetachManagedInstancesFromManagedInstanceGroup(ctx context.Context, request DetachManagedInstancesFromManagedInstanceGroupRequest) (response DetachManagedInstancesFromManagedInstanceGroupResponse, 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.detachManagedInstancesFromManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DetachManagedInstancesFromManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DetachManagedInstancesFromManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DetachManagedInstancesFromManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachManagedInstancesFromManagedInstanceGroupResponse") + } + return +} + +// detachManagedInstancesFromManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) detachManagedInstancesFromManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/detachManagedInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DetachManagedInstancesFromManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "DetachManagedInstancesFromManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DetachSoftwareSourcesFromManagedInstanceGroup Detaches software sources from a group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DetachSoftwareSourcesFromManagedInstanceGroup.go.html to see an example of how to use DetachSoftwareSourcesFromManagedInstanceGroup API. +// A default retry strategy applies to this operation DetachSoftwareSourcesFromManagedInstanceGroup() +func (client ManagedInstanceGroupClient) DetachSoftwareSourcesFromManagedInstanceGroup(ctx context.Context, request DetachSoftwareSourcesFromManagedInstanceGroupRequest) (response DetachSoftwareSourcesFromManagedInstanceGroupResponse, 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.detachSoftwareSourcesFromManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DetachSoftwareSourcesFromManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DetachSoftwareSourcesFromManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DetachSoftwareSourcesFromManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachSoftwareSourcesFromManagedInstanceGroupResponse") + } + return +} + +// detachSoftwareSourcesFromManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) detachSoftwareSourcesFromManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/detachSoftwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DetachSoftwareSourcesFromManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "DetachSoftwareSourcesFromManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableModuleStreamOnManagedInstanceGroup Disables a module stream on a managed instance group. After the stream is +// disabled, it is no longer possible to install the profiles that are +// contained by the stream. All installed profiles must be removed prior +// to disabling a module stream. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DisableModuleStreamOnManagedInstanceGroup.go.html to see an example of how to use DisableModuleStreamOnManagedInstanceGroup API. +// A default retry strategy applies to this operation DisableModuleStreamOnManagedInstanceGroup() +func (client ManagedInstanceGroupClient) DisableModuleStreamOnManagedInstanceGroup(ctx context.Context, request DisableModuleStreamOnManagedInstanceGroupRequest) (response DisableModuleStreamOnManagedInstanceGroupResponse, 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.disableModuleStreamOnManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableModuleStreamOnManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableModuleStreamOnManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableModuleStreamOnManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableModuleStreamOnManagedInstanceGroupResponse") + } + return +} + +// disableModuleStreamOnManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) disableModuleStreamOnManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/disableModuleStream", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableModuleStreamOnManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "DisableModuleStreamOnManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// EnableModuleStreamOnManagedInstanceGroup Enables a module stream on a managed instance group. After the stream is +// enabled, it is possible to install the profiles that are contained +// by the stream. Enabling a stream that is already enabled will +// succeed. Attempting to enable a different stream for a module that +// already has a stream enabled results in an error. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/EnableModuleStreamOnManagedInstanceGroup.go.html to see an example of how to use EnableModuleStreamOnManagedInstanceGroup API. +// A default retry strategy applies to this operation EnableModuleStreamOnManagedInstanceGroup() +func (client ManagedInstanceGroupClient) EnableModuleStreamOnManagedInstanceGroup(ctx context.Context, request EnableModuleStreamOnManagedInstanceGroupRequest) (response EnableModuleStreamOnManagedInstanceGroupResponse, 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.enableModuleStreamOnManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableModuleStreamOnManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableModuleStreamOnManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableModuleStreamOnManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableModuleStreamOnManagedInstanceGroupResponse") + } + return +} + +// enableModuleStreamOnManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) enableModuleStreamOnManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/enableModuleStream", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableModuleStreamOnManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "EnableModuleStreamOnManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetManagedInstanceGroup Gets information about the specified managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstanceGroup.go.html to see an example of how to use GetManagedInstanceGroup API. +// A default retry strategy applies to this operation GetManagedInstanceGroup() +func (client ManagedInstanceGroupClient) GetManagedInstanceGroup(ctx context.Context, request GetManagedInstanceGroupRequest) (response GetManagedInstanceGroupResponse, 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.getManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetManagedInstanceGroupResponse") + } + return +} + +// getManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) getManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceGroups/{managedInstanceGroupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "GetManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// InstallModuleStreamProfileOnManagedInstanceGroup Installs a profile for an module stream. The stream must be +// enabled before a profile can be installed. If a module stream +// defines multiple profiles, each one can be installed independently. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallModuleStreamProfileOnManagedInstanceGroup.go.html to see an example of how to use InstallModuleStreamProfileOnManagedInstanceGroup API. +// A default retry strategy applies to this operation InstallModuleStreamProfileOnManagedInstanceGroup() +func (client ManagedInstanceGroupClient) InstallModuleStreamProfileOnManagedInstanceGroup(ctx context.Context, request InstallModuleStreamProfileOnManagedInstanceGroupRequest) (response InstallModuleStreamProfileOnManagedInstanceGroupResponse, 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.installModuleStreamProfileOnManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = InstallModuleStreamProfileOnManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = InstallModuleStreamProfileOnManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(InstallModuleStreamProfileOnManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into InstallModuleStreamProfileOnManagedInstanceGroupResponse") + } + return +} + +// installModuleStreamProfileOnManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) installModuleStreamProfileOnManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/installStreamProfile", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response InstallModuleStreamProfileOnManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "InstallModuleStreamProfileOnManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// InstallPackagesOnManagedInstanceGroup Installs package(s) on each managed instance in a managed instance group. The package must be compatible with the +// instances in the managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/InstallPackagesOnManagedInstanceGroup.go.html to see an example of how to use InstallPackagesOnManagedInstanceGroup API. +// A default retry strategy applies to this operation InstallPackagesOnManagedInstanceGroup() +func (client ManagedInstanceGroupClient) InstallPackagesOnManagedInstanceGroup(ctx context.Context, request InstallPackagesOnManagedInstanceGroupRequest) (response InstallPackagesOnManagedInstanceGroupResponse, 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.installPackagesOnManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = InstallPackagesOnManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = InstallPackagesOnManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(InstallPackagesOnManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into InstallPackagesOnManagedInstanceGroupResponse") + } + return +} + +// installPackagesOnManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) installPackagesOnManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/installPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response InstallPackagesOnManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "InstallPackagesOnManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceGroupAvailableModules Lists available modules that for the specified managed instance group. Filter the list against a variety of +// criteria including but not limited to its name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupAvailableModules.go.html to see an example of how to use ListManagedInstanceGroupAvailableModules API. +// A default retry strategy applies to this operation ListManagedInstanceGroupAvailableModules() +func (client ManagedInstanceGroupClient) ListManagedInstanceGroupAvailableModules(ctx context.Context, request ListManagedInstanceGroupAvailableModulesRequest) (response ListManagedInstanceGroupAvailableModulesResponse, 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.listManagedInstanceGroupAvailableModules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceGroupAvailableModulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceGroupAvailableModulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceGroupAvailableModulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceGroupAvailableModulesResponse") + } + return +} + +// listManagedInstanceGroupAvailableModules implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) listManagedInstanceGroupAvailableModules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceGroups/{managedInstanceGroupId}/availableModules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceGroupAvailableModulesResponse + 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, "ManagedInstanceGroup", "ListManagedInstanceGroupAvailableModules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceGroupAvailablePackages Lists available packages on the specified managed instances group. Filter the list against a variety +// of criteria including but not limited to the package name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupAvailablePackages.go.html to see an example of how to use ListManagedInstanceGroupAvailablePackages API. +// A default retry strategy applies to this operation ListManagedInstanceGroupAvailablePackages() +func (client ManagedInstanceGroupClient) ListManagedInstanceGroupAvailablePackages(ctx context.Context, request ListManagedInstanceGroupAvailablePackagesRequest) (response ListManagedInstanceGroupAvailablePackagesResponse, 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.listManagedInstanceGroupAvailablePackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceGroupAvailablePackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceGroupAvailablePackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceGroupAvailablePackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceGroupAvailablePackagesResponse") + } + return +} + +// listManagedInstanceGroupAvailablePackages implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) listManagedInstanceGroupAvailablePackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceGroups/{managedInstanceGroupId}/availablePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceGroupAvailablePackagesResponse + 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, "ManagedInstanceGroup", "ListManagedInstanceGroupAvailablePackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceGroupAvailableSoftwareSources Lists available software sources for a specified managed instance group. Filter the list against a variety of +// criteria including but not limited to its name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupAvailableSoftwareSources.go.html to see an example of how to use ListManagedInstanceGroupAvailableSoftwareSources API. +// A default retry strategy applies to this operation ListManagedInstanceGroupAvailableSoftwareSources() +func (client ManagedInstanceGroupClient) ListManagedInstanceGroupAvailableSoftwareSources(ctx context.Context, request ListManagedInstanceGroupAvailableSoftwareSourcesRequest) (response ListManagedInstanceGroupAvailableSoftwareSourcesResponse, 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.listManagedInstanceGroupAvailableSoftwareSources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceGroupAvailableSoftwareSourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceGroupAvailableSoftwareSourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceGroupAvailableSoftwareSourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceGroupAvailableSoftwareSourcesResponse") + } + return +} + +// listManagedInstanceGroupAvailableSoftwareSources implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) listManagedInstanceGroupAvailableSoftwareSources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceGroups/{managedInstanceGroupId}/availableSoftwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceGroupAvailableSoftwareSourcesResponse + 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, "ManagedInstanceGroup", "ListManagedInstanceGroupAvailableSoftwareSources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceGroupInstalledPackages Lists installed packages on the specified managed instances group. Filter the list against a variety +// of criteria including but not limited to the package name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupInstalledPackages.go.html to see an example of how to use ListManagedInstanceGroupInstalledPackages API. +// A default retry strategy applies to this operation ListManagedInstanceGroupInstalledPackages() +func (client ManagedInstanceGroupClient) ListManagedInstanceGroupInstalledPackages(ctx context.Context, request ListManagedInstanceGroupInstalledPackagesRequest) (response ListManagedInstanceGroupInstalledPackagesResponse, 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.listManagedInstanceGroupInstalledPackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceGroupInstalledPackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceGroupInstalledPackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceGroupInstalledPackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceGroupInstalledPackagesResponse") + } + return +} + +// listManagedInstanceGroupInstalledPackages implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) listManagedInstanceGroupInstalledPackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceGroups/{managedInstanceGroupId}/installedPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceGroupInstalledPackagesResponse + 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, "ManagedInstanceGroup", "ListManagedInstanceGroupInstalledPackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceGroupModules Retrieve a list of module streams, along with a summary of their +// status, from a managed instance group. Filters may be applied to select +// a subset of module streams based on the filter criteria. +// The 'moduleName' attribute filters against the name of a module. +// It accepts strings of the format "". If this attribute +// is defined, only streams that belong to the specified module are +// included in the result set. If it is not defined, the request is +// not subject to this filter. +// The "status" attribute filters against the state of a module stream. +// Valid values are "ENABLED", "DISABLED", and "ACTIVE". If the +// attribute is set to "ENABLED", only module streams that are enabled +// are included in the result set. If the attribute is set to "DISABLED", +// only module streams that are not enabled are included in the result +// set. If the attribute is set to "ACTIVE", only module streams that +// are active are included in the result set. If the attribute is not +// defined, the request is not subject to this filter. +// When sorting by the display name, the result set is sorted first +// by the module name and then by the stream name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroupModules.go.html to see an example of how to use ListManagedInstanceGroupModules API. +// A default retry strategy applies to this operation ListManagedInstanceGroupModules() +func (client ManagedInstanceGroupClient) ListManagedInstanceGroupModules(ctx context.Context, request ListManagedInstanceGroupModulesRequest) (response ListManagedInstanceGroupModulesResponse, 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.listManagedInstanceGroupModules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceGroupModulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceGroupModulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceGroupModulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceGroupModulesResponse") + } + return +} + +// listManagedInstanceGroupModules implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) listManagedInstanceGroupModules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceGroups/{managedInstanceGroupId}/modules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceGroupModulesResponse + 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, "ManagedInstanceGroup", "ListManagedInstanceGroupModules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagedInstanceGroups Lists managed instance groups that match the specified compartment or managed instance group OCID. Filter the +// list against a variety of criteria including but not limited to its name, status, architecture, and OS family. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagedInstanceGroups.go.html to see an example of how to use ListManagedInstanceGroups API. +// A default retry strategy applies to this operation ListManagedInstanceGroups() +func (client ManagedInstanceGroupClient) ListManagedInstanceGroups(ctx context.Context, request ListManagedInstanceGroupsRequest) (response ListManagedInstanceGroupsResponse, 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.listManagedInstanceGroups, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagedInstanceGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagedInstanceGroupsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagedInstanceGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagedInstanceGroupsResponse") + } + return +} + +// listManagedInstanceGroups implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) listManagedInstanceGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceGroups", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagedInstanceGroupsResponse + 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, "ManagedInstanceGroup", "ListManagedInstanceGroups", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ManageModuleStreamsOnManagedInstanceGroup Perform an operation involving modules, streams, and profiles on a +// managed instance group. Each operation may enable or disable an arbitrary +// amount of module streams, and install or remove an arbitrary number +// of module stream profiles. When the operation is complete, the +// state of the modules, streams, and profiles on the managed instance group +// will match the state indicated in the operation. +// Each module stream specified in the list of module streams to enable +// will be in the "ENABLED" state upon completion of the operation. +// If there was already a stream of that module enabled, any work +// required to switch from the current stream to the new stream is +// performed implicitly. +// Each module stream specified in the list of module streams to disable +// will be in the "DISABLED" state upon completion of the operation. +// Any profiles that are installed for the module stream will be removed +// as part of the operation. +// Each module stream profile specified in the list of profiles to install +// will be in the "INSTALLED" state upon completion of the operation, +// indicating that any packages that are part of the profile are installed +// on the managed instance. If the module stream containing the profile +// is not enabled, it will be enabled as part of the operation. There +// is an exception when attempting to install a stream of a profile when +// another stream of the same module is enabled. It is an error to attempt +// to install a profile of another module stream, unless enabling the +// new module stream is explicitly included in this operation. +// Each module stream profile specified in the list of profiles to remove +// will be in the "AVAILABLE" state upon completion of the operation. +// The status of packages within the profile after the operation is +// complete is defined by the package manager on the managed instance group. +// Operations that contain one or more elements that are not allowed +// are rejected. +// The result of this request is a work request object. The returned +// work request is the parent of a structure of other work requests. Taken +// as a whole, this structure indicates the entire set of work to be +// performed to complete the operation. +// This interface can also be used to perform a dry run of the operation +// rather than committing it to a managed instance group. If a dry run is +// requested, the OS Management Hub service will evaluate the operation +// against the current module, stream, and profile state on the managed +// instance. It will calculate the impact of the operation on all +// modules, streams, and profiles on the managed instance, including those +// that are implicitly impacted by the operation. +// The work request resulting from a dry run behaves differently than +// a work request resulting from a committable operation. Dry run +// work requests are always singletons and never have children. The +// impact of the operation is returned using the log and error +// facilities of work requests. The impact of operations that are +// allowed by the OS Management Hub service are communicated as one or +// more work request log entries. Operations that are not allowed +// by the OS Management Hub service are communicated as one or more +// work request error entries. Each entry, for either logs or errors, +// contains a structured message containing the results of one +// or more operations. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ManageModuleStreamsOnManagedInstanceGroup.go.html to see an example of how to use ManageModuleStreamsOnManagedInstanceGroup API. +// A default retry strategy applies to this operation ManageModuleStreamsOnManagedInstanceGroup() +func (client ManagedInstanceGroupClient) ManageModuleStreamsOnManagedInstanceGroup(ctx context.Context, request ManageModuleStreamsOnManagedInstanceGroupRequest) (response ManageModuleStreamsOnManagedInstanceGroupResponse, 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.manageModuleStreamsOnManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ManageModuleStreamsOnManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ManageModuleStreamsOnManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ManageModuleStreamsOnManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ManageModuleStreamsOnManagedInstanceGroupResponse") + } + return +} + +// manageModuleStreamsOnManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) manageModuleStreamsOnManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/manageModuleStreams", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ManageModuleStreamsOnManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "ManageModuleStreamsOnManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveModuleStreamProfileFromManagedInstanceGroup Removes a profile for a module stream that is installed on a managed instance group. +// If a module stream is provided, rather than a fully qualified profile, all +// profiles that have been installed for the module stream will be removed. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemoveModuleStreamProfileFromManagedInstanceGroup.go.html to see an example of how to use RemoveModuleStreamProfileFromManagedInstanceGroup API. +// A default retry strategy applies to this operation RemoveModuleStreamProfileFromManagedInstanceGroup() +func (client ManagedInstanceGroupClient) RemoveModuleStreamProfileFromManagedInstanceGroup(ctx context.Context, request RemoveModuleStreamProfileFromManagedInstanceGroupRequest) (response RemoveModuleStreamProfileFromManagedInstanceGroupResponse, 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.removeModuleStreamProfileFromManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveModuleStreamProfileFromManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveModuleStreamProfileFromManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveModuleStreamProfileFromManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveModuleStreamProfileFromManagedInstanceGroupResponse") + } + return +} + +// removeModuleStreamProfileFromManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) removeModuleStreamProfileFromManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/removeStreamProfile", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveModuleStreamProfileFromManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "RemoveModuleStreamProfileFromManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemovePackagesFromManagedInstanceGroup Removes package(s) from each managed instance in a specified managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemovePackagesFromManagedInstanceGroup.go.html to see an example of how to use RemovePackagesFromManagedInstanceGroup API. +// A default retry strategy applies to this operation RemovePackagesFromManagedInstanceGroup() +func (client ManagedInstanceGroupClient) RemovePackagesFromManagedInstanceGroup(ctx context.Context, request RemovePackagesFromManagedInstanceGroupRequest) (response RemovePackagesFromManagedInstanceGroupResponse, 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.removePackagesFromManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemovePackagesFromManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemovePackagesFromManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemovePackagesFromManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemovePackagesFromManagedInstanceGroupResponse") + } + return +} + +// removePackagesFromManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) removePackagesFromManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/removePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemovePackagesFromManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "RemovePackagesFromManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAllPackagesOnManagedInstanceGroup Updates all packages on each managed instance in the specified managed instance group. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateAllPackagesOnManagedInstanceGroup.go.html to see an example of how to use UpdateAllPackagesOnManagedInstanceGroup API. +// A default retry strategy applies to this operation UpdateAllPackagesOnManagedInstanceGroup() +func (client ManagedInstanceGroupClient) UpdateAllPackagesOnManagedInstanceGroup(ctx context.Context, request UpdateAllPackagesOnManagedInstanceGroupRequest) (response UpdateAllPackagesOnManagedInstanceGroupResponse, 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.updateAllPackagesOnManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateAllPackagesOnManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateAllPackagesOnManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAllPackagesOnManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAllPackagesOnManagedInstanceGroupResponse") + } + return +} + +// updateAllPackagesOnManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) updateAllPackagesOnManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managedInstanceGroups/{managedInstanceGroupId}/actions/updateAllPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateAllPackagesOnManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "UpdateAllPackagesOnManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateManagedInstanceGroup Updates the specified managed instance group's name, description, and tags. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateManagedInstanceGroup.go.html to see an example of how to use UpdateManagedInstanceGroup API. +// A default retry strategy applies to this operation UpdateManagedInstanceGroup() +func (client ManagedInstanceGroupClient) UpdateManagedInstanceGroup(ctx context.Context, request UpdateManagedInstanceGroupRequest) (response UpdateManagedInstanceGroupResponse, 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.updateManagedInstanceGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateManagedInstanceGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateManagedInstanceGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateManagedInstanceGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateManagedInstanceGroupResponse") + } + return +} + +// updateManagedInstanceGroup implements the OCIOperation interface (enables retrying operations) +func (client ManagedInstanceGroupClient) updateManagedInstanceGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/managedInstanceGroups/{managedInstanceGroupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateManagedInstanceGroupResponse + 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, "ManagedInstanceGroup", "UpdateManagedInstanceGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_managementstation_client.go b/osmanagementhub/osmanagementhub_managementstation_client.go new file mode 100644 index 0000000000..c11589b0b5 --- /dev/null +++ b/osmanagementhub/osmanagementhub_managementstation_client.go @@ -0,0 +1,569 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ManagementStationClient a client for ManagementStation +type ManagementStationClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewManagementStationClientWithConfigurationProvider Creates a new default ManagementStation client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewManagementStationClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ManagementStationClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newManagementStationClientFromBaseClient(baseClient, provider) +} + +// NewManagementStationClientWithOboToken Creates a new default ManagementStation 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 NewManagementStationClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ManagementStationClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newManagementStationClientFromBaseClient(baseClient, configProvider) +} + +func newManagementStationClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ManagementStationClient, err error) { + // ManagementStation service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ManagementStation")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ManagementStationClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ManagementStationClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ManagementStationClient) 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 *ManagementStationClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateManagementStation Creates a management station. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateManagementStation.go.html to see an example of how to use CreateManagementStation API. +// A default retry strategy applies to this operation CreateManagementStation() +func (client ManagementStationClient) CreateManagementStation(ctx context.Context, request CreateManagementStationRequest) (response CreateManagementStationResponse, 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.createManagementStation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateManagementStationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateManagementStationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateManagementStationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateManagementStationResponse") + } + return +} + +// createManagementStation implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) createManagementStation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managementStations", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateManagementStationResponse + 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, "ManagementStation", "CreateManagementStation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteManagementStation Deletes a management station. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteManagementStation.go.html to see an example of how to use DeleteManagementStation API. +// A default retry strategy applies to this operation DeleteManagementStation() +func (client ManagementStationClient) DeleteManagementStation(ctx context.Context, request DeleteManagementStationRequest) (response DeleteManagementStationResponse, 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.deleteManagementStation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteManagementStationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteManagementStationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteManagementStationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteManagementStationResponse") + } + return +} + +// deleteManagementStation implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) deleteManagementStation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/managementStations/{managementStationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteManagementStationResponse + 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, "ManagementStation", "DeleteManagementStation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetManagementStation Gets information about the specified management station. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagementStation.go.html to see an example of how to use GetManagementStation API. +// A default retry strategy applies to this operation GetManagementStation() +func (client ManagementStationClient) GetManagementStation(ctx context.Context, request GetManagementStationRequest) (response GetManagementStationResponse, 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.getManagementStation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetManagementStationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetManagementStationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetManagementStationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetManagementStationResponse") + } + return +} + +// getManagementStation implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) getManagementStation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managementStations/{managementStationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetManagementStationResponse + 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, "ManagementStation", "GetManagementStation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListManagementStations Lists management stations in a compartment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListManagementStations.go.html to see an example of how to use ListManagementStations API. +// A default retry strategy applies to this operation ListManagementStations() +func (client ManagementStationClient) ListManagementStations(ctx context.Context, request ListManagementStationsRequest) (response ListManagementStationsResponse, 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.listManagementStations, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListManagementStationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListManagementStationsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListManagementStationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListManagementStationsResponse") + } + return +} + +// listManagementStations implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) listManagementStations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managementStations", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListManagementStationsResponse + 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, "ManagementStation", "ListManagementStations", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMirrors Lists all software source mirrors associated with a specified management station. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListMirrors.go.html to see an example of how to use ListMirrors API. +// A default retry strategy applies to this operation ListMirrors() +func (client ManagementStationClient) ListMirrors(ctx context.Context, request ListMirrorsRequest) (response ListMirrorsResponse, 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.listMirrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMirrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMirrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMirrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMirrorsResponse") + } + return +} + +// listMirrors implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) listMirrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managementStations/{managementStationId}/mirrors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMirrorsResponse + 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, "ManagementStation", "ListMirrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SynchronizeMirrors Synchronizes the specified mirrors associated with the management station. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SynchronizeMirrors.go.html to see an example of how to use SynchronizeMirrors API. +// A default retry strategy applies to this operation SynchronizeMirrors() +func (client ManagementStationClient) SynchronizeMirrors(ctx context.Context, request SynchronizeMirrorsRequest) (response SynchronizeMirrorsResponse, 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.synchronizeMirrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SynchronizeMirrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SynchronizeMirrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SynchronizeMirrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SynchronizeMirrorsResponse") + } + return +} + +// synchronizeMirrors implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) synchronizeMirrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managementStations/{managementStationId}/actions/synchronizeMirrors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SynchronizeMirrorsResponse + 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, "ManagementStation", "SynchronizeMirrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SynchronizeSingleMirrors Synchronize the specified mirror associated with a management station. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SynchronizeSingleMirrors.go.html to see an example of how to use SynchronizeSingleMirrors API. +// A default retry strategy applies to this operation SynchronizeSingleMirrors() +func (client ManagementStationClient) SynchronizeSingleMirrors(ctx context.Context, request SynchronizeSingleMirrorsRequest) (response SynchronizeSingleMirrorsResponse, 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.synchronizeSingleMirrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SynchronizeSingleMirrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SynchronizeSingleMirrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SynchronizeSingleMirrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SynchronizeSingleMirrorsResponse") + } + return +} + +// synchronizeSingleMirrors implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) synchronizeSingleMirrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managementStations/{managementStationId}/mirrors/{mirrorId}/actions/synchronize", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SynchronizeSingleMirrorsResponse + 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, "ManagementStation", "SynchronizeSingleMirrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateManagementStation Updates the configuration of the specified management station. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateManagementStation.go.html to see an example of how to use UpdateManagementStation API. +// A default retry strategy applies to this operation UpdateManagementStation() +func (client ManagementStationClient) UpdateManagementStation(ctx context.Context, request UpdateManagementStationRequest) (response UpdateManagementStationResponse, 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.updateManagementStation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateManagementStationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateManagementStationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateManagementStationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateManagementStationResponse") + } + return +} + +// updateManagementStation implements the OCIOperation interface (enables retrying operations) +func (client ManagementStationClient) updateManagementStation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/managementStations/{managementStationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateManagementStationResponse + 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, "ManagementStation", "UpdateManagementStation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_onboarding_client.go b/osmanagementhub/osmanagementhub_onboarding_client.go new file mode 100644 index 0000000000..4dd19bdf29 --- /dev/null +++ b/osmanagementhub/osmanagementhub_onboarding_client.go @@ -0,0 +1,388 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// OnboardingClient a client for Onboarding +type OnboardingClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewOnboardingClientWithConfigurationProvider Creates a new default Onboarding client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewOnboardingClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client OnboardingClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newOnboardingClientFromBaseClient(baseClient, provider) +} + +// NewOnboardingClientWithOboToken Creates a new default Onboarding 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 NewOnboardingClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client OnboardingClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newOnboardingClientFromBaseClient(baseClient, configProvider) +} + +func newOnboardingClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client OnboardingClient, err error) { + // Onboarding service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Onboarding")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = OnboardingClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *OnboardingClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *OnboardingClient) 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 *OnboardingClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateProfile Creates a registration profile. +// A profile is a supplementary file for the OS Management Hub agentry +// that dictates the content for a managed instance at registration time. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateProfile.go.html to see an example of how to use CreateProfile API. +// A default retry strategy applies to this operation CreateProfile() +func (client OnboardingClient) CreateProfile(ctx context.Context, request CreateProfileRequest) (response CreateProfileResponse, 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.createProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateProfileResponse") + } + return +} + +// createProfile implements the OCIOperation interface (enables retrying operations) +func (client OnboardingClient) createProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/profiles", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateProfileResponse + 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, "Onboarding", "CreateProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &profile{}) + return response, err +} + +// DeleteProfile Deletes a specified registration profile. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteProfile.go.html to see an example of how to use DeleteProfile API. +// A default retry strategy applies to this operation DeleteProfile() +func (client OnboardingClient) DeleteProfile(ctx context.Context, request DeleteProfileRequest) (response DeleteProfileResponse, 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.deleteProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteProfileResponse") + } + return +} + +// deleteProfile implements the OCIOperation interface (enables retrying operations) +func (client OnboardingClient) deleteProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/profiles/{profileId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteProfileResponse + 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, "Onboarding", "DeleteProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetProfile Gets information about the specified registration profile. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetProfile.go.html to see an example of how to use GetProfile API. +// A default retry strategy applies to this operation GetProfile() +func (client OnboardingClient) GetProfile(ctx context.Context, request GetProfileRequest) (response GetProfileResponse, 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.getProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetProfileResponse") + } + return +} + +// getProfile implements the OCIOperation interface (enables retrying operations) +func (client OnboardingClient) getProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/profiles/{profileId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetProfileResponse + 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, "Onboarding", "GetProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &profile{}) + return response, err +} + +// ListProfiles Lists registration profiles that match the specified compartment or profile OCID. Filter the list against a +// variety of criteria including but not limited to its name, status, vendor name, and architecture type. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListProfiles.go.html to see an example of how to use ListProfiles API. +// A default retry strategy applies to this operation ListProfiles() +func (client OnboardingClient) ListProfiles(ctx context.Context, request ListProfilesRequest) (response ListProfilesResponse, 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.listProfiles, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListProfilesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListProfilesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListProfilesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListProfilesResponse") + } + return +} + +// listProfiles implements the OCIOperation interface (enables retrying operations) +func (client OnboardingClient) listProfiles(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/profiles", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListProfilesResponse + 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, "Onboarding", "ListProfiles", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateProfile Updates the specified profile's name, description, and tags. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateProfile.go.html to see an example of how to use UpdateProfile API. +// A default retry strategy applies to this operation UpdateProfile() +func (client OnboardingClient) UpdateProfile(ctx context.Context, request UpdateProfileRequest) (response UpdateProfileResponse, 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.updateProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateProfileResponse") + } + return +} + +// updateProfile implements the OCIOperation interface (enables retrying operations) +func (client OnboardingClient) updateProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/profiles/{profileId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateProfileResponse + 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, "Onboarding", "UpdateProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &profile{}) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_reportingmanagedinstance_client.go b/osmanagementhub/osmanagementhub_reportingmanagedinstance_client.go new file mode 100644 index 0000000000..e50cb87ff0 --- /dev/null +++ b/osmanagementhub/osmanagementhub_reportingmanagedinstance_client.go @@ -0,0 +1,262 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ReportingManagedInstanceClient a client for ReportingManagedInstance +type ReportingManagedInstanceClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewReportingManagedInstanceClientWithConfigurationProvider Creates a new default ReportingManagedInstance client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewReportingManagedInstanceClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ReportingManagedInstanceClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newReportingManagedInstanceClientFromBaseClient(baseClient, provider) +} + +// NewReportingManagedInstanceClientWithOboToken Creates a new default ReportingManagedInstance 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 NewReportingManagedInstanceClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ReportingManagedInstanceClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newReportingManagedInstanceClientFromBaseClient(baseClient, configProvider) +} + +func newReportingManagedInstanceClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ReportingManagedInstanceClient, err error) { + // ReportingManagedInstance service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ReportingManagedInstance")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ReportingManagedInstanceClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ReportingManagedInstanceClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ReportingManagedInstanceClient) 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 *ReportingManagedInstanceClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetManagedInstanceAnalyticContent Returns a CSV format report of managed instances matching the given filters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstanceAnalyticContent.go.html to see an example of how to use GetManagedInstanceAnalyticContent API. +// A default retry strategy applies to this operation GetManagedInstanceAnalyticContent() +func (client ReportingManagedInstanceClient) GetManagedInstanceAnalyticContent(ctx context.Context, request GetManagedInstanceAnalyticContentRequest) (response GetManagedInstanceAnalyticContentResponse, 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.getManagedInstanceAnalyticContent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetManagedInstanceAnalyticContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetManagedInstanceAnalyticContentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetManagedInstanceAnalyticContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetManagedInstanceAnalyticContentResponse") + } + return +} + +// getManagedInstanceAnalyticContent implements the OCIOperation interface (enables retrying operations) +func (client ReportingManagedInstanceClient) getManagedInstanceAnalyticContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceAnalytics/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetManagedInstanceAnalyticContentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ReportingManagedInstance", "GetManagedInstanceAnalyticContent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetManagedInstanceContent Returns a CSV format report of a single managed instance whose associated Erratas match the given filters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetManagedInstanceContent.go.html to see an example of how to use GetManagedInstanceContent API. +// A default retry strategy applies to this operation GetManagedInstanceContent() +func (client ReportingManagedInstanceClient) GetManagedInstanceContent(ctx context.Context, request GetManagedInstanceContentRequest) (response GetManagedInstanceContentResponse, 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.getManagedInstanceContent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetManagedInstanceContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetManagedInstanceContentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetManagedInstanceContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetManagedInstanceContentResponse") + } + return +} + +// getManagedInstanceContent implements the OCIOperation interface (enables retrying operations) +func (client ReportingManagedInstanceClient) getManagedInstanceContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstances/{managedInstanceId}/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetManagedInstanceContentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ReportingManagedInstance", "GetManagedInstanceContent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeManagedInstanceAnalytics Returns a list of user specified metrics for a collection of managed instances. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SummarizeManagedInstanceAnalytics.go.html to see an example of how to use SummarizeManagedInstanceAnalytics API. +// A default retry strategy applies to this operation SummarizeManagedInstanceAnalytics() +func (client ReportingManagedInstanceClient) SummarizeManagedInstanceAnalytics(ctx context.Context, request SummarizeManagedInstanceAnalyticsRequest) (response SummarizeManagedInstanceAnalyticsResponse, 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.summarizeManagedInstanceAnalytics, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeManagedInstanceAnalyticsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeManagedInstanceAnalyticsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeManagedInstanceAnalyticsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeManagedInstanceAnalyticsResponse") + } + return +} + +// summarizeManagedInstanceAnalytics implements the OCIOperation interface (enables retrying operations) +func (client ReportingManagedInstanceClient) summarizeManagedInstanceAnalytics(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedInstanceAnalytics", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeManagedInstanceAnalyticsResponse + 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, "ReportingManagedInstance", "SummarizeManagedInstanceAnalytics", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_scheduledjob_client.go b/osmanagementhub/osmanagementhub_scheduledjob_client.go new file mode 100644 index 0000000000..caf3bfd014 --- /dev/null +++ b/osmanagementhub/osmanagementhub_scheduledjob_client.go @@ -0,0 +1,451 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ScheduledJobClient a client for ScheduledJob +type ScheduledJobClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewScheduledJobClientWithConfigurationProvider Creates a new default ScheduledJob client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewScheduledJobClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ScheduledJobClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newScheduledJobClientFromBaseClient(baseClient, provider) +} + +// NewScheduledJobClientWithOboToken Creates a new default ScheduledJob 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 NewScheduledJobClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ScheduledJobClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newScheduledJobClientFromBaseClient(baseClient, configProvider) +} + +func newScheduledJobClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ScheduledJobClient, err error) { + // ScheduledJob service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ScheduledJob")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ScheduledJobClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ScheduledJobClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ScheduledJobClient) 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 *ScheduledJobClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateScheduledJob Creates a new scheduled job. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateScheduledJob.go.html to see an example of how to use CreateScheduledJob API. +// A default retry strategy applies to this operation CreateScheduledJob() +func (client ScheduledJobClient) CreateScheduledJob(ctx context.Context, request CreateScheduledJobRequest) (response CreateScheduledJobResponse, 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.createScheduledJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateScheduledJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateScheduledJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateScheduledJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateScheduledJobResponse") + } + return +} + +// createScheduledJob implements the OCIOperation interface (enables retrying operations) +func (client ScheduledJobClient) createScheduledJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/scheduledJobs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateScheduledJobResponse + 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, "ScheduledJob", "CreateScheduledJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteScheduledJob Deletes the specified scheduled job. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteScheduledJob.go.html to see an example of how to use DeleteScheduledJob API. +// A default retry strategy applies to this operation DeleteScheduledJob() +func (client ScheduledJobClient) DeleteScheduledJob(ctx context.Context, request DeleteScheduledJobRequest) (response DeleteScheduledJobResponse, 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.deleteScheduledJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteScheduledJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteScheduledJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteScheduledJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteScheduledJobResponse") + } + return +} + +// deleteScheduledJob implements the OCIOperation interface (enables retrying operations) +func (client ScheduledJobClient) deleteScheduledJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/scheduledJobs/{scheduledJobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteScheduledJobResponse + 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, "ScheduledJob", "DeleteScheduledJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetScheduledJob Gets information about the specified scheduled job. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetScheduledJob.go.html to see an example of how to use GetScheduledJob API. +// A default retry strategy applies to this operation GetScheduledJob() +func (client ScheduledJobClient) GetScheduledJob(ctx context.Context, request GetScheduledJobRequest) (response GetScheduledJobResponse, 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.getScheduledJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetScheduledJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetScheduledJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetScheduledJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetScheduledJobResponse") + } + return +} + +// getScheduledJob implements the OCIOperation interface (enables retrying operations) +func (client ScheduledJobClient) getScheduledJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/scheduledJobs/{scheduledJobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetScheduledJobResponse + 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, "ScheduledJob", "GetScheduledJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListScheduledJobs Lists scheduled jobs that match the specified compartment or scheduled job OCID. +// Filter the list against a variety of criteria including but not limited to its display name, +// lifecycle state, operation type, and schedule type. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListScheduledJobs.go.html to see an example of how to use ListScheduledJobs API. +// A default retry strategy applies to this operation ListScheduledJobs() +func (client ScheduledJobClient) ListScheduledJobs(ctx context.Context, request ListScheduledJobsRequest) (response ListScheduledJobsResponse, 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.listScheduledJobs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListScheduledJobsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListScheduledJobsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListScheduledJobsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListScheduledJobsResponse") + } + return +} + +// listScheduledJobs implements the OCIOperation interface (enables retrying operations) +func (client ScheduledJobClient) listScheduledJobs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/scheduledJobs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListScheduledJobsResponse + 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, "ScheduledJob", "ListScheduledJobs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RunScheduledJobNow Triggers an already created RECURRING scheduled job to run immediately instead of waiting +// for its next regularly scheduled time. This operation does not support ONETIME scheduled job. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RunScheduledJobNow.go.html to see an example of how to use RunScheduledJobNow API. +// A default retry strategy applies to this operation RunScheduledJobNow() +func (client ScheduledJobClient) RunScheduledJobNow(ctx context.Context, request RunScheduledJobNowRequest) (response RunScheduledJobNowResponse, 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.runScheduledJobNow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RunScheduledJobNowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RunScheduledJobNowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RunScheduledJobNowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RunScheduledJobNowResponse") + } + return +} + +// runScheduledJobNow implements the OCIOperation interface (enables retrying operations) +func (client ScheduledJobClient) runScheduledJobNow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/scheduledJobs/{scheduledJobId}/actions/runNow", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RunScheduledJobNowResponse + 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, "ScheduledJob", "RunScheduledJobNow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateScheduledJob Updates the specified scheduled job's name, description, and other details, such as next execution and recurrence. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateScheduledJob.go.html to see an example of how to use UpdateScheduledJob API. +// A default retry strategy applies to this operation UpdateScheduledJob() +func (client ScheduledJobClient) UpdateScheduledJob(ctx context.Context, request UpdateScheduledJobRequest) (response UpdateScheduledJobResponse, 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.updateScheduledJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateScheduledJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateScheduledJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateScheduledJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateScheduledJobResponse") + } + return +} + +// updateScheduledJob implements the OCIOperation interface (enables retrying operations) +func (client ScheduledJobClient) updateScheduledJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/scheduledJobs/{scheduledJobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateScheduledJobResponse + 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, "ScheduledJob", "UpdateScheduledJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_softwaresource_client.go b/osmanagementhub/osmanagementhub_softwaresource_client.go new file mode 100644 index 0000000000..97989f7d50 --- /dev/null +++ b/osmanagementhub/osmanagementhub_softwaresource_client.go @@ -0,0 +1,1392 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// SoftwareSourceClient a client for SoftwareSource +type SoftwareSourceClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewSoftwareSourceClientWithConfigurationProvider Creates a new default SoftwareSource client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewSoftwareSourceClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client SoftwareSourceClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newSoftwareSourceClientFromBaseClient(baseClient, provider) +} + +// NewSoftwareSourceClientWithOboToken Creates a new default SoftwareSource 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 NewSoftwareSourceClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client SoftwareSourceClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newSoftwareSourceClientFromBaseClient(baseClient, configProvider) +} + +func newSoftwareSourceClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client SoftwareSourceClient, err error) { + // SoftwareSource service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("SoftwareSource")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = SoftwareSourceClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *SoftwareSourceClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *SoftwareSourceClient) 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 *SoftwareSourceClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ChangeAvailabilityOfSoftwareSources Updates the availability for a list of specified software sources. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ChangeAvailabilityOfSoftwareSources.go.html to see an example of how to use ChangeAvailabilityOfSoftwareSources API. +// A default retry strategy applies to this operation ChangeAvailabilityOfSoftwareSources() +func (client SoftwareSourceClient) ChangeAvailabilityOfSoftwareSources(ctx context.Context, request ChangeAvailabilityOfSoftwareSourcesRequest) (response ChangeAvailabilityOfSoftwareSourcesResponse, 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.changeAvailabilityOfSoftwareSources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeAvailabilityOfSoftwareSourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeAvailabilityOfSoftwareSourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeAvailabilityOfSoftwareSourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeAvailabilityOfSoftwareSourcesResponse") + } + return +} + +// changeAvailabilityOfSoftwareSources implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) changeAvailabilityOfSoftwareSources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/softwareSources/actions/changeAvailability", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeAvailabilityOfSoftwareSourcesResponse + 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, "SoftwareSource", "ChangeAvailabilityOfSoftwareSources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateEntitlement Registers the necessary entitlement credentials for OS vendor software sources. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateEntitlement.go.html to see an example of how to use CreateEntitlement API. +// A default retry strategy applies to this operation CreateEntitlement() +func (client SoftwareSourceClient) CreateEntitlement(ctx context.Context, request CreateEntitlementRequest) (response CreateEntitlementResponse, 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.createEntitlement, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateEntitlementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateEntitlementResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateEntitlementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateEntitlementResponse") + } + return +} + +// createEntitlement implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) createEntitlement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/entitlements", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateEntitlementResponse + 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, "SoftwareSource", "CreateEntitlement", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateSoftwareSource Creates a new versioned or custom software source. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/CreateSoftwareSource.go.html to see an example of how to use CreateSoftwareSource API. +// A default retry strategy applies to this operation CreateSoftwareSource() +func (client SoftwareSourceClient) CreateSoftwareSource(ctx context.Context, request CreateSoftwareSourceRequest) (response CreateSoftwareSourceResponse, 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.createSoftwareSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateSoftwareSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateSoftwareSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateSoftwareSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSoftwareSourceResponse") + } + return +} + +// createSoftwareSource implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) createSoftwareSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/softwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateSoftwareSourceResponse + 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, "SoftwareSource", "CreateSoftwareSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &softwaresource{}) + return response, err +} + +// DeleteSoftwareSource Deletes the specified software source. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/DeleteSoftwareSource.go.html to see an example of how to use DeleteSoftwareSource API. +// A default retry strategy applies to this operation DeleteSoftwareSource() +func (client SoftwareSourceClient) DeleteSoftwareSource(ctx context.Context, request DeleteSoftwareSourceRequest) (response DeleteSoftwareSourceResponse, 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.deleteSoftwareSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteSoftwareSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteSoftwareSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteSoftwareSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSoftwareSourceResponse") + } + return +} + +// deleteSoftwareSource implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) deleteSoftwareSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/softwareSources/{softwareSourceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteSoftwareSourceResponse + 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, "SoftwareSource", "DeleteSoftwareSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetErratum Gets information about the specified erratum by its advisory name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetErratum.go.html to see an example of how to use GetErratum API. +// A default retry strategy applies to this operation GetErratum() +func (client SoftwareSourceClient) GetErratum(ctx context.Context, request GetErratumRequest) (response GetErratumResponse, 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.getErratum, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetErratumResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetErratumResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetErratumResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetErratumResponse") + } + return +} + +// getErratum implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) getErratum(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/errata/{name}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetErratumResponse + 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, "SoftwareSource", "GetErratum", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetModuleStream Gets information about the specified module stream in a software source. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetModuleStream.go.html to see an example of how to use GetModuleStream API. +// A default retry strategy applies to this operation GetModuleStream() +func (client SoftwareSourceClient) GetModuleStream(ctx context.Context, request GetModuleStreamRequest) (response GetModuleStreamResponse, 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.getModuleStream, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetModuleStreamResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetModuleStreamResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetModuleStreamResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetModuleStreamResponse") + } + return +} + +// getModuleStream implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) getModuleStream(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/moduleStreams/{moduleName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetModuleStreamResponse + 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, "SoftwareSource", "GetModuleStream", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetModuleStreamProfile Gets information about the specified module stream profile in a software source. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetModuleStreamProfile.go.html to see an example of how to use GetModuleStreamProfile API. +// A default retry strategy applies to this operation GetModuleStreamProfile() +func (client SoftwareSourceClient) GetModuleStreamProfile(ctx context.Context, request GetModuleStreamProfileRequest) (response GetModuleStreamProfileResponse, 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.getModuleStreamProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetModuleStreamProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetModuleStreamProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetModuleStreamProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetModuleStreamProfileResponse") + } + return +} + +// getModuleStreamProfile implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) getModuleStreamProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/moduleStreamProfiles/{profileName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetModuleStreamProfileResponse + 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, "SoftwareSource", "GetModuleStreamProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPackageGroup Gets information about the specified package group from a software source. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetPackageGroup.go.html to see an example of how to use GetPackageGroup API. +// A default retry strategy applies to this operation GetPackageGroup() +func (client SoftwareSourceClient) GetPackageGroup(ctx context.Context, request GetPackageGroupRequest) (response GetPackageGroupResponse, 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.getPackageGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetPackageGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetPackageGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetPackageGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPackageGroupResponse") + } + return +} + +// getPackageGroup implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) getPackageGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/packageGroups/{packageGroupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetPackageGroupResponse + 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, "SoftwareSource", "GetPackageGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSoftwarePackage Gets information about the specified software package. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetSoftwarePackage.go.html to see an example of how to use GetSoftwarePackage API. +// A default retry strategy applies to this operation GetSoftwarePackage() +func (client SoftwareSourceClient) GetSoftwarePackage(ctx context.Context, request GetSoftwarePackageRequest) (response GetSoftwarePackageResponse, 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.getSoftwarePackage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetSoftwarePackageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetSoftwarePackageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetSoftwarePackageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSoftwarePackageResponse") + } + return +} + +// getSoftwarePackage implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) getSoftwarePackage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/softwarePackages/{softwarePackageName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetSoftwarePackageResponse + 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, "SoftwareSource", "GetSoftwarePackage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSoftwareSource Gets information about the specified software source. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetSoftwareSource.go.html to see an example of how to use GetSoftwareSource API. +// A default retry strategy applies to this operation GetSoftwareSource() +func (client SoftwareSourceClient) GetSoftwareSource(ctx context.Context, request GetSoftwareSourceRequest) (response GetSoftwareSourceResponse, 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.getSoftwareSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetSoftwareSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetSoftwareSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetSoftwareSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSoftwareSourceResponse") + } + return +} + +// getSoftwareSource implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) getSoftwareSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetSoftwareSourceResponse + 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, "SoftwareSource", "GetSoftwareSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &softwaresource{}) + return response, err +} + +// ListEntitlements Lists entitlements in the specified tenancy OCID. Filter the list against a variety of criteria including but +// not limited to its CSI, and vendor name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListEntitlements.go.html to see an example of how to use ListEntitlements API. +// A default retry strategy applies to this operation ListEntitlements() +func (client SoftwareSourceClient) ListEntitlements(ctx context.Context, request ListEntitlementsRequest) (response ListEntitlementsResponse, 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.listEntitlements, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListEntitlementsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListEntitlementsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListEntitlementsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListEntitlementsResponse") + } + return +} + +// listEntitlements implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listEntitlements(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/entitlements", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListEntitlementsResponse + 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, "SoftwareSource", "ListEntitlements", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListErrata Lists all of the currently available errata. Filter the list against a variety of criteria including but not +// limited to its name, classification type, advisory severity, and OS family. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListErrata.go.html to see an example of how to use ListErrata API. +// A default retry strategy applies to this operation ListErrata() +func (client SoftwareSourceClient) ListErrata(ctx context.Context, request ListErrataRequest) (response ListErrataResponse, 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.listErrata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListErrataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListErrataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListErrataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListErrataResponse") + } + return +} + +// listErrata implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listErrata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/errata", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListErrataResponse + 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, "SoftwareSource", "ListErrata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListModuleStreamProfiles Lists module stream profiles from the specified software source OCID. Filter the list against a variety of +// criteria including but not limited to its module name, stream name, and (profile) name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListModuleStreamProfiles.go.html to see an example of how to use ListModuleStreamProfiles API. +// A default retry strategy applies to this operation ListModuleStreamProfiles() +func (client SoftwareSourceClient) ListModuleStreamProfiles(ctx context.Context, request ListModuleStreamProfilesRequest) (response ListModuleStreamProfilesResponse, 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.listModuleStreamProfiles, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListModuleStreamProfilesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListModuleStreamProfilesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListModuleStreamProfilesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListModuleStreamProfilesResponse") + } + return +} + +// listModuleStreamProfiles implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listModuleStreamProfiles(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/moduleStreamProfiles", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListModuleStreamProfilesResponse + 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, "SoftwareSource", "ListModuleStreamProfiles", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListModuleStreams Lists module streams from the specified software source OCID. Filter the list against a variety of +// criteria including but not limited to its module name and (stream) name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListModuleStreams.go.html to see an example of how to use ListModuleStreams API. +// A default retry strategy applies to this operation ListModuleStreams() +func (client SoftwareSourceClient) ListModuleStreams(ctx context.Context, request ListModuleStreamsRequest) (response ListModuleStreamsResponse, 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.listModuleStreams, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListModuleStreamsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListModuleStreamsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListModuleStreamsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListModuleStreamsResponse") + } + return +} + +// listModuleStreams implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listModuleStreams(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/moduleStreams", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListModuleStreamsResponse + 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, "SoftwareSource", "ListModuleStreams", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPackageGroups Lists package groups that associate with the specified software source OCID. Filter the list against a +// variety of criteria including but not limited to its name, and package group type. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListPackageGroups.go.html to see an example of how to use ListPackageGroups API. +// A default retry strategy applies to this operation ListPackageGroups() +func (client SoftwareSourceClient) ListPackageGroups(ctx context.Context, request ListPackageGroupsRequest) (response ListPackageGroupsResponse, 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.listPackageGroups, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListPackageGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListPackageGroupsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListPackageGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPackageGroupsResponse") + } + return +} + +// listPackageGroups implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listPackageGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/packageGroups", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListPackageGroupsResponse + 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, "SoftwareSource", "ListPackageGroups", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSoftwarePackages Lists software packages in the specified software source. Filter the list against a variety of criteria +// including but not limited to its name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListSoftwarePackages.go.html to see an example of how to use ListSoftwarePackages API. +// A default retry strategy applies to this operation ListSoftwarePackages() +func (client SoftwareSourceClient) ListSoftwarePackages(ctx context.Context, request ListSoftwarePackagesRequest) (response ListSoftwarePackagesResponse, 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.listSoftwarePackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListSoftwarePackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListSoftwarePackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListSoftwarePackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSoftwarePackagesResponse") + } + return +} + +// listSoftwarePackages implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listSoftwarePackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources/{softwareSourceId}/softwarePackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListSoftwarePackagesResponse + 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, "SoftwareSource", "ListSoftwarePackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSoftwareSourceVendors Lists available software source vendors. Filter the list against a variety of criteria including but not limited +// to its name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListSoftwareSourceVendors.go.html to see an example of how to use ListSoftwareSourceVendors API. +// A default retry strategy applies to this operation ListSoftwareSourceVendors() +func (client SoftwareSourceClient) ListSoftwareSourceVendors(ctx context.Context, request ListSoftwareSourceVendorsRequest) (response ListSoftwareSourceVendorsResponse, 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.listSoftwareSourceVendors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListSoftwareSourceVendorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListSoftwareSourceVendorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListSoftwareSourceVendorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSoftwareSourceVendorsResponse") + } + return +} + +// listSoftwareSourceVendors implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listSoftwareSourceVendors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSourceVendors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListSoftwareSourceVendorsResponse + 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, "SoftwareSource", "ListSoftwareSourceVendors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSoftwareSources Lists software sources that match the specified tenancy or software source OCID. Filter the list against a +// variety of criteria including but not limited to its name, status, architecture, and OS family. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListSoftwareSources.go.html to see an example of how to use ListSoftwareSources API. +// A default retry strategy applies to this operation ListSoftwareSources() +func (client SoftwareSourceClient) ListSoftwareSources(ctx context.Context, request ListSoftwareSourcesRequest) (response ListSoftwareSourcesResponse, 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.listSoftwareSources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListSoftwareSourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListSoftwareSourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListSoftwareSourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSoftwareSourcesResponse") + } + return +} + +// listSoftwareSources implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) listSoftwareSources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/softwareSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListSoftwareSourcesResponse + 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, "SoftwareSource", "ListSoftwareSources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SearchSoftwareSourceModuleStreams Lists modules from a list of software sources. Filter the list against a variety of +// criteria including the module name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SearchSoftwareSourceModuleStreams.go.html to see an example of how to use SearchSoftwareSourceModuleStreams API. +// A default retry strategy applies to this operation SearchSoftwareSourceModuleStreams() +func (client SoftwareSourceClient) SearchSoftwareSourceModuleStreams(ctx context.Context, request SearchSoftwareSourceModuleStreamsRequest) (response SearchSoftwareSourceModuleStreamsResponse, 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.searchSoftwareSourceModuleStreams, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SearchSoftwareSourceModuleStreamsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SearchSoftwareSourceModuleStreamsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SearchSoftwareSourceModuleStreamsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SearchSoftwareSourceModuleStreamsResponse") + } + return +} + +// searchSoftwareSourceModuleStreams implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) searchSoftwareSourceModuleStreams(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/softwareSourceModuleStreams/actions/search", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SearchSoftwareSourceModuleStreamsResponse + 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, "SoftwareSource", "SearchSoftwareSourceModuleStreams", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SearchSoftwareSourceModules Lists modules from a list of software sources. Filter the list against a variety of +// criteria including the (module) name. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SearchSoftwareSourceModules.go.html to see an example of how to use SearchSoftwareSourceModules API. +// A default retry strategy applies to this operation SearchSoftwareSourceModules() +func (client SoftwareSourceClient) SearchSoftwareSourceModules(ctx context.Context, request SearchSoftwareSourceModulesRequest) (response SearchSoftwareSourceModulesResponse, 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.searchSoftwareSourceModules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SearchSoftwareSourceModulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SearchSoftwareSourceModulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SearchSoftwareSourceModulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SearchSoftwareSourceModulesResponse") + } + return +} + +// searchSoftwareSourceModules implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) searchSoftwareSourceModules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/softwareSourceModules/actions/search", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SearchSoftwareSourceModulesResponse + 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, "SoftwareSource", "SearchSoftwareSourceModules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SearchSoftwareSourcePackageGroups Searches the package groups from the specified list of software sources. Filter the list against a variety of criteria +// including but not limited to its name, and group type. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SearchSoftwareSourcePackageGroups.go.html to see an example of how to use SearchSoftwareSourcePackageGroups API. +// A default retry strategy applies to this operation SearchSoftwareSourcePackageGroups() +func (client SoftwareSourceClient) SearchSoftwareSourcePackageGroups(ctx context.Context, request SearchSoftwareSourcePackageGroupsRequest) (response SearchSoftwareSourcePackageGroupsResponse, 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.searchSoftwareSourcePackageGroups, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SearchSoftwareSourcePackageGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SearchSoftwareSourcePackageGroupsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SearchSoftwareSourcePackageGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SearchSoftwareSourcePackageGroupsResponse") + } + return +} + +// searchSoftwareSourcePackageGroups implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) searchSoftwareSourcePackageGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/softwareSourcePackageGroups/actions/search", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SearchSoftwareSourcePackageGroupsResponse + 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, "SoftwareSource", "SearchSoftwareSourcePackageGroups", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSoftwareSource Updates the specified software source's details, including but not limited to name, description, and tags. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateSoftwareSource.go.html to see an example of how to use UpdateSoftwareSource API. +// A default retry strategy applies to this operation UpdateSoftwareSource() +func (client SoftwareSourceClient) UpdateSoftwareSource(ctx context.Context, request UpdateSoftwareSourceRequest) (response UpdateSoftwareSourceResponse, 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.updateSoftwareSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateSoftwareSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateSoftwareSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSoftwareSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSoftwareSourceResponse") + } + return +} + +// updateSoftwareSource implements the OCIOperation interface (enables retrying operations) +func (client SoftwareSourceClient) updateSoftwareSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/softwareSources/{softwareSourceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateSoftwareSourceResponse + 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, "SoftwareSource", "UpdateSoftwareSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &softwaresource{}) + return response, err +} diff --git a/osmanagementhub/osmanagementhub_workrequest_client.go b/osmanagementhub/osmanagementhub_workrequest_client.go new file mode 100644 index 0000000000..9d3f070999 --- /dev/null +++ b/osmanagementhub/osmanagementhub_workrequest_client.go @@ -0,0 +1,323 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// WorkRequestClient a client for WorkRequest +type WorkRequestClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewWorkRequestClientWithConfigurationProvider Creates a new default WorkRequest client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewWorkRequestClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client WorkRequestClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newWorkRequestClientFromBaseClient(baseClient, provider) +} + +// NewWorkRequestClientWithOboToken Creates a new default WorkRequest client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewWorkRequestClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client WorkRequestClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newWorkRequestClientFromBaseClient(baseClient, configProvider) +} + +func newWorkRequestClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client WorkRequestClient, err error) { + // WorkRequest service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("WorkRequest")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = WorkRequestClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *WorkRequestClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("osmanagementhub", "https://osmh.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *WorkRequestClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *WorkRequestClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetWorkRequest Gets information about the specified work request. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client WorkRequestClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Gets the errors for the specified work request. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client WorkRequestClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Gets the logs for the specified work request. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client WorkRequestClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists work requests that match the specified compartment or work request OCID. Filter the list against +// a variety of criteria including but not limited to its name, status, and operation type. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client WorkRequestClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/osmanagementhub/overall_state.go b/osmanagementhub/overall_state.go new file mode 100644 index 0000000000..901c622284 --- /dev/null +++ b/osmanagementhub/overall_state.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// OverallStateEnum Enum with underlying type: string +type OverallStateEnum string + +// Set of constants representing the allowable values for OverallStateEnum +const ( + OverallStateNormal OverallStateEnum = "NORMAL" + OverallStateRegistrationerror OverallStateEnum = "REGISTRATIONERROR" + OverallStateSyncing OverallStateEnum = "SYNCING" + OverallStateSyncfailed OverallStateEnum = "SYNCFAILED" + OverallStateWarning OverallStateEnum = "WARNING" + OverallStateError OverallStateEnum = "ERROR" + OverallStateUnavailable OverallStateEnum = "UNAVAILABLE" +) + +var mappingOverallStateEnum = map[string]OverallStateEnum{ + "NORMAL": OverallStateNormal, + "REGISTRATIONERROR": OverallStateRegistrationerror, + "SYNCING": OverallStateSyncing, + "SYNCFAILED": OverallStateSyncfailed, + "WARNING": OverallStateWarning, + "ERROR": OverallStateError, + "UNAVAILABLE": OverallStateUnavailable, +} + +var mappingOverallStateEnumLowerCase = map[string]OverallStateEnum{ + "normal": OverallStateNormal, + "registrationerror": OverallStateRegistrationerror, + "syncing": OverallStateSyncing, + "syncfailed": OverallStateSyncfailed, + "warning": OverallStateWarning, + "error": OverallStateError, + "unavailable": OverallStateUnavailable, +} + +// GetOverallStateEnumValues Enumerates the set of values for OverallStateEnum +func GetOverallStateEnumValues() []OverallStateEnum { + values := make([]OverallStateEnum, 0) + for _, v := range mappingOverallStateEnum { + values = append(values, v) + } + return values +} + +// GetOverallStateEnumStringValues Enumerates the set of values in String for OverallStateEnum +func GetOverallStateEnumStringValues() []string { + return []string{ + "NORMAL", + "REGISTRATIONERROR", + "SYNCING", + "SYNCFAILED", + "WARNING", + "ERROR", + "UNAVAILABLE", + } +} + +// GetMappingOverallStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOverallStateEnum(val string) (OverallStateEnum, bool) { + enum, ok := mappingOverallStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/package_filter.go b/osmanagementhub/package_filter.go new file mode 100644 index 0000000000..c117608d66 --- /dev/null +++ b/osmanagementhub/package_filter.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PackageFilter Used to select packages from VendorSoftwareSources to create/update CustomSoftwareSources. +type PackageFilter struct { + + // The type of the filter, which can be of two types - INCLUDE or EXCLUDE. + FilterType FilterTypeEnum `mandatory:"true" json:"filterType"` + + // The package name. + PackageName *string `mandatory:"false" json:"packageName"` + + // The package name pattern. + PackageNamePattern *string `mandatory:"false" json:"packageNamePattern"` + + // The package version, which is denoted by 'version-release', or 'epoch:version-release'. + PackageVersion *string `mandatory:"false" json:"packageVersion"` +} + +func (m PackageFilter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PackageFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingFilterTypeEnum(string(m.FilterType)); !ok && m.FilterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FilterType: %s. Supported values are: %s.", m.FilterType, strings.Join(GetFilterTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/package_group.go b/osmanagementhub/package_group.go new file mode 100644 index 0000000000..98b48020df --- /dev/null +++ b/osmanagementhub/package_group.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PackageGroup Yum/DNF package group, category or environment. +type PackageGroup struct { + + // Package group identifier. + Id *string `mandatory:"true" json:"id"` + + // Package group name. + Name *string `mandatory:"true" json:"name"` + + // The list of packages in the package group. + Packages []string `mandatory:"true" json:"packages"` + + // the IDs of the package group's repositories. + Repositories []string `mandatory:"false" json:"repositories"` + + // description of the package group. + Description *string `mandatory:"false" json:"description"` + + // Indicates if this package group is visible by users. + IsUserVisible *bool `mandatory:"false" json:"isUserVisible"` + + // Indicates if this package group is the default. + IsDefault *bool `mandatory:"false" json:"isDefault"` + + // Indicates if this is a group, category or environment. + GroupType PackageGroupGroupTypeEnum `mandatory:"false" json:"groupType,omitempty"` + + // Indicates the order to display category or environment. + DisplayOrder *int `mandatory:"false" json:"displayOrder"` +} + +func (m PackageGroup) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PackageGroup) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingPackageGroupGroupTypeEnum(string(m.GroupType)); !ok && m.GroupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for GroupType: %s. Supported values are: %s.", m.GroupType, strings.Join(GetPackageGroupGroupTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PackageGroupGroupTypeEnum Enum with underlying type: string +type PackageGroupGroupTypeEnum string + +// Set of constants representing the allowable values for PackageGroupGroupTypeEnum +const ( + PackageGroupGroupTypeGroup PackageGroupGroupTypeEnum = "GROUP" + PackageGroupGroupTypeEnvironment PackageGroupGroupTypeEnum = "ENVIRONMENT" + PackageGroupGroupTypeCategory PackageGroupGroupTypeEnum = "CATEGORY" +) + +var mappingPackageGroupGroupTypeEnum = map[string]PackageGroupGroupTypeEnum{ + "GROUP": PackageGroupGroupTypeGroup, + "ENVIRONMENT": PackageGroupGroupTypeEnvironment, + "CATEGORY": PackageGroupGroupTypeCategory, +} + +var mappingPackageGroupGroupTypeEnumLowerCase = map[string]PackageGroupGroupTypeEnum{ + "group": PackageGroupGroupTypeGroup, + "environment": PackageGroupGroupTypeEnvironment, + "category": PackageGroupGroupTypeCategory, +} + +// GetPackageGroupGroupTypeEnumValues Enumerates the set of values for PackageGroupGroupTypeEnum +func GetPackageGroupGroupTypeEnumValues() []PackageGroupGroupTypeEnum { + values := make([]PackageGroupGroupTypeEnum, 0) + for _, v := range mappingPackageGroupGroupTypeEnum { + values = append(values, v) + } + return values +} + +// GetPackageGroupGroupTypeEnumStringValues Enumerates the set of values in String for PackageGroupGroupTypeEnum +func GetPackageGroupGroupTypeEnumStringValues() []string { + return []string{ + "GROUP", + "ENVIRONMENT", + "CATEGORY", + } +} + +// GetMappingPackageGroupGroupTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPackageGroupGroupTypeEnum(val string) (PackageGroupGroupTypeEnum, bool) { + enum, ok := mappingPackageGroupGroupTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/package_group_collection.go b/osmanagementhub/package_group_collection.go new file mode 100644 index 0000000000..031bf63260 --- /dev/null +++ b/osmanagementhub/package_group_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PackageGroupCollection Results of a package group search. Contains both package group summary items and other information, such as metadata. +type PackageGroupCollection struct { + + // List of package groups. + Items []PackageGroupSummary `mandatory:"true" json:"items"` +} + +func (m PackageGroupCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PackageGroupCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/package_group_filter.go b/osmanagementhub/package_group_filter.go new file mode 100644 index 0000000000..b637c74258 --- /dev/null +++ b/osmanagementhub/package_group_filter.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PackageGroupFilter Used to select groups from VendorSoftwareSources to create/update CustomSoftwareSources. +type PackageGroupFilter struct { + + // The type of the filter, which can be of two types - INCLUDE or EXCLUDE. + FilterType FilterTypeEnum `mandatory:"true" json:"filterType"` + + // List of package group names. + PackageGroups []string `mandatory:"false" json:"packageGroups"` +} + +func (m PackageGroupFilter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PackageGroupFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingFilterTypeEnum(string(m.FilterType)); !ok && m.FilterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FilterType: %s. Supported values are: %s.", m.FilterType, strings.Join(GetFilterTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/package_group_summary.go b/osmanagementhub/package_group_summary.go new file mode 100644 index 0000000000..c661669747 --- /dev/null +++ b/osmanagementhub/package_group_summary.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PackageGroupSummary Yum/DNF package group that associated with a software source. +type PackageGroupSummary struct { + + // Package group identifier. + Id *string `mandatory:"true" json:"id"` + + // Package group name. + Name *string `mandatory:"true" json:"name"` + + // description of the package group. + Description *string `mandatory:"false" json:"description"` + + // Indicates if this package group is visible by users. + IsUserVisible *bool `mandatory:"false" json:"isUserVisible"` + + // Indicates if this package group is the default. + IsDefault *bool `mandatory:"false" json:"isDefault"` + + // the IDs of the package group's repositories. + Repositories []string `mandatory:"false" json:"repositories"` + + // Indicates if this is a group, category or environment. + GroupType PackageGroupGroupTypeEnum `mandatory:"false" json:"groupType,omitempty"` + + // Indicates the order to display category or environment. + DisplayOrder *int `mandatory:"false" json:"displayOrder"` +} + +func (m PackageGroupSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PackageGroupSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingPackageGroupGroupTypeEnum(string(m.GroupType)); !ok && m.GroupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for GroupType: %s. Supported values are: %s.", m.GroupType, strings.Join(GetPackageGroupGroupTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/package_name_summary.go b/osmanagementhub/package_name_summary.go new file mode 100644 index 0000000000..4733b74404 --- /dev/null +++ b/osmanagementhub/package_name_summary.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PackageNameSummary A simple representation of a package using its displayName and NEVRA parts. +type PackageNameSummary struct { + + // Full package NEVRA name - this value should be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The name of the software package. + Name *string `mandatory:"true" json:"name"` + + // Type of the package. + Type *string `mandatory:"false" json:"type"` + + // Version of the installed package. + Version *string `mandatory:"false" json:"version"` + + // The architecture for which this package was built. + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` +} + +func (m PackageNameSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PackageNameSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/package_summary.go b/osmanagementhub/package_summary.go new file mode 100644 index 0000000000..d396917ff7 --- /dev/null +++ b/osmanagementhub/package_summary.go @@ -0,0 +1,195 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PackageSummary A software package summary. +type PackageSummary interface { + + // Package name. + GetDisplayName() *string + + // Unique identifier for the package. + GetName() *string + + // Type of the package. + GetType() *string + + // Version of the installed package. + GetVersion() *string + + // The architecture for which this package was built. + GetArchitecture() ArchTypeEnum + + // list of software sources that provide the software package. + GetSoftwareSources() []SoftwareSourceDetails +} + +type packagesummary struct { + JsonData []byte + DisplayName *string `mandatory:"true" json:"displayName"` + Name *string `mandatory:"true" json:"name"` + Type *string `mandatory:"true" json:"type"` + Version *string `mandatory:"true" json:"version"` + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` + PackageClassification string `json:"packageClassification"` +} + +// UnmarshalJSON unmarshals json +func (m *packagesummary) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerpackagesummary packagesummary + s := struct { + Model Unmarshalerpackagesummary + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DisplayName = s.Model.DisplayName + m.Name = s.Model.Name + m.Type = s.Model.Type + m.Version = s.Model.Version + m.Architecture = s.Model.Architecture + m.SoftwareSources = s.Model.SoftwareSources + m.PackageClassification = s.Model.PackageClassification + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *packagesummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.PackageClassification { + case "AVAILABLE": + mm := AvailablePackageSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "INSTALLED": + mm := InstalledPackageSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "UPDATABLE": + mm := UpdatablePackageSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for PackageSummary: %s.", m.PackageClassification) + return *m, nil + } +} + +//GetDisplayName returns DisplayName +func (m packagesummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetName returns Name +func (m packagesummary) GetName() *string { + return m.Name +} + +//GetType returns Type +func (m packagesummary) GetType() *string { + return m.Type +} + +//GetVersion returns Version +func (m packagesummary) GetVersion() *string { + return m.Version +} + +//GetArchitecture returns Architecture +func (m packagesummary) GetArchitecture() ArchTypeEnum { + return m.Architecture +} + +//GetSoftwareSources returns SoftwareSources +func (m packagesummary) GetSoftwareSources() []SoftwareSourceDetails { + return m.SoftwareSources +} + +func (m packagesummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m packagesummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PackageSummaryPackageClassificationEnum Enum with underlying type: string +type PackageSummaryPackageClassificationEnum string + +// Set of constants representing the allowable values for PackageSummaryPackageClassificationEnum +const ( + PackageSummaryPackageClassificationInstalled PackageSummaryPackageClassificationEnum = "INSTALLED" + PackageSummaryPackageClassificationAvailable PackageSummaryPackageClassificationEnum = "AVAILABLE" + PackageSummaryPackageClassificationUpdatable PackageSummaryPackageClassificationEnum = "UPDATABLE" +) + +var mappingPackageSummaryPackageClassificationEnum = map[string]PackageSummaryPackageClassificationEnum{ + "INSTALLED": PackageSummaryPackageClassificationInstalled, + "AVAILABLE": PackageSummaryPackageClassificationAvailable, + "UPDATABLE": PackageSummaryPackageClassificationUpdatable, +} + +var mappingPackageSummaryPackageClassificationEnumLowerCase = map[string]PackageSummaryPackageClassificationEnum{ + "installed": PackageSummaryPackageClassificationInstalled, + "available": PackageSummaryPackageClassificationAvailable, + "updatable": PackageSummaryPackageClassificationUpdatable, +} + +// GetPackageSummaryPackageClassificationEnumValues Enumerates the set of values for PackageSummaryPackageClassificationEnum +func GetPackageSummaryPackageClassificationEnumValues() []PackageSummaryPackageClassificationEnum { + values := make([]PackageSummaryPackageClassificationEnum, 0) + for _, v := range mappingPackageSummaryPackageClassificationEnum { + values = append(values, v) + } + return values +} + +// GetPackageSummaryPackageClassificationEnumStringValues Enumerates the set of values in String for PackageSummaryPackageClassificationEnum +func GetPackageSummaryPackageClassificationEnumStringValues() []string { + return []string{ + "INSTALLED", + "AVAILABLE", + "UPDATABLE", + } +} + +// GetMappingPackageSummaryPackageClassificationEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPackageSummaryPackageClassificationEnum(val string) (PackageSummaryPackageClassificationEnum, bool) { + enum, ok := mappingPackageSummaryPackageClassificationEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/profile.go b/osmanagementhub/profile.go new file mode 100644 index 0000000000..ab25081f30 --- /dev/null +++ b/osmanagementhub/profile.go @@ -0,0 +1,295 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Profile Description of registration profile. +type Profile interface { + + // The OCID of the profile that is immutable on creation. + GetId() *string + + // The OCID of the tenancy containing the registration profile. + GetCompartmentId() *string + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + GetDisplayName() *string + + // The software source vendor name. + GetVendorName() VendorNameEnum + + // The operating system family. + GetOsFamily() OsFamilyEnum + + // The architecture type. + GetArchType() ArchTypeEnum + + // The description of the registration profile. + GetDescription() *string + + // The OCID of the management station. + GetManagementStationId() *string + + // The time the the registration profile was created. An RFC3339 formatted datetime string. + GetTimeCreated() *common.SDKTime + + // The current state of the registration profile. + GetLifecycleState() ProfileLifecycleStateEnum + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type profile struct { + JsonData []byte + Id *string `mandatory:"true" json:"id"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + DisplayName *string `mandatory:"true" json:"displayName"` + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + Description *string `mandatory:"false" json:"description"` + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + LifecycleState ProfileLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + 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"` + ProfileType string `json:"profileType"` +} + +// UnmarshalJSON unmarshals json +func (m *profile) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerprofile profile + s := struct { + Model Unmarshalerprofile + }{} + 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.VendorName = s.Model.VendorName + m.OsFamily = s.Model.OsFamily + m.ArchType = s.Model.ArchType + m.Description = s.Model.Description + m.ManagementStationId = s.Model.ManagementStationId + m.TimeCreated = s.Model.TimeCreated + m.LifecycleState = s.Model.LifecycleState + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.ProfileType = s.Model.ProfileType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *profile) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ProfileType { + case "LIFECYCLE": + mm := LifecycleProfile{} + err = json.Unmarshal(data, &mm) + return mm, err + case "SOFTWARESOURCE": + mm := SoftwareSourceProfile{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GROUP": + mm := GroupProfile{} + err = json.Unmarshal(data, &mm) + return mm, err + case "STATION": + mm := StationProfile{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for Profile: %s.", m.ProfileType) + return *m, nil + } +} + +//GetId returns Id +func (m profile) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m profile) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m profile) GetDisplayName() *string { + return m.DisplayName +} + +//GetVendorName returns VendorName +func (m profile) GetVendorName() VendorNameEnum { + return m.VendorName +} + +//GetOsFamily returns OsFamily +func (m profile) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m profile) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetDescription returns Description +func (m profile) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m profile) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetTimeCreated returns TimeCreated +func (m profile) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m profile) GetLifecycleState() ProfileLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m profile) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m profile) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m profile) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m profile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m profile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingProfileLifecycleStateEnum(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(GetProfileLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ProfileLifecycleStateEnum Enum with underlying type: string +type ProfileLifecycleStateEnum string + +// Set of constants representing the allowable values for ProfileLifecycleStateEnum +const ( + ProfileLifecycleStateCreating ProfileLifecycleStateEnum = "CREATING" + ProfileLifecycleStateUpdating ProfileLifecycleStateEnum = "UPDATING" + ProfileLifecycleStateActive ProfileLifecycleStateEnum = "ACTIVE" + ProfileLifecycleStateDeleting ProfileLifecycleStateEnum = "DELETING" + ProfileLifecycleStateDeleted ProfileLifecycleStateEnum = "DELETED" + ProfileLifecycleStateFailed ProfileLifecycleStateEnum = "FAILED" +) + +var mappingProfileLifecycleStateEnum = map[string]ProfileLifecycleStateEnum{ + "CREATING": ProfileLifecycleStateCreating, + "UPDATING": ProfileLifecycleStateUpdating, + "ACTIVE": ProfileLifecycleStateActive, + "DELETING": ProfileLifecycleStateDeleting, + "DELETED": ProfileLifecycleStateDeleted, + "FAILED": ProfileLifecycleStateFailed, +} + +var mappingProfileLifecycleStateEnumLowerCase = map[string]ProfileLifecycleStateEnum{ + "creating": ProfileLifecycleStateCreating, + "updating": ProfileLifecycleStateUpdating, + "active": ProfileLifecycleStateActive, + "deleting": ProfileLifecycleStateDeleting, + "deleted": ProfileLifecycleStateDeleted, + "failed": ProfileLifecycleStateFailed, +} + +// GetProfileLifecycleStateEnumValues Enumerates the set of values for ProfileLifecycleStateEnum +func GetProfileLifecycleStateEnumValues() []ProfileLifecycleStateEnum { + values := make([]ProfileLifecycleStateEnum, 0) + for _, v := range mappingProfileLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetProfileLifecycleStateEnumStringValues Enumerates the set of values in String for ProfileLifecycleStateEnum +func GetProfileLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingProfileLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingProfileLifecycleStateEnum(val string) (ProfileLifecycleStateEnum, bool) { + enum, ok := mappingProfileLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/profile_collection.go b/osmanagementhub/profile_collection.go new file mode 100644 index 0000000000..29c319024c --- /dev/null +++ b/osmanagementhub/profile_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProfileCollection Results of a registration profile search. Contains both registration profile summary items and other data. +type ProfileCollection struct { + + // List of registration profiles. + Items []ProfileSummary `mandatory:"true" json:"items"` +} + +func (m ProfileCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ProfileCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/profile_summary.go b/osmanagementhub/profile_summary.go new file mode 100644 index 0000000000..5b71aa2b87 --- /dev/null +++ b/osmanagementhub/profile_summary.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProfileSummary Summary of the registration profile. +type ProfileSummary struct { + + // The OCID of the profile that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // The type of registration profile. Either SOFTWARESOURCE, GROUP or LIFECYCLE. + ProfileType ProfileTypeEnum `mandatory:"false" json:"profileType,omitempty"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"false" json:"vendorName,omitempty"` + + // The operating system family. + OsFamily OsFamilyEnum `mandatory:"false" json:"osFamily,omitempty"` + + // The architecture type. + ArchType ArchTypeEnum `mandatory:"false" json:"archType,omitempty"` + + // The time the the Onboarding was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The current state of the registration profile. + LifecycleState ProfileLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ProfileSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ProfileSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingProfileTypeEnum(string(m.ProfileType)); !ok && m.ProfileType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ProfileType: %s. Supported values are: %s.", m.ProfileType, strings.Join(GetProfileTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingProfileLifecycleStateEnum(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(GetProfileLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/profile_type.go b/osmanagementhub/profile_type.go new file mode 100644 index 0000000000..862650aaa1 --- /dev/null +++ b/osmanagementhub/profile_type.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ProfileTypeEnum Enum with underlying type: string +type ProfileTypeEnum string + +// Set of constants representing the allowable values for ProfileTypeEnum +const ( + ProfileTypeSoftwaresource ProfileTypeEnum = "SOFTWARESOURCE" + ProfileTypeGroup ProfileTypeEnum = "GROUP" + ProfileTypeLifecycle ProfileTypeEnum = "LIFECYCLE" + ProfileTypeStation ProfileTypeEnum = "STATION" +) + +var mappingProfileTypeEnum = map[string]ProfileTypeEnum{ + "SOFTWARESOURCE": ProfileTypeSoftwaresource, + "GROUP": ProfileTypeGroup, + "LIFECYCLE": ProfileTypeLifecycle, + "STATION": ProfileTypeStation, +} + +var mappingProfileTypeEnumLowerCase = map[string]ProfileTypeEnum{ + "softwaresource": ProfileTypeSoftwaresource, + "group": ProfileTypeGroup, + "lifecycle": ProfileTypeLifecycle, + "station": ProfileTypeStation, +} + +// GetProfileTypeEnumValues Enumerates the set of values for ProfileTypeEnum +func GetProfileTypeEnumValues() []ProfileTypeEnum { + values := make([]ProfileTypeEnum, 0) + for _, v := range mappingProfileTypeEnum { + values = append(values, v) + } + return values +} + +// GetProfileTypeEnumStringValues Enumerates the set of values in String for ProfileTypeEnum +func GetProfileTypeEnumStringValues() []string { + return []string{ + "SOFTWARESOURCE", + "GROUP", + "LIFECYCLE", + "STATION", + } +} + +// GetMappingProfileTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingProfileTypeEnum(val string) (ProfileTypeEnum, bool) { + enum, ok := mappingProfileTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/promote_software_source_to_lifecycle_stage_details.go b/osmanagementhub/promote_software_source_to_lifecycle_stage_details.go new file mode 100644 index 0000000000..79a0719a73 --- /dev/null +++ b/osmanagementhub/promote_software_source_to_lifecycle_stage_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PromoteSoftwareSourceToLifecycleStageDetails A versioned custom software source OCID (softwareSourceId) +// is required when promoting software source content to +// lifecycle stage rank one. Software source content must be +// promoted to lifecycle stage rank one before being +// eligible for promotion to subsequent lifecycle stages, +// else an error is returned. Software source content is +// expected to be promoted in order starting with +// lifecycle stage rank one, followed by rank two, then rank +// three and so on. +// When promoting software source content to lifecycle stage +// rank two, three, four or five, softwareSourceId is optional. +// If a softwareSourceId is provided for a lifecycle stage +// between two and five, the system validates that the +// softwareSourceId is already promoted to the previous lifecycle stage. +// If the softwareSourceId from the previous lifecycle stage +// does not match the provided softwareSourceId an error returns. +// If a softwareSourceId is not provided for a lifecycle stage +// between two and five, the system promotes the +// softwareSourceId from the previous lifecycle stage. If the +// previous lifecycle stage has no SourceSource content +// an error returns. +type PromoteSoftwareSourceToLifecycleStageDetails struct { + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m PromoteSoftwareSourceToLifecycleStageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PromoteSoftwareSourceToLifecycleStageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/promote_software_source_to_lifecycle_stage_request_response.go b/osmanagementhub/promote_software_source_to_lifecycle_stage_request_response.go new file mode 100644 index 0000000000..5794b3f24a --- /dev/null +++ b/osmanagementhub/promote_software_source_to_lifecycle_stage_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PromoteSoftwareSourceToLifecycleStageRequest wrapper for the PromoteSoftwareSourceToLifecycleStage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/PromoteSoftwareSourceToLifecycleStage.go.html to see an example of how to use PromoteSoftwareSourceToLifecycleStageRequest. +type PromoteSoftwareSourceToLifecycleStageRequest struct { + + // The OCID of the lifecycle stage. + LifecycleStageId *string `mandatory:"true" contributesTo:"path" name:"lifecycleStageId"` + + // Details for the software source promotion job. + PromoteSoftwareSourceToLifecycleStageDetails `contributesTo:"body"` + + // The OCID for the software source. + SoftwareSourceId *string `mandatory:"false" contributesTo:"query" name:"softwareSourceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 PromoteSoftwareSourceToLifecycleStageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PromoteSoftwareSourceToLifecycleStageRequest) 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 PromoteSoftwareSourceToLifecycleStageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PromoteSoftwareSourceToLifecycleStageRequest) 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 PromoteSoftwareSourceToLifecycleStageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PromoteSoftwareSourceToLifecycleStageResponse wrapper for the PromoteSoftwareSourceToLifecycleStage operation +type PromoteSoftwareSourceToLifecycleStageResponse 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 PromoteSoftwareSourceToLifecycleStageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PromoteSoftwareSourceToLifecycleStageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/proxy_configuration.go b/osmanagementhub/proxy_configuration.go new file mode 100644 index 0000000000..e96bf83948 --- /dev/null +++ b/osmanagementhub/proxy_configuration.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProxyConfiguration Information for a proxy configuration +type ProxyConfiguration struct { + + // To enable or disable the proxy (default true) + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // List of hosts + Hosts []string `mandatory:"false" json:"hosts"` + + // Port that the proxy will use + Port *string `mandatory:"false" json:"port"` + + // URL that the proxy will forward to + Forward *string `mandatory:"false" json:"forward"` +} + +func (m ProxyConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ProxyConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/refresh_software_on_managed_instance_request_response.go b/osmanagementhub/refresh_software_on_managed_instance_request_response.go new file mode 100644 index 0000000000..84396c4c00 --- /dev/null +++ b/osmanagementhub/refresh_software_on_managed_instance_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RefreshSoftwareOnManagedInstanceRequest wrapper for the RefreshSoftwareOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RefreshSoftwareOnManagedInstance.go.html to see an example of how to use RefreshSoftwareOnManagedInstanceRequest. +type RefreshSoftwareOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RefreshSoftwareOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RefreshSoftwareOnManagedInstanceRequest) 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 RefreshSoftwareOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RefreshSoftwareOnManagedInstanceRequest) 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 RefreshSoftwareOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RefreshSoftwareOnManagedInstanceResponse wrapper for the RefreshSoftwareOnManagedInstance operation +type RefreshSoftwareOnManagedInstanceResponse 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 RefreshSoftwareOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RefreshSoftwareOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/remove_module_stream_profile_from_managed_instance_details.go b/osmanagementhub/remove_module_stream_profile_from_managed_instance_details.go new file mode 100644 index 0000000000..016d5fb26f --- /dev/null +++ b/osmanagementhub/remove_module_stream_profile_from_managed_instance_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveModuleStreamProfileFromManagedInstanceDetails The details of the module stream profile to be removed on a managed instance. +type RemoveModuleStreamProfileFromManagedInstanceDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + // The name of a profile of the specified module stream. + ProfileName *string `mandatory:"false" json:"profileName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m RemoveModuleStreamProfileFromManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RemoveModuleStreamProfileFromManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/remove_module_stream_profile_from_managed_instance_group_details.go b/osmanagementhub/remove_module_stream_profile_from_managed_instance_group_details.go new file mode 100644 index 0000000000..a9138a0d3e --- /dev/null +++ b/osmanagementhub/remove_module_stream_profile_from_managed_instance_group_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveModuleStreamProfileFromManagedInstanceGroupDetails The work request details for the module stream profile operation on the managed instance group. +type RemoveModuleStreamProfileFromManagedInstanceGroupDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"false" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"false" json:"streamName"` + + // The name of a profile of the specified module stream. + ProfileName *string `mandatory:"false" json:"profileName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m RemoveModuleStreamProfileFromManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RemoveModuleStreamProfileFromManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/remove_module_stream_profile_from_managed_instance_group_request_response.go b/osmanagementhub/remove_module_stream_profile_from_managed_instance_group_request_response.go new file mode 100644 index 0000000000..189c6a8ec0 --- /dev/null +++ b/osmanagementhub/remove_module_stream_profile_from_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveModuleStreamProfileFromManagedInstanceGroupRequest wrapper for the RemoveModuleStreamProfileFromManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemoveModuleStreamProfileFromManagedInstanceGroup.go.html to see an example of how to use RemoveModuleStreamProfileFromManagedInstanceGroupRequest. +type RemoveModuleStreamProfileFromManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for profiles to remove from the managed instance group. + RemoveModuleStreamProfileFromManagedInstanceGroupDetails `contributesTo:"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 `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 RemoveModuleStreamProfileFromManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveModuleStreamProfileFromManagedInstanceGroupRequest) 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 RemoveModuleStreamProfileFromManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveModuleStreamProfileFromManagedInstanceGroupRequest) 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 RemoveModuleStreamProfileFromManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveModuleStreamProfileFromManagedInstanceGroupResponse wrapper for the RemoveModuleStreamProfileFromManagedInstanceGroup operation +type RemoveModuleStreamProfileFromManagedInstanceGroupResponse 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 RemoveModuleStreamProfileFromManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveModuleStreamProfileFromManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/remove_module_stream_profile_from_managed_instance_request_response.go b/osmanagementhub/remove_module_stream_profile_from_managed_instance_request_response.go new file mode 100644 index 0000000000..928f876898 --- /dev/null +++ b/osmanagementhub/remove_module_stream_profile_from_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveModuleStreamProfileFromManagedInstanceRequest wrapper for the RemoveModuleStreamProfileFromManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemoveModuleStreamProfileFromManagedInstance.go.html to see an example of how to use RemoveModuleStreamProfileFromManagedInstanceRequest. +type RemoveModuleStreamProfileFromManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // The details of the module stream profile to be removed from a managed instance. + RemoveModuleStreamProfileFromManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveModuleStreamProfileFromManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveModuleStreamProfileFromManagedInstanceRequest) 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 RemoveModuleStreamProfileFromManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveModuleStreamProfileFromManagedInstanceRequest) 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 RemoveModuleStreamProfileFromManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveModuleStreamProfileFromManagedInstanceResponse wrapper for the RemoveModuleStreamProfileFromManagedInstance operation +type RemoveModuleStreamProfileFromManagedInstanceResponse 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 RemoveModuleStreamProfileFromManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveModuleStreamProfileFromManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/remove_packages_from_managed_instance_details.go b/osmanagementhub/remove_packages_from_managed_instance_details.go new file mode 100644 index 0000000000..776039d3c1 --- /dev/null +++ b/osmanagementhub/remove_packages_from_managed_instance_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemovePackagesFromManagedInstanceDetails The details about the software packages to be removed. +type RemovePackagesFromManagedInstanceDetails struct { + + // The list of package names. + PackageNames []string `mandatory:"true" json:"packageNames"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m RemovePackagesFromManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RemovePackagesFromManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/remove_packages_from_managed_instance_group_details.go b/osmanagementhub/remove_packages_from_managed_instance_group_details.go new file mode 100644 index 0000000000..8aa309d112 --- /dev/null +++ b/osmanagementhub/remove_packages_from_managed_instance_group_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemovePackagesFromManagedInstanceGroupDetails The names of the packages to be removed from the managed instance group. +type RemovePackagesFromManagedInstanceGroupDetails struct { + + // The list of package names. + PackageNames []string `mandatory:"false" json:"packageNames"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m RemovePackagesFromManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RemovePackagesFromManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/remove_packages_from_managed_instance_group_request_response.go b/osmanagementhub/remove_packages_from_managed_instance_group_request_response.go new file mode 100644 index 0000000000..7247529898 --- /dev/null +++ b/osmanagementhub/remove_packages_from_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemovePackagesFromManagedInstanceGroupRequest wrapper for the RemovePackagesFromManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemovePackagesFromManagedInstanceGroup.go.html to see an example of how to use RemovePackagesFromManagedInstanceGroupRequest. +type RemovePackagesFromManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for packages to remove from the managed instance group. + RemovePackagesFromManagedInstanceGroupDetails `contributesTo:"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 `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 RemovePackagesFromManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemovePackagesFromManagedInstanceGroupRequest) 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 RemovePackagesFromManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemovePackagesFromManagedInstanceGroupRequest) 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 RemovePackagesFromManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemovePackagesFromManagedInstanceGroupResponse wrapper for the RemovePackagesFromManagedInstanceGroup operation +type RemovePackagesFromManagedInstanceGroupResponse 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 RemovePackagesFromManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemovePackagesFromManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/remove_packages_from_managed_instance_request_response.go b/osmanagementhub/remove_packages_from_managed_instance_request_response.go new file mode 100644 index 0000000000..eda44af70e --- /dev/null +++ b/osmanagementhub/remove_packages_from_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemovePackagesFromManagedInstanceRequest wrapper for the RemovePackagesFromManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RemovePackagesFromManagedInstance.go.html to see an example of how to use RemovePackagesFromManagedInstanceRequest. +type RemovePackagesFromManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // Details about packages to be removed on a managed instance. + RemovePackagesFromManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemovePackagesFromManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemovePackagesFromManagedInstanceRequest) 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 RemovePackagesFromManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemovePackagesFromManagedInstanceRequest) 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 RemovePackagesFromManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemovePackagesFromManagedInstanceResponse wrapper for the RemovePackagesFromManagedInstance operation +type RemovePackagesFromManagedInstanceResponse 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 RemovePackagesFromManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemovePackagesFromManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/run_scheduled_job_now_request_response.go b/osmanagementhub/run_scheduled_job_now_request_response.go new file mode 100644 index 0000000000..0934a0de8b --- /dev/null +++ b/osmanagementhub/run_scheduled_job_now_request_response.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RunScheduledJobNowRequest wrapper for the RunScheduledJobNow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/RunScheduledJobNow.go.html to see an example of how to use RunScheduledJobNowRequest. +type RunScheduledJobNowRequest struct { + + // The OCID of the scheduled job. + ScheduledJobId *string `mandatory:"true" contributesTo:"path" name:"scheduledJobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 RunScheduledJobNowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RunScheduledJobNowRequest) 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 RunScheduledJobNowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RunScheduledJobNowRequest) 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 RunScheduledJobNowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RunScheduledJobNowResponse wrapper for the RunScheduledJobNow operation +type RunScheduledJobNowResponse 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 RunScheduledJobNowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RunScheduledJobNowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/schedule_types.go b/osmanagementhub/schedule_types.go new file mode 100644 index 0000000000..0440f85e89 --- /dev/null +++ b/osmanagementhub/schedule_types.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// ScheduleTypesEnum Enum with underlying type: string +type ScheduleTypesEnum string + +// Set of constants representing the allowable values for ScheduleTypesEnum +const ( + ScheduleTypesOnetime ScheduleTypesEnum = "ONETIME" + ScheduleTypesRecurring ScheduleTypesEnum = "RECURRING" +) + +var mappingScheduleTypesEnum = map[string]ScheduleTypesEnum{ + "ONETIME": ScheduleTypesOnetime, + "RECURRING": ScheduleTypesRecurring, +} + +var mappingScheduleTypesEnumLowerCase = map[string]ScheduleTypesEnum{ + "onetime": ScheduleTypesOnetime, + "recurring": ScheduleTypesRecurring, +} + +// GetScheduleTypesEnumValues Enumerates the set of values for ScheduleTypesEnum +func GetScheduleTypesEnumValues() []ScheduleTypesEnum { + values := make([]ScheduleTypesEnum, 0) + for _, v := range mappingScheduleTypesEnum { + values = append(values, v) + } + return values +} + +// GetScheduleTypesEnumStringValues Enumerates the set of values in String for ScheduleTypesEnum +func GetScheduleTypesEnumStringValues() []string { + return []string{ + "ONETIME", + "RECURRING", + } +} + +// GetMappingScheduleTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduleTypesEnum(val string) (ScheduleTypesEnum, bool) { + enum, ok := mappingScheduleTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/scheduled_job.go b/osmanagementhub/scheduled_job.go new file mode 100644 index 0000000000..2e0a982930 --- /dev/null +++ b/osmanagementhub/scheduled_job.go @@ -0,0 +1,176 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduledJob Detailed information about a scheduled job. +type ScheduledJob struct { + + // The OCID of the scheduled job. + Id *string `mandatory:"true" json:"id"` + + // Scheduled job name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the compartment containing the scheduled job. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The type of scheduling this scheduled job follows. + ScheduleType ScheduleTypesEnum `mandatory:"true" json:"scheduleType"` + + // The time of the next execution of this scheduled job. + TimeNextExecution *common.SDKTime `mandatory:"true" json:"timeNextExecution"` + + // The list of operations this scheduled job needs to perform (can only support one operation if the operationType is not UPDATE_PACKAGES/UPDATE_ALL/UPDATE_SECURITY/UPDATE_BUGFIX/UPDATE_ENHANCEMENT/UPDATE_OTHER/UPDATE_KSPLICE_USERSPACE/UPDATE_KSPLICE_KERNEL). + Operations []ScheduledJobOperation `mandatory:"true" json:"operations"` + + // The time this scheduled job was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time this scheduled job was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The current state of the scheduled job. + LifecycleState ScheduledJobLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // Details describing the scheduled job. + Description *string `mandatory:"false" json:"description"` + + // The time of the last execution of this scheduled job. + TimeLastExecution *common.SDKTime `mandatory:"false" json:"timeLastExecution"` + + // The recurring rule for a RECURRING scheduled job. + RecurringRule *string `mandatory:"false" json:"recurringRule"` + + // The list of managed instance OCIDs this scheduled job operates on (mutually exclusive with managedInstanceGroupIds, managedCompartmentIds and lifecycleStageIds). + ManagedInstanceIds []string `mandatory:"false" json:"managedInstanceIds"` + + // The list of managed instance group OCIDs this scheduled job operates on (mutually exclusive with managedInstances, managedCompartmentIds and lifecycleStageIds). + ManagedInstanceGroupIds []string `mandatory:"false" json:"managedInstanceGroupIds"` + + // The list of target compartment OCIDs if this scheduled job operates on a compartment level (mutually exclusive with managedInstances, managedInstanceGroupIds and lifecycleStageIds). + ManagedCompartmentIds []string `mandatory:"false" json:"managedCompartmentIds"` + + // The list of target lifecycle stage OCIDs if this scheduled job operates on lifecycle stages (mutually exclusive with managedInstances, managedInstanceGroupIds and managedCompartmentIds). + LifecycleStageIds []string `mandatory:"false" json:"lifecycleStageIds"` + + // Whether to create jobs for all compartments in the tenancy when managedCompartmentIds specifies the tenancy OCID. + IsSubcompartmentIncluded *bool `mandatory:"false" json:"isSubcompartmentIncluded"` + + // The list of work request OCIDs associated with this scheduled job. + WorkRequestIds []string `mandatory:"false" json:"workRequestIds"` + + // 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"` + + // true, if the schedule job has its update/deletion capabilities restricted. (Used to track scheduled job for management station syncing). + IsRestricted *bool `mandatory:"false" json:"isRestricted"` +} + +func (m ScheduledJob) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduledJob) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduleTypesEnum(string(m.ScheduleType)); !ok && m.ScheduleType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduleType: %s. Supported values are: %s.", m.ScheduleType, strings.Join(GetScheduleTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduledJobLifecycleStateEnum(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(GetScheduledJobLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScheduledJobLifecycleStateEnum Enum with underlying type: string +type ScheduledJobLifecycleStateEnum string + +// Set of constants representing the allowable values for ScheduledJobLifecycleStateEnum +const ( + ScheduledJobLifecycleStateCreating ScheduledJobLifecycleStateEnum = "CREATING" + ScheduledJobLifecycleStateUpdating ScheduledJobLifecycleStateEnum = "UPDATING" + ScheduledJobLifecycleStateActive ScheduledJobLifecycleStateEnum = "ACTIVE" + ScheduledJobLifecycleStateInactive ScheduledJobLifecycleStateEnum = "INACTIVE" + ScheduledJobLifecycleStateDeleting ScheduledJobLifecycleStateEnum = "DELETING" + ScheduledJobLifecycleStateDeleted ScheduledJobLifecycleStateEnum = "DELETED" + ScheduledJobLifecycleStateFailed ScheduledJobLifecycleStateEnum = "FAILED" +) + +var mappingScheduledJobLifecycleStateEnum = map[string]ScheduledJobLifecycleStateEnum{ + "CREATING": ScheduledJobLifecycleStateCreating, + "UPDATING": ScheduledJobLifecycleStateUpdating, + "ACTIVE": ScheduledJobLifecycleStateActive, + "INACTIVE": ScheduledJobLifecycleStateInactive, + "DELETING": ScheduledJobLifecycleStateDeleting, + "DELETED": ScheduledJobLifecycleStateDeleted, + "FAILED": ScheduledJobLifecycleStateFailed, +} + +var mappingScheduledJobLifecycleStateEnumLowerCase = map[string]ScheduledJobLifecycleStateEnum{ + "creating": ScheduledJobLifecycleStateCreating, + "updating": ScheduledJobLifecycleStateUpdating, + "active": ScheduledJobLifecycleStateActive, + "inactive": ScheduledJobLifecycleStateInactive, + "deleting": ScheduledJobLifecycleStateDeleting, + "deleted": ScheduledJobLifecycleStateDeleted, + "failed": ScheduledJobLifecycleStateFailed, +} + +// GetScheduledJobLifecycleStateEnumValues Enumerates the set of values for ScheduledJobLifecycleStateEnum +func GetScheduledJobLifecycleStateEnumValues() []ScheduledJobLifecycleStateEnum { + values := make([]ScheduledJobLifecycleStateEnum, 0) + for _, v := range mappingScheduledJobLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetScheduledJobLifecycleStateEnumStringValues Enumerates the set of values in String for ScheduledJobLifecycleStateEnum +func GetScheduledJobLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "INACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingScheduledJobLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduledJobLifecycleStateEnum(val string) (ScheduledJobLifecycleStateEnum, bool) { + enum, ok := mappingScheduledJobLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/scheduled_job_collection.go b/osmanagementhub/scheduled_job_collection.go new file mode 100644 index 0000000000..9aef36a4e0 --- /dev/null +++ b/osmanagementhub/scheduled_job_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduledJobCollection Results of a scheduled job search. Contains boh ScheduledJobSummary items and other information, such as metadata. +type ScheduledJobCollection struct { + + // List of scheduled jobs. + Items []ScheduledJobSummary `mandatory:"true" json:"items"` +} + +func (m ScheduledJobCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduledJobCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/scheduled_job_operation.go b/osmanagementhub/scheduled_job_operation.go new file mode 100644 index 0000000000..68003e2247 --- /dev/null +++ b/osmanagementhub/scheduled_job_operation.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduledJobOperation Defines an operation in a scheduled job. +type ScheduledJobOperation struct { + + // The type of operation this scheduled job performs. + OperationType OperationTypesEnum `mandatory:"true" json:"operationType"` + + // The names of the target packages (only if operation type is INSTALL_PACKAGES/UPDATE_PACKAGES/REMOVE_PACKAGES). + PackageNames []string `mandatory:"false" json:"packageNames"` + + ManageModuleStreamsDetails *ManageModuleStreamsInScheduledJobDetails `mandatory:"false" json:"manageModuleStreamsDetails"` + + SwitchModuleStreamsDetails *ModuleStreamDetails `mandatory:"false" json:"switchModuleStreamsDetails"` + + // The OCIDs for the software sources (only if operation type is ATTACH_SOFTWARE_SOURCES/DETACH_SOFTWARE_SOURCES). + SoftwareSourceIds []string `mandatory:"false" json:"softwareSourceIds"` +} + +func (m ScheduledJobOperation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduledJobOperation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypesEnum(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(GetOperationTypesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/scheduled_job_summary.go b/osmanagementhub/scheduled_job_summary.go new file mode 100644 index 0000000000..e96be082ce --- /dev/null +++ b/osmanagementhub/scheduled_job_summary.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduledJobSummary Summary of the scheduled job. +type ScheduledJobSummary struct { + + // The OCID of the scheduled job. + Id *string `mandatory:"true" json:"id"` + + // Scheduled job name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the compartment containing the scheduled job. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The type of scheduling this scheduled job follows. + ScheduleType ScheduleTypesEnum `mandatory:"true" json:"scheduleType"` + + // The time this scheduled job was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time this scheduled job was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The time/date of the next scheduled execution of this scheduled job. + TimeNextExecution *common.SDKTime `mandatory:"true" json:"timeNextExecution"` + + // The list of operations this scheduled job needs to perform (can only support one operation if the operationType is not UPDATE_PACKAGES/UPDATE_ALL/UPDATE_SECURITY/UPDATE_BUGFIX/UPDATE_ENHANCEMENT/UPDATE_OTHER/UPDATE_KSPLICE_USERSPACE/UPDATE_KSPLICE_KERNEL). + Operations []ScheduledJobOperation `mandatory:"true" json:"operations"` + + // The current state of the scheduled job. + LifecycleState ScheduledJobLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The time/date of the last execution of this scheduled job. + TimeLastExecution *common.SDKTime `mandatory:"false" json:"timeLastExecution"` + + // The list of managed instance OCIDs this scheduled job operates on (mutually exclusive with managedInstanceGroupIds, managedCompartmentIds and lifecycleStageIds). + ManagedInstanceIds []string `mandatory:"false" json:"managedInstanceIds"` + + // The list of managed instance group OCIDs this scheduled job operates on (mutually exclusive with managedInstances, managedCompartmentIds and lifecycleStageIds). + ManagedInstanceGroupIds []string `mandatory:"false" json:"managedInstanceGroupIds"` + + // The list of target compartment OCIDs if this scheduled job operates on a compartment level (mutually exclusive with managedInstances, managedInstanceGroupIds and lifecycleStageIds). + ManagedCompartmentIds []string `mandatory:"false" json:"managedCompartmentIds"` + + // The list of target lifecycle stage OCIDs if this scheduled job operates on lifecycle stages (mutually exclusive with managedInstances, managedInstanceGroupIds and managedCompartmentIds). + LifecycleStageIds []string `mandatory:"false" json:"lifecycleStageIds"` + + // true, if the schedule job has its update/deletion capabilities restricted. (Used to track scheduled job for management station syncing). + IsRestricted *bool `mandatory:"false" json:"isRestricted"` + + // 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 ScheduledJobSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduledJobSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduleTypesEnum(string(m.ScheduleType)); !ok && m.ScheduleType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduleType: %s. Supported values are: %s.", m.ScheduleType, strings.Join(GetScheduleTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduledJobLifecycleStateEnum(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(GetScheduledJobLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/search_software_source_module_streams_details.go b/osmanagementhub/search_software_source_module_streams_details.go new file mode 100644 index 0000000000..b9b48a913f --- /dev/null +++ b/osmanagementhub/search_software_source_module_streams_details.go @@ -0,0 +1,135 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SearchSoftwareSourceModuleStreamsDetails Contains a list of software sources to get the combined list of module streams from all of those software sources. +type SearchSoftwareSourceModuleStreamsDetails struct { + + // List of software source OCIDs. + SoftwareSourceIds []string `mandatory:"true" json:"softwareSourceIds"` + + // The sort order. + SortOrder SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` + + // The name of a module. + ModuleName *string `mandatory:"false" json:"moduleName"` + + // The field to sort by. + SortBy SearchSoftwareSourceModuleStreamsDetailsSortByEnum `mandatory:"false" json:"sortBy,omitempty"` +} + +func (m SearchSoftwareSourceModuleStreamsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SearchSoftwareSourceModuleStreamsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSearchSoftwareSourceModuleStreamsDetailsSortOrderEnum(string(m.SortOrder)); !ok && m.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", m.SortOrder, strings.Join(GetSearchSoftwareSourceModuleStreamsDetailsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSearchSoftwareSourceModuleStreamsDetailsSortByEnum(string(m.SortBy)); !ok && m.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", m.SortBy, strings.Join(GetSearchSoftwareSourceModuleStreamsDetailsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum Enum with underlying type: string +type SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum string + +// Set of constants representing the allowable values for SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum +const ( + SearchSoftwareSourceModuleStreamsDetailsSortOrderAsc SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum = "ASC" + SearchSoftwareSourceModuleStreamsDetailsSortOrderDesc SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum = "DESC" +) + +var mappingSearchSoftwareSourceModuleStreamsDetailsSortOrderEnum = map[string]SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum{ + "ASC": SearchSoftwareSourceModuleStreamsDetailsSortOrderAsc, + "DESC": SearchSoftwareSourceModuleStreamsDetailsSortOrderDesc, +} + +var mappingSearchSoftwareSourceModuleStreamsDetailsSortOrderEnumLowerCase = map[string]SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum{ + "asc": SearchSoftwareSourceModuleStreamsDetailsSortOrderAsc, + "desc": SearchSoftwareSourceModuleStreamsDetailsSortOrderDesc, +} + +// GetSearchSoftwareSourceModuleStreamsDetailsSortOrderEnumValues Enumerates the set of values for SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum +func GetSearchSoftwareSourceModuleStreamsDetailsSortOrderEnumValues() []SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum { + values := make([]SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum, 0) + for _, v := range mappingSearchSoftwareSourceModuleStreamsDetailsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSearchSoftwareSourceModuleStreamsDetailsSortOrderEnumStringValues Enumerates the set of values in String for SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum +func GetSearchSoftwareSourceModuleStreamsDetailsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSearchSoftwareSourceModuleStreamsDetailsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSearchSoftwareSourceModuleStreamsDetailsSortOrderEnum(val string) (SearchSoftwareSourceModuleStreamsDetailsSortOrderEnum, bool) { + enum, ok := mappingSearchSoftwareSourceModuleStreamsDetailsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SearchSoftwareSourceModuleStreamsDetailsSortByEnum Enum with underlying type: string +type SearchSoftwareSourceModuleStreamsDetailsSortByEnum string + +// Set of constants representing the allowable values for SearchSoftwareSourceModuleStreamsDetailsSortByEnum +const ( + SearchSoftwareSourceModuleStreamsDetailsSortByModulename SearchSoftwareSourceModuleStreamsDetailsSortByEnum = "MODULENAME" +) + +var mappingSearchSoftwareSourceModuleStreamsDetailsSortByEnum = map[string]SearchSoftwareSourceModuleStreamsDetailsSortByEnum{ + "MODULENAME": SearchSoftwareSourceModuleStreamsDetailsSortByModulename, +} + +var mappingSearchSoftwareSourceModuleStreamsDetailsSortByEnumLowerCase = map[string]SearchSoftwareSourceModuleStreamsDetailsSortByEnum{ + "modulename": SearchSoftwareSourceModuleStreamsDetailsSortByModulename, +} + +// GetSearchSoftwareSourceModuleStreamsDetailsSortByEnumValues Enumerates the set of values for SearchSoftwareSourceModuleStreamsDetailsSortByEnum +func GetSearchSoftwareSourceModuleStreamsDetailsSortByEnumValues() []SearchSoftwareSourceModuleStreamsDetailsSortByEnum { + values := make([]SearchSoftwareSourceModuleStreamsDetailsSortByEnum, 0) + for _, v := range mappingSearchSoftwareSourceModuleStreamsDetailsSortByEnum { + values = append(values, v) + } + return values +} + +// GetSearchSoftwareSourceModuleStreamsDetailsSortByEnumStringValues Enumerates the set of values in String for SearchSoftwareSourceModuleStreamsDetailsSortByEnum +func GetSearchSoftwareSourceModuleStreamsDetailsSortByEnumStringValues() []string { + return []string{ + "MODULENAME", + } +} + +// GetMappingSearchSoftwareSourceModuleStreamsDetailsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSearchSoftwareSourceModuleStreamsDetailsSortByEnum(val string) (SearchSoftwareSourceModuleStreamsDetailsSortByEnum, bool) { + enum, ok := mappingSearchSoftwareSourceModuleStreamsDetailsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/search_software_source_module_streams_request_response.go b/osmanagementhub/search_software_source_module_streams_request_response.go new file mode 100644 index 0000000000..5c3ead99c7 --- /dev/null +++ b/osmanagementhub/search_software_source_module_streams_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SearchSoftwareSourceModuleStreamsRequest wrapper for the SearchSoftwareSourceModuleStreams operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SearchSoftwareSourceModuleStreams.go.html to see an example of how to use SearchSoftwareSourceModuleStreamsRequest. +type SearchSoftwareSourceModuleStreamsRequest struct { + + // Request body that takes a list of software sources and any search filters. + SearchSoftwareSourceModuleStreamsDetails `contributesTo:"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 `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // 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 SearchSoftwareSourceModuleStreamsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SearchSoftwareSourceModuleStreamsRequest) 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 SearchSoftwareSourceModuleStreamsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SearchSoftwareSourceModuleStreamsRequest) 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 SearchSoftwareSourceModuleStreamsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SearchSoftwareSourceModuleStreamsResponse wrapper for the SearchSoftwareSourceModuleStreams operation +type SearchSoftwareSourceModuleStreamsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ModuleStreamCollection instances + ModuleStreamCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SearchSoftwareSourceModuleStreamsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SearchSoftwareSourceModuleStreamsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/search_software_source_modules_details.go b/osmanagementhub/search_software_source_modules_details.go new file mode 100644 index 0000000000..a54600f208 --- /dev/null +++ b/osmanagementhub/search_software_source_modules_details.go @@ -0,0 +1,138 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SearchSoftwareSourceModulesDetails Contains a list of software sources to get the combined list of modules from all of those software sources. +type SearchSoftwareSourceModulesDetails struct { + + // List of software source OCIDs. + SoftwareSourceIds []string `mandatory:"true" json:"softwareSourceIds"` + + // The sort order. + SortOrder SearchSoftwareSourceModulesDetailsSortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` + + // The name of a module. + Name *string `mandatory:"false" json:"name"` + + // filters results, allowing only those with a name which contains the string. + NameContains *string `mandatory:"false" json:"nameContains"` + + // The field to sort by. + SortBy SearchSoftwareSourceModulesDetailsSortByEnum `mandatory:"false" json:"sortBy,omitempty"` +} + +func (m SearchSoftwareSourceModulesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SearchSoftwareSourceModulesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSearchSoftwareSourceModulesDetailsSortOrderEnum(string(m.SortOrder)); !ok && m.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", m.SortOrder, strings.Join(GetSearchSoftwareSourceModulesDetailsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSearchSoftwareSourceModulesDetailsSortByEnum(string(m.SortBy)); !ok && m.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", m.SortBy, strings.Join(GetSearchSoftwareSourceModulesDetailsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SearchSoftwareSourceModulesDetailsSortOrderEnum Enum with underlying type: string +type SearchSoftwareSourceModulesDetailsSortOrderEnum string + +// Set of constants representing the allowable values for SearchSoftwareSourceModulesDetailsSortOrderEnum +const ( + SearchSoftwareSourceModulesDetailsSortOrderAsc SearchSoftwareSourceModulesDetailsSortOrderEnum = "ASC" + SearchSoftwareSourceModulesDetailsSortOrderDesc SearchSoftwareSourceModulesDetailsSortOrderEnum = "DESC" +) + +var mappingSearchSoftwareSourceModulesDetailsSortOrderEnum = map[string]SearchSoftwareSourceModulesDetailsSortOrderEnum{ + "ASC": SearchSoftwareSourceModulesDetailsSortOrderAsc, + "DESC": SearchSoftwareSourceModulesDetailsSortOrderDesc, +} + +var mappingSearchSoftwareSourceModulesDetailsSortOrderEnumLowerCase = map[string]SearchSoftwareSourceModulesDetailsSortOrderEnum{ + "asc": SearchSoftwareSourceModulesDetailsSortOrderAsc, + "desc": SearchSoftwareSourceModulesDetailsSortOrderDesc, +} + +// GetSearchSoftwareSourceModulesDetailsSortOrderEnumValues Enumerates the set of values for SearchSoftwareSourceModulesDetailsSortOrderEnum +func GetSearchSoftwareSourceModulesDetailsSortOrderEnumValues() []SearchSoftwareSourceModulesDetailsSortOrderEnum { + values := make([]SearchSoftwareSourceModulesDetailsSortOrderEnum, 0) + for _, v := range mappingSearchSoftwareSourceModulesDetailsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSearchSoftwareSourceModulesDetailsSortOrderEnumStringValues Enumerates the set of values in String for SearchSoftwareSourceModulesDetailsSortOrderEnum +func GetSearchSoftwareSourceModulesDetailsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSearchSoftwareSourceModulesDetailsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSearchSoftwareSourceModulesDetailsSortOrderEnum(val string) (SearchSoftwareSourceModulesDetailsSortOrderEnum, bool) { + enum, ok := mappingSearchSoftwareSourceModulesDetailsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SearchSoftwareSourceModulesDetailsSortByEnum Enum with underlying type: string +type SearchSoftwareSourceModulesDetailsSortByEnum string + +// Set of constants representing the allowable values for SearchSoftwareSourceModulesDetailsSortByEnum +const ( + SearchSoftwareSourceModulesDetailsSortByName SearchSoftwareSourceModulesDetailsSortByEnum = "NAME" +) + +var mappingSearchSoftwareSourceModulesDetailsSortByEnum = map[string]SearchSoftwareSourceModulesDetailsSortByEnum{ + "NAME": SearchSoftwareSourceModulesDetailsSortByName, +} + +var mappingSearchSoftwareSourceModulesDetailsSortByEnumLowerCase = map[string]SearchSoftwareSourceModulesDetailsSortByEnum{ + "name": SearchSoftwareSourceModulesDetailsSortByName, +} + +// GetSearchSoftwareSourceModulesDetailsSortByEnumValues Enumerates the set of values for SearchSoftwareSourceModulesDetailsSortByEnum +func GetSearchSoftwareSourceModulesDetailsSortByEnumValues() []SearchSoftwareSourceModulesDetailsSortByEnum { + values := make([]SearchSoftwareSourceModulesDetailsSortByEnum, 0) + for _, v := range mappingSearchSoftwareSourceModulesDetailsSortByEnum { + values = append(values, v) + } + return values +} + +// GetSearchSoftwareSourceModulesDetailsSortByEnumStringValues Enumerates the set of values in String for SearchSoftwareSourceModulesDetailsSortByEnum +func GetSearchSoftwareSourceModulesDetailsSortByEnumStringValues() []string { + return []string{ + "NAME", + } +} + +// GetMappingSearchSoftwareSourceModulesDetailsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSearchSoftwareSourceModulesDetailsSortByEnum(val string) (SearchSoftwareSourceModulesDetailsSortByEnum, bool) { + enum, ok := mappingSearchSoftwareSourceModulesDetailsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/search_software_source_modules_request_response.go b/osmanagementhub/search_software_source_modules_request_response.go new file mode 100644 index 0000000000..d4d646f783 --- /dev/null +++ b/osmanagementhub/search_software_source_modules_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SearchSoftwareSourceModulesRequest wrapper for the SearchSoftwareSourceModules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SearchSoftwareSourceModules.go.html to see an example of how to use SearchSoftwareSourceModulesRequest. +type SearchSoftwareSourceModulesRequest struct { + + // Request body that takes a list of software sources and any search filters. + SearchSoftwareSourceModulesDetails `contributesTo:"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 `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // 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 SearchSoftwareSourceModulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SearchSoftwareSourceModulesRequest) 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 SearchSoftwareSourceModulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SearchSoftwareSourceModulesRequest) 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 SearchSoftwareSourceModulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SearchSoftwareSourceModulesResponse wrapper for the SearchSoftwareSourceModules operation +type SearchSoftwareSourceModulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ModuleCollection instances + ModuleCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SearchSoftwareSourceModulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SearchSoftwareSourceModulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/search_software_source_package_groups_details.go b/osmanagementhub/search_software_source_package_groups_details.go new file mode 100644 index 0000000000..26f15c2372 --- /dev/null +++ b/osmanagementhub/search_software_source_package_groups_details.go @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SearchSoftwareSourcePackageGroupsDetails Contains a list of software sources to get the list of associated package groups. +type SearchSoftwareSourcePackageGroupsDetails struct { + + // List of software source OCIDs. + SoftwareSourceIds []string `mandatory:"true" json:"softwareSourceIds"` + + // The sort order. + SortOrder SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` + + // The field to sort by. + SortBy SearchSoftwareSourcePackageGroupsDetailsSortByEnum `mandatory:"false" json:"sortBy,omitempty"` + + // filters results, allowing only those with a Name which contains the string. + NameContains *string `mandatory:"false" json:"nameContains"` + + // Indicates if this is a group, category or environment. + GroupType PackageGroupGroupTypeEnum `mandatory:"false" json:"groupType,omitempty"` +} + +func (m SearchSoftwareSourcePackageGroupsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SearchSoftwareSourcePackageGroupsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSearchSoftwareSourcePackageGroupsDetailsSortOrderEnum(string(m.SortOrder)); !ok && m.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", m.SortOrder, strings.Join(GetSearchSoftwareSourcePackageGroupsDetailsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSearchSoftwareSourcePackageGroupsDetailsSortByEnum(string(m.SortBy)); !ok && m.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", m.SortBy, strings.Join(GetSearchSoftwareSourcePackageGroupsDetailsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingPackageGroupGroupTypeEnum(string(m.GroupType)); !ok && m.GroupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for GroupType: %s. Supported values are: %s.", m.GroupType, strings.Join(GetPackageGroupGroupTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum Enum with underlying type: string +type SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum string + +// Set of constants representing the allowable values for SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum +const ( + SearchSoftwareSourcePackageGroupsDetailsSortOrderAsc SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum = "ASC" + SearchSoftwareSourcePackageGroupsDetailsSortOrderDesc SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum = "DESC" +) + +var mappingSearchSoftwareSourcePackageGroupsDetailsSortOrderEnum = map[string]SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum{ + "ASC": SearchSoftwareSourcePackageGroupsDetailsSortOrderAsc, + "DESC": SearchSoftwareSourcePackageGroupsDetailsSortOrderDesc, +} + +var mappingSearchSoftwareSourcePackageGroupsDetailsSortOrderEnumLowerCase = map[string]SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum{ + "asc": SearchSoftwareSourcePackageGroupsDetailsSortOrderAsc, + "desc": SearchSoftwareSourcePackageGroupsDetailsSortOrderDesc, +} + +// GetSearchSoftwareSourcePackageGroupsDetailsSortOrderEnumValues Enumerates the set of values for SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum +func GetSearchSoftwareSourcePackageGroupsDetailsSortOrderEnumValues() []SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum { + values := make([]SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum, 0) + for _, v := range mappingSearchSoftwareSourcePackageGroupsDetailsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSearchSoftwareSourcePackageGroupsDetailsSortOrderEnumStringValues Enumerates the set of values in String for SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum +func GetSearchSoftwareSourcePackageGroupsDetailsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSearchSoftwareSourcePackageGroupsDetailsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSearchSoftwareSourcePackageGroupsDetailsSortOrderEnum(val string) (SearchSoftwareSourcePackageGroupsDetailsSortOrderEnum, bool) { + enum, ok := mappingSearchSoftwareSourcePackageGroupsDetailsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SearchSoftwareSourcePackageGroupsDetailsSortByEnum Enum with underlying type: string +type SearchSoftwareSourcePackageGroupsDetailsSortByEnum string + +// Set of constants representing the allowable values for SearchSoftwareSourcePackageGroupsDetailsSortByEnum +const ( + SearchSoftwareSourcePackageGroupsDetailsSortByName SearchSoftwareSourcePackageGroupsDetailsSortByEnum = "NAME" +) + +var mappingSearchSoftwareSourcePackageGroupsDetailsSortByEnum = map[string]SearchSoftwareSourcePackageGroupsDetailsSortByEnum{ + "NAME": SearchSoftwareSourcePackageGroupsDetailsSortByName, +} + +var mappingSearchSoftwareSourcePackageGroupsDetailsSortByEnumLowerCase = map[string]SearchSoftwareSourcePackageGroupsDetailsSortByEnum{ + "name": SearchSoftwareSourcePackageGroupsDetailsSortByName, +} + +// GetSearchSoftwareSourcePackageGroupsDetailsSortByEnumValues Enumerates the set of values for SearchSoftwareSourcePackageGroupsDetailsSortByEnum +func GetSearchSoftwareSourcePackageGroupsDetailsSortByEnumValues() []SearchSoftwareSourcePackageGroupsDetailsSortByEnum { + values := make([]SearchSoftwareSourcePackageGroupsDetailsSortByEnum, 0) + for _, v := range mappingSearchSoftwareSourcePackageGroupsDetailsSortByEnum { + values = append(values, v) + } + return values +} + +// GetSearchSoftwareSourcePackageGroupsDetailsSortByEnumStringValues Enumerates the set of values in String for SearchSoftwareSourcePackageGroupsDetailsSortByEnum +func GetSearchSoftwareSourcePackageGroupsDetailsSortByEnumStringValues() []string { + return []string{ + "NAME", + } +} + +// GetMappingSearchSoftwareSourcePackageGroupsDetailsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSearchSoftwareSourcePackageGroupsDetailsSortByEnum(val string) (SearchSoftwareSourcePackageGroupsDetailsSortByEnum, bool) { + enum, ok := mappingSearchSoftwareSourcePackageGroupsDetailsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/search_software_source_package_groups_request_response.go b/osmanagementhub/search_software_source_package_groups_request_response.go new file mode 100644 index 0000000000..82799b8b54 --- /dev/null +++ b/osmanagementhub/search_software_source_package_groups_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SearchSoftwareSourcePackageGroupsRequest wrapper for the SearchSoftwareSourcePackageGroups operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SearchSoftwareSourcePackageGroups.go.html to see an example of how to use SearchSoftwareSourcePackageGroupsRequest. +type SearchSoftwareSourcePackageGroupsRequest struct { + + // Request body that takes in a list of software sources and other search parameters. + SearchSoftwareSourcePackageGroupsDetails `contributesTo:"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 `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // 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 SearchSoftwareSourcePackageGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SearchSoftwareSourcePackageGroupsRequest) 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 SearchSoftwareSourcePackageGroupsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SearchSoftwareSourcePackageGroupsRequest) 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 SearchSoftwareSourcePackageGroupsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SearchSoftwareSourcePackageGroupsResponse wrapper for the SearchSoftwareSourcePackageGroups operation +type SearchSoftwareSourcePackageGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of PackageGroupCollection instances + PackageGroupCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SearchSoftwareSourcePackageGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SearchSoftwareSourcePackageGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/software_package.go b/osmanagementhub/software_package.go new file mode 100644 index 0000000000..e175f4535b --- /dev/null +++ b/osmanagementhub/software_package.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwarePackage The details for a software package. +type SoftwarePackage struct { + + // Package name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Unique identifier for the package. NOTE - This is not an OCID. + Name *string `mandatory:"true" json:"name"` + + // Type of the package. + Type *string `mandatory:"true" json:"type"` + + // Version of the package. + Version *string `mandatory:"true" json:"version"` + + // The architecture for which this software was built + Architecture *string `mandatory:"false" json:"architecture"` + + // Date of the last update to the package. + LastModifiedDate *string `mandatory:"false" json:"lastModifiedDate"` + + // Checksum of the package. + Checksum *string `mandatory:"false" json:"checksum"` + + // Type of the checksum. + ChecksumType *string `mandatory:"false" json:"checksumType"` + + // Description of the package. + Description *string `mandatory:"false" json:"description"` + + // Size of the package in bytes. + SizeInBytes *int64 `mandatory:"false" json:"sizeInBytes"` + + // List of dependencies for the software package. + Dependencies []SoftwarePackageDependency `mandatory:"false" json:"dependencies"` + + // List of files for the software package. + Files []SoftwarePackageFile `mandatory:"false" json:"files"` + + // List of software sources that provide the software package. + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` + + // Indicates whether this package is the latest version. + IsLatest *bool `mandatory:"false" json:"isLatest"` +} + +func (m SoftwarePackage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwarePackage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_package_collection.go b/osmanagementhub/software_package_collection.go new file mode 100644 index 0000000000..d3db15ea0a --- /dev/null +++ b/osmanagementhub/software_package_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwarePackageCollection Results of a software package search. Contains boh software package summary items and other information, such as metadata. +type SoftwarePackageCollection struct { + + // List of software packages. + Items []SoftwarePackageSummary `mandatory:"true" json:"items"` +} + +func (m SoftwarePackageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwarePackageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_package_dependency.go b/osmanagementhub/software_package_dependency.go new file mode 100644 index 0000000000..009bb0d9fa --- /dev/null +++ b/osmanagementhub/software_package_dependency.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwarePackageDependency A dependency for a software package. +type SoftwarePackageDependency struct { + + // The software package's dependency. + Dependency *string `mandatory:"false" json:"dependency"` + + // The type of the dependency. + DependencyType *string `mandatory:"false" json:"dependencyType"` + + // The modifier for the dependency. + DependencyModifier *string `mandatory:"false" json:"dependencyModifier"` +} + +func (m SoftwarePackageDependency) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwarePackageDependency) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_package_file.go b/osmanagementhub/software_package_file.go new file mode 100644 index 0000000000..550c605e35 --- /dev/null +++ b/osmanagementhub/software_package_file.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwarePackageFile A file associated with a package. +type SoftwarePackageFile struct { + + // File path. + Path *string `mandatory:"false" json:"path"` + + // Type of the file. + Type *string `mandatory:"false" json:"type"` + + // The date and time of the last modification to this file, as described + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // Checksum of the file. + Checksum *string `mandatory:"false" json:"checksum"` + + // Type of the checksum. + ChecksumType *string `mandatory:"false" json:"checksumType"` + + // Size of the file in bytes. + SizeInBytes *int64 `mandatory:"false" json:"sizeInBytes"` +} + +func (m SoftwarePackageFile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwarePackageFile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_package_summary.go b/osmanagementhub/software_package_summary.go new file mode 100644 index 0000000000..2bbb4ee941 --- /dev/null +++ b/osmanagementhub/software_package_summary.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwarePackageSummary Summary information for a software package. +type SoftwarePackageSummary struct { + + // Package name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Unique identifier for the package. NOTE - This is not an OCID. + Name *string `mandatory:"true" json:"name"` + + // Type of the package. + Type *string `mandatory:"true" json:"type"` + + // Version of the package. + Version *string `mandatory:"true" json:"version"` + + // The architecture for which this software was built. + Architecture *string `mandatory:"false" json:"architecture"` + + // Checksum of the package. + Checksum *string `mandatory:"false" json:"checksum"` + + // Type of the checksum. + ChecksumType *string `mandatory:"false" json:"checksumType"` + + // Indicates whether this package is the latest version. + IsLatest *bool `mandatory:"false" json:"isLatest"` + + // List of software sources that provide the software package. + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` +} + +func (m SoftwarePackageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwarePackageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_packages_details.go b/osmanagementhub/software_packages_details.go new file mode 100644 index 0000000000..77e7dc1c63 --- /dev/null +++ b/osmanagementhub/software_packages_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwarePackagesDetails The details about the software packages to be installed/removed/updated. +type SoftwarePackagesDetails struct { + + // The list of package names. + PackageNames []string `mandatory:"true" json:"packageNames"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m SoftwarePackagesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwarePackagesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_source.go b/osmanagementhub/software_source.go new file mode 100644 index 0000000000..f5fbb71c50 --- /dev/null +++ b/osmanagementhub/software_source.go @@ -0,0 +1,355 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSource A software source contains a collection of packages. +type SoftwareSource interface { + + // OCID for the software source. + GetId() *string + + // The OCID of the tenancy containing the software source. + GetCompartmentId() *string + + // User friendly name for the software source. + GetDisplayName() *string + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + GetTimeCreated() *common.SDKTime + + // Possible availabilities of a software source. + GetAvailability() AvailabilityEnum + + // The Repo ID for the software source. + GetRepoId() *string + + // The OS family the software source belongs to. + GetOsFamily() OsFamilyEnum + + // The architecture type supported by the software source. + GetArchType() ArchTypeEnum + + // URL for the repository. + GetUrl() *string + + // Information specified by the user about the software source. + GetDescription() *string + + // The current state of the software source. + GetLifecycleState() SoftwareSourceLifecycleStateEnum + + // Number of packages. + GetPackageCount() *int64 + + // The yum repository checksum type used by this software source. + GetChecksumType() ChecksumTypeEnum + + // URL of the GPG key for this software source. + GetGpgKeyUrl() *string + + // ID of the GPG key for this software source. + GetGpgKeyId() *string + + // Fingerprint of the GPG key for this software source. + GetGpgKeyFingerprint() *string + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type softwaresource struct { + JsonData []byte + 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"` + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + RepoId *string `mandatory:"true" json:"repoId"` + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + Url *string `mandatory:"true" json:"url"` + Description *string `mandatory:"false" json:"description"` + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + PackageCount *int64 `mandatory:"false" json:"packageCount"` + ChecksumType ChecksumTypeEnum `mandatory:"false" json:"checksumType,omitempty"` + GpgKeyUrl *string `mandatory:"false" json:"gpgKeyUrl"` + GpgKeyId *string `mandatory:"false" json:"gpgKeyId"` + GpgKeyFingerprint *string `mandatory:"false" json:"gpgKeyFingerprint"` + 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"` + SoftwareSourceType string `json:"softwareSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *softwaresource) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersoftwaresource softwaresource + s := struct { + Model Unmarshalersoftwaresource + }{} + 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.Availability = s.Model.Availability + m.RepoId = s.Model.RepoId + m.OsFamily = s.Model.OsFamily + m.ArchType = s.Model.ArchType + m.Url = s.Model.Url + m.Description = s.Model.Description + m.LifecycleState = s.Model.LifecycleState + m.PackageCount = s.Model.PackageCount + m.ChecksumType = s.Model.ChecksumType + m.GpgKeyUrl = s.Model.GpgKeyUrl + m.GpgKeyId = s.Model.GpgKeyId + m.GpgKeyFingerprint = s.Model.GpgKeyFingerprint + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.SoftwareSourceType = s.Model.SoftwareSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *softwaresource) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SoftwareSourceType { + case "VENDOR": + mm := VendorSoftwareSource{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CUSTOM": + mm := CustomSoftwareSource{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VERSIONED": + mm := VersionedCustomSoftwareSource{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for SoftwareSource: %s.", m.SoftwareSourceType) + return *m, nil + } +} + +//GetId returns Id +func (m softwaresource) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m softwaresource) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m softwaresource) GetDisplayName() *string { + return m.DisplayName +} + +//GetTimeCreated returns TimeCreated +func (m softwaresource) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetAvailability returns Availability +func (m softwaresource) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetRepoId returns RepoId +func (m softwaresource) GetRepoId() *string { + return m.RepoId +} + +//GetOsFamily returns OsFamily +func (m softwaresource) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m softwaresource) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetUrl returns Url +func (m softwaresource) GetUrl() *string { + return m.Url +} + +//GetDescription returns Description +func (m softwaresource) GetDescription() *string { + return m.Description +} + +//GetLifecycleState returns LifecycleState +func (m softwaresource) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetPackageCount returns PackageCount +func (m softwaresource) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetChecksumType returns ChecksumType +func (m softwaresource) GetChecksumType() ChecksumTypeEnum { + return m.ChecksumType +} + +//GetGpgKeyUrl returns GpgKeyUrl +func (m softwaresource) GetGpgKeyUrl() *string { + return m.GpgKeyUrl +} + +//GetGpgKeyId returns GpgKeyId +func (m softwaresource) GetGpgKeyId() *string { + return m.GpgKeyId +} + +//GetGpgKeyFingerprint returns GpgKeyFingerprint +func (m softwaresource) GetGpgKeyFingerprint() *string { + return m.GpgKeyFingerprint +} + +//GetFreeformTags returns FreeformTags +func (m softwaresource) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m softwaresource) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m softwaresource) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m softwaresource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m softwaresource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingChecksumTypeEnum(string(m.ChecksumType)); !ok && m.ChecksumType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ChecksumType: %s. Supported values are: %s.", m.ChecksumType, strings.Join(GetChecksumTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SoftwareSourceLifecycleStateEnum Enum with underlying type: string +type SoftwareSourceLifecycleStateEnum string + +// Set of constants representing the allowable values for SoftwareSourceLifecycleStateEnum +const ( + SoftwareSourceLifecycleStateCreating SoftwareSourceLifecycleStateEnum = "CREATING" + SoftwareSourceLifecycleStateUpdating SoftwareSourceLifecycleStateEnum = "UPDATING" + SoftwareSourceLifecycleStateActive SoftwareSourceLifecycleStateEnum = "ACTIVE" + SoftwareSourceLifecycleStateDeleting SoftwareSourceLifecycleStateEnum = "DELETING" + SoftwareSourceLifecycleStateDeleted SoftwareSourceLifecycleStateEnum = "DELETED" + SoftwareSourceLifecycleStateFailed SoftwareSourceLifecycleStateEnum = "FAILED" +) + +var mappingSoftwareSourceLifecycleStateEnum = map[string]SoftwareSourceLifecycleStateEnum{ + "CREATING": SoftwareSourceLifecycleStateCreating, + "UPDATING": SoftwareSourceLifecycleStateUpdating, + "ACTIVE": SoftwareSourceLifecycleStateActive, + "DELETING": SoftwareSourceLifecycleStateDeleting, + "DELETED": SoftwareSourceLifecycleStateDeleted, + "FAILED": SoftwareSourceLifecycleStateFailed, +} + +var mappingSoftwareSourceLifecycleStateEnumLowerCase = map[string]SoftwareSourceLifecycleStateEnum{ + "creating": SoftwareSourceLifecycleStateCreating, + "updating": SoftwareSourceLifecycleStateUpdating, + "active": SoftwareSourceLifecycleStateActive, + "deleting": SoftwareSourceLifecycleStateDeleting, + "deleted": SoftwareSourceLifecycleStateDeleted, + "failed": SoftwareSourceLifecycleStateFailed, +} + +// GetSoftwareSourceLifecycleStateEnumValues Enumerates the set of values for SoftwareSourceLifecycleStateEnum +func GetSoftwareSourceLifecycleStateEnumValues() []SoftwareSourceLifecycleStateEnum { + values := make([]SoftwareSourceLifecycleStateEnum, 0) + for _, v := range mappingSoftwareSourceLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSoftwareSourceLifecycleStateEnumStringValues Enumerates the set of values in String for SoftwareSourceLifecycleStateEnum +func GetSoftwareSourceLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingSoftwareSourceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSoftwareSourceLifecycleStateEnum(val string) (SoftwareSourceLifecycleStateEnum, bool) { + enum, ok := mappingSoftwareSourceLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/software_source_availability.go b/osmanagementhub/software_source_availability.go new file mode 100644 index 0000000000..573bef1fad --- /dev/null +++ b/osmanagementhub/software_source_availability.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourceAvailability An object that contains a software source OCID and its availability. +type SoftwareSourceAvailability struct { + + // The OCID for a vendor software source. + SoftwareSourceId *string `mandatory:"true" json:"softwareSourceId"` + + // Possible availabilities of a software source. + Availability AvailabilityEnum `mandatory:"true" json:"availability"` +} + +func (m SoftwareSourceAvailability) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwareSourceAvailability) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_source_collection.go b/osmanagementhub/software_source_collection.go new file mode 100644 index 0000000000..570580f01d --- /dev/null +++ b/osmanagementhub/software_source_collection.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourceCollection Results of a SoftwareSource search. Contains boh SoftwareSourceSummary items and other information, such as metadata. +type SoftwareSourceCollection struct { + + // List of SoftwareSources. + Items []SoftwareSourceSummary `mandatory:"true" json:"items"` +} + +func (m SoftwareSourceCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwareSourceCollection) 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 *SoftwareSourceCollection) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []softwaresourcesummary `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Items = make([]SoftwareSourceSummary, 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.(SoftwareSourceSummary) + } else { + m.Items[i] = nil + } + } + + return +} diff --git a/osmanagementhub/software_source_details.go b/osmanagementhub/software_source_details.go new file mode 100644 index 0000000000..0d9071bddb --- /dev/null +++ b/osmanagementhub/software_source_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourceDetails Identifying information for the specified software source. +type SoftwareSourceDetails struct { + + // The OCID of the software source. + Id *string `mandatory:"true" json:"id"` + + // Software source name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Software source description. + Description *string `mandatory:"false" json:"description"` + + // Type of the software source. + SoftwareSourceType SoftwareSourceTypeEnum `mandatory:"false" json:"softwareSourceType,omitempty"` +} + +func (m SoftwareSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwareSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSoftwareSourceTypeEnum(string(m.SoftwareSourceType)); !ok && m.SoftwareSourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SoftwareSourceType: %s. Supported values are: %s.", m.SoftwareSourceType, strings.Join(GetSoftwareSourceTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_source_profile.go b/osmanagementhub/software_source_profile.go new file mode 100644 index 0000000000..1e6900d78f --- /dev/null +++ b/osmanagementhub/software_source_profile.go @@ -0,0 +1,176 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourceProfile Definition of a registration profile of type SoftwareSource. +type SoftwareSourceProfile struct { + + // The OCID of the profile that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The list of software sources that the registration profile will use. + SoftwareSources []SoftwareSourceDetails `mandatory:"true" json:"softwareSources"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // The time the the registration profile was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The operating system family. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The current state of the registration profile. + LifecycleState ProfileLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m SoftwareSourceProfile) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m SoftwareSourceProfile) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m SoftwareSourceProfile) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m SoftwareSourceProfile) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m SoftwareSourceProfile) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetVendorName returns VendorName +func (m SoftwareSourceProfile) GetVendorName() VendorNameEnum { + return m.VendorName +} + +//GetOsFamily returns OsFamily +func (m SoftwareSourceProfile) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m SoftwareSourceProfile) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetTimeCreated returns TimeCreated +func (m SoftwareSourceProfile) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m SoftwareSourceProfile) GetLifecycleState() ProfileLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m SoftwareSourceProfile) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m SoftwareSourceProfile) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m SoftwareSourceProfile) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m SoftwareSourceProfile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwareSourceProfile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingProfileLifecycleStateEnum(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(GetProfileLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m SoftwareSourceProfile) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSoftwareSourceProfile SoftwareSourceProfile + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeSoftwareSourceProfile + }{ + "SOFTWARESOURCE", + (MarshalTypeSoftwareSourceProfile)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/software_source_summary.go b/osmanagementhub/software_source_summary.go new file mode 100644 index 0000000000..d65760d972 --- /dev/null +++ b/osmanagementhub/software_source_summary.go @@ -0,0 +1,265 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourceSummary A software source contains a collection of packages. +type SoftwareSourceSummary interface { + + // The OCID for the software source. + GetId() *string + + // The OCID of the tenancy containing the software source. + GetCompartmentId() *string + + // User friendly name for the software source. + GetDisplayName() *string + + // The Repo ID for the software source. + GetRepoId() *string + + // URL for the repository. + GetUrl() *string + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + GetTimeCreated() *common.SDKTime + + // The date and time of when the software source was updated as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + GetTimeUpdated() *common.SDKTime + + // Possible availabilities of a software source. + GetAvailability() AvailabilityEnum + + // The OS family the software source belongs to. + GetOsFamily() OsFamilyEnum + + // The architecture type supported by the software source. + GetArchType() ArchTypeEnum + + // Information specified by the user about the software source. + GetDescription() *string + + // Number of packages. + GetPackageCount() *int64 + + // The current state of the software source. + GetLifecycleState() SoftwareSourceLifecycleStateEnum + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type softwaresourcesummary struct { + JsonData []byte + Id *string `mandatory:"true" json:"id"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + DisplayName *string `mandatory:"true" json:"displayName"` + RepoId *string `mandatory:"true" json:"repoId"` + Url *string `mandatory:"true" json:"url"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + Description *string `mandatory:"false" json:"description"` + PackageCount *int64 `mandatory:"false" json:"packageCount"` + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + 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"` + SoftwareSourceType string `json:"softwareSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *softwaresourcesummary) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersoftwaresourcesummary softwaresourcesummary + s := struct { + Model Unmarshalersoftwaresourcesummary + }{} + 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.RepoId = s.Model.RepoId + m.Url = s.Model.Url + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.Availability = s.Model.Availability + m.OsFamily = s.Model.OsFamily + m.ArchType = s.Model.ArchType + m.Description = s.Model.Description + m.PackageCount = s.Model.PackageCount + m.LifecycleState = s.Model.LifecycleState + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.SoftwareSourceType = s.Model.SoftwareSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *softwaresourcesummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SoftwareSourceType { + case "VENDOR": + mm := VendorSoftwareSourceSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VERSIONED": + mm := VersionedCustomSoftwareSourceSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CUSTOM": + mm := CustomSoftwareSourceSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for SoftwareSourceSummary: %s.", m.SoftwareSourceType) + return *m, nil + } +} + +//GetId returns Id +func (m softwaresourcesummary) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m softwaresourcesummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m softwaresourcesummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetRepoId returns RepoId +func (m softwaresourcesummary) GetRepoId() *string { + return m.RepoId +} + +//GetUrl returns Url +func (m softwaresourcesummary) GetUrl() *string { + return m.Url +} + +//GetTimeCreated returns TimeCreated +func (m softwaresourcesummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m softwaresourcesummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +//GetAvailability returns Availability +func (m softwaresourcesummary) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetOsFamily returns OsFamily +func (m softwaresourcesummary) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m softwaresourcesummary) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetDescription returns Description +func (m softwaresourcesummary) GetDescription() *string { + return m.Description +} + +//GetPackageCount returns PackageCount +func (m softwaresourcesummary) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetLifecycleState returns LifecycleState +func (m softwaresourcesummary) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m softwaresourcesummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m softwaresourcesummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m softwaresourcesummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m softwaresourcesummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m softwaresourcesummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_source_type.go b/osmanagementhub/software_source_type.go new file mode 100644 index 0000000000..26cdca97bc --- /dev/null +++ b/osmanagementhub/software_source_type.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// SoftwareSourceTypeEnum Enum with underlying type: string +type SoftwareSourceTypeEnum string + +// Set of constants representing the allowable values for SoftwareSourceTypeEnum +const ( + SoftwareSourceTypeVendor SoftwareSourceTypeEnum = "VENDOR" + SoftwareSourceTypeCustom SoftwareSourceTypeEnum = "CUSTOM" + SoftwareSourceTypeVersioned SoftwareSourceTypeEnum = "VERSIONED" +) + +var mappingSoftwareSourceTypeEnum = map[string]SoftwareSourceTypeEnum{ + "VENDOR": SoftwareSourceTypeVendor, + "CUSTOM": SoftwareSourceTypeCustom, + "VERSIONED": SoftwareSourceTypeVersioned, +} + +var mappingSoftwareSourceTypeEnumLowerCase = map[string]SoftwareSourceTypeEnum{ + "vendor": SoftwareSourceTypeVendor, + "custom": SoftwareSourceTypeCustom, + "versioned": SoftwareSourceTypeVersioned, +} + +// GetSoftwareSourceTypeEnumValues Enumerates the set of values for SoftwareSourceTypeEnum +func GetSoftwareSourceTypeEnumValues() []SoftwareSourceTypeEnum { + values := make([]SoftwareSourceTypeEnum, 0) + for _, v := range mappingSoftwareSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetSoftwareSourceTypeEnumStringValues Enumerates the set of values in String for SoftwareSourceTypeEnum +func GetSoftwareSourceTypeEnumStringValues() []string { + return []string{ + "VENDOR", + "CUSTOM", + "VERSIONED", + } +} + +// GetMappingSoftwareSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSoftwareSourceTypeEnum(val string) (SoftwareSourceTypeEnum, bool) { + enum, ok := mappingSoftwareSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/software_source_vendor_collection.go b/osmanagementhub/software_source_vendor_collection.go new file mode 100644 index 0000000000..30608d89d4 --- /dev/null +++ b/osmanagementhub/software_source_vendor_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourceVendorCollection Results of a SoftwareSourceVendor search. Contains boh SoftwareSourceVendorSummary items and other information, such as metadata. +type SoftwareSourceVendorCollection struct { + + // List of SoftwareSourceVendor. + Items []SoftwareSourceVendorSummary `mandatory:"true" json:"items"` +} + +func (m SoftwareSourceVendorCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwareSourceVendorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_source_vendor_summary.go b/osmanagementhub/software_source_vendor_summary.go new file mode 100644 index 0000000000..71292fdeea --- /dev/null +++ b/osmanagementhub/software_source_vendor_summary.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourceVendorSummary Software vendor name, list of osFamily and archType. +type SoftwareSourceVendorSummary struct { + + // Name of the vendor providing the software source. + Name VendorNameEnum `mandatory:"true" json:"name"` + + // List of corresponding osFamilies. + OsFamilies []OsFamilyEnum `mandatory:"true" json:"osFamilies"` + + // List of corresponding archTypes. + ArchTypes []ArchTypeEnum `mandatory:"true" json:"archTypes"` +} + +func (m SoftwareSourceVendorSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwareSourceVendorSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingVendorNameEnum(string(m.Name)); !ok && m.Name != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Name: %s. Supported values are: %s.", m.Name, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + for _, val := range m.OsFamilies { + if _, ok := GetMappingOsFamilyEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamilies: %s. Supported values are: %s.", val, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + } + + for _, val := range m.ArchTypes { + if _, ok := GetMappingArchTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchTypes: %s. Supported values are: %s.", val, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/software_sources_details.go b/osmanagementhub/software_sources_details.go new file mode 100644 index 0000000000..61cbfc2a81 --- /dev/null +++ b/osmanagementhub/software_sources_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareSourcesDetails The details about the software sources to be attached/detached. +type SoftwareSourcesDetails struct { + + // The list of software source OCIDs to be attached/detached. + SoftwareSources []string `mandatory:"true" json:"softwareSources"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m SoftwareSourcesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SoftwareSourcesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/sort_order.go b/osmanagementhub/sort_order.go new file mode 100644 index 0000000000..1057244cac --- /dev/null +++ b/osmanagementhub/sort_order.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +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/osmanagementhub/station_profile.go b/osmanagementhub/station_profile.go new file mode 100644 index 0000000000..416a96d043 --- /dev/null +++ b/osmanagementhub/station_profile.go @@ -0,0 +1,173 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StationProfile Definition of a registration profile of type STATION. +type StationProfile struct { + + // The OCID of the profile that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the registration profile. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The description of the registration profile. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the management station. + ManagementStationId *string `mandatory:"false" json:"managementStationId"` + + // The time the the registration profile was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The software source vendor name. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` + + // The operating system family. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The current state of the registration profile. + LifecycleState ProfileLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m StationProfile) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m StationProfile) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m StationProfile) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m StationProfile) GetDescription() *string { + return m.Description +} + +//GetManagementStationId returns ManagementStationId +func (m StationProfile) GetManagementStationId() *string { + return m.ManagementStationId +} + +//GetVendorName returns VendorName +func (m StationProfile) GetVendorName() VendorNameEnum { + return m.VendorName +} + +//GetOsFamily returns OsFamily +func (m StationProfile) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m StationProfile) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetTimeCreated returns TimeCreated +func (m StationProfile) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m StationProfile) GetLifecycleState() ProfileLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m StationProfile) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m StationProfile) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m StationProfile) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m StationProfile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m StationProfile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingProfileLifecycleStateEnum(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(GetProfileLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m StationProfile) MarshalJSON() (buff []byte, e error) { + type MarshalTypeStationProfile StationProfile + s := struct { + DiscriminatorParam string `json:"profileType"` + MarshalTypeStationProfile + }{ + "STATION", + (MarshalTypeStationProfile)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/summarize_managed_instance_analytics_request_response.go b/osmanagementhub/summarize_managed_instance_analytics_request_response.go new file mode 100644 index 0000000000..c50ecd6aa1 --- /dev/null +++ b/osmanagementhub/summarize_managed_instance_analytics_request_response.go @@ -0,0 +1,285 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SummarizeManagedInstanceAnalyticsRequest wrapper for the SummarizeManagedInstanceAnalytics operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SummarizeManagedInstanceAnalytics.go.html to see an example of how to use SummarizeManagedInstanceAnalyticsRequest. +type SummarizeManagedInstanceAnalyticsRequest struct { + + // A filter to return only metrics whose name matches the given metric names. + MetricNames []MetricNameEnum `contributesTo:"query" name:"metricNames" omitEmpty:"true" collectionFormat:"multi"` + + // This compartmentId is used to list managed instances within a compartment. + // Or serve as an additional filter to restrict only managed instances with in certain compartment if other filter presents. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID of the managed instance group for which to list resources. + ManagedInstanceGroupId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceGroupId"` + + // The OCID of the lifecycle environment. + LifecycleEnvironmentId *string `mandatory:"false" contributesTo:"query" name:"lifecycleEnvironmentId"` + + // The OCID of the lifecycle stage for which to list resources. + LifecycleStageId *string `mandatory:"false" contributesTo:"query" name:"lifecycleStageId"` + + // A filter to return only instances whose managed instance status matches the given status. + Status []ManagedInstanceStatusEnum `contributesTo:"query" name:"status" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return resources that match the given display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // A filter to return resources that may partially match the given display name. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // Filter instances by Location. Used when report target type is compartment or group. + InstanceLocation SummarizeManagedInstanceAnalyticsInstanceLocationEnum `mandatory:"false" contributesTo:"query" name:"instanceLocation" omitEmpty:"true"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `3` + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. Only one sort order may be provided. Default order for name is ascending. + SortBy SummarizeManagedInstanceAnalyticsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder SummarizeManagedInstanceAnalyticsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeManagedInstanceAnalyticsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeManagedInstanceAnalyticsRequest) 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 SummarizeManagedInstanceAnalyticsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeManagedInstanceAnalyticsRequest) 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 SummarizeManagedInstanceAnalyticsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.MetricNames { + if _, ok := GetMappingMetricNameEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MetricNames: %s. Supported values are: %s.", val, strings.Join(GetMetricNameEnumStringValues(), ","))) + } + } + + for _, val := range request.Status { + if _, ok := GetMappingManagedInstanceStatusEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", val, strings.Join(GetManagedInstanceStatusEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingSummarizeManagedInstanceAnalyticsInstanceLocationEnum(string(request.InstanceLocation)); !ok && request.InstanceLocation != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for InstanceLocation: %s. Supported values are: %s.", request.InstanceLocation, strings.Join(GetSummarizeManagedInstanceAnalyticsInstanceLocationEnumStringValues(), ","))) + } + if _, ok := GetMappingSummarizeManagedInstanceAnalyticsSortByEnum(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(GetSummarizeManagedInstanceAnalyticsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingSummarizeManagedInstanceAnalyticsSortOrderEnum(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(GetSummarizeManagedInstanceAnalyticsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SummarizeManagedInstanceAnalyticsResponse wrapper for the SummarizeManagedInstanceAnalytics operation +type SummarizeManagedInstanceAnalyticsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ManagedInstanceAnalyticCollection instances + ManagedInstanceAnalyticCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SummarizeManagedInstanceAnalyticsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeManagedInstanceAnalyticsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// SummarizeManagedInstanceAnalyticsInstanceLocationEnum Enum with underlying type: string +type SummarizeManagedInstanceAnalyticsInstanceLocationEnum string + +// Set of constants representing the allowable values for SummarizeManagedInstanceAnalyticsInstanceLocationEnum +const ( + SummarizeManagedInstanceAnalyticsInstanceLocationOnPremise SummarizeManagedInstanceAnalyticsInstanceLocationEnum = "ON_PREMISE" + SummarizeManagedInstanceAnalyticsInstanceLocationOciCompute SummarizeManagedInstanceAnalyticsInstanceLocationEnum = "OCI_COMPUTE" + SummarizeManagedInstanceAnalyticsInstanceLocationAzure SummarizeManagedInstanceAnalyticsInstanceLocationEnum = "AZURE" + SummarizeManagedInstanceAnalyticsInstanceLocationEc2 SummarizeManagedInstanceAnalyticsInstanceLocationEnum = "EC2" +) + +var mappingSummarizeManagedInstanceAnalyticsInstanceLocationEnum = map[string]SummarizeManagedInstanceAnalyticsInstanceLocationEnum{ + "ON_PREMISE": SummarizeManagedInstanceAnalyticsInstanceLocationOnPremise, + "OCI_COMPUTE": SummarizeManagedInstanceAnalyticsInstanceLocationOciCompute, + "AZURE": SummarizeManagedInstanceAnalyticsInstanceLocationAzure, + "EC2": SummarizeManagedInstanceAnalyticsInstanceLocationEc2, +} + +var mappingSummarizeManagedInstanceAnalyticsInstanceLocationEnumLowerCase = map[string]SummarizeManagedInstanceAnalyticsInstanceLocationEnum{ + "on_premise": SummarizeManagedInstanceAnalyticsInstanceLocationOnPremise, + "oci_compute": SummarizeManagedInstanceAnalyticsInstanceLocationOciCompute, + "azure": SummarizeManagedInstanceAnalyticsInstanceLocationAzure, + "ec2": SummarizeManagedInstanceAnalyticsInstanceLocationEc2, +} + +// GetSummarizeManagedInstanceAnalyticsInstanceLocationEnumValues Enumerates the set of values for SummarizeManagedInstanceAnalyticsInstanceLocationEnum +func GetSummarizeManagedInstanceAnalyticsInstanceLocationEnumValues() []SummarizeManagedInstanceAnalyticsInstanceLocationEnum { + values := make([]SummarizeManagedInstanceAnalyticsInstanceLocationEnum, 0) + for _, v := range mappingSummarizeManagedInstanceAnalyticsInstanceLocationEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeManagedInstanceAnalyticsInstanceLocationEnumStringValues Enumerates the set of values in String for SummarizeManagedInstanceAnalyticsInstanceLocationEnum +func GetSummarizeManagedInstanceAnalyticsInstanceLocationEnumStringValues() []string { + return []string{ + "ON_PREMISE", + "OCI_COMPUTE", + "AZURE", + "EC2", + } +} + +// GetMappingSummarizeManagedInstanceAnalyticsInstanceLocationEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeManagedInstanceAnalyticsInstanceLocationEnum(val string) (SummarizeManagedInstanceAnalyticsInstanceLocationEnum, bool) { + enum, ok := mappingSummarizeManagedInstanceAnalyticsInstanceLocationEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SummarizeManagedInstanceAnalyticsSortByEnum Enum with underlying type: string +type SummarizeManagedInstanceAnalyticsSortByEnum string + +// Set of constants representing the allowable values for SummarizeManagedInstanceAnalyticsSortByEnum +const ( + SummarizeManagedInstanceAnalyticsSortByName SummarizeManagedInstanceAnalyticsSortByEnum = "name" +) + +var mappingSummarizeManagedInstanceAnalyticsSortByEnum = map[string]SummarizeManagedInstanceAnalyticsSortByEnum{ + "name": SummarizeManagedInstanceAnalyticsSortByName, +} + +var mappingSummarizeManagedInstanceAnalyticsSortByEnumLowerCase = map[string]SummarizeManagedInstanceAnalyticsSortByEnum{ + "name": SummarizeManagedInstanceAnalyticsSortByName, +} + +// GetSummarizeManagedInstanceAnalyticsSortByEnumValues Enumerates the set of values for SummarizeManagedInstanceAnalyticsSortByEnum +func GetSummarizeManagedInstanceAnalyticsSortByEnumValues() []SummarizeManagedInstanceAnalyticsSortByEnum { + values := make([]SummarizeManagedInstanceAnalyticsSortByEnum, 0) + for _, v := range mappingSummarizeManagedInstanceAnalyticsSortByEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeManagedInstanceAnalyticsSortByEnumStringValues Enumerates the set of values in String for SummarizeManagedInstanceAnalyticsSortByEnum +func GetSummarizeManagedInstanceAnalyticsSortByEnumStringValues() []string { + return []string{ + "name", + } +} + +// GetMappingSummarizeManagedInstanceAnalyticsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeManagedInstanceAnalyticsSortByEnum(val string) (SummarizeManagedInstanceAnalyticsSortByEnum, bool) { + enum, ok := mappingSummarizeManagedInstanceAnalyticsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SummarizeManagedInstanceAnalyticsSortOrderEnum Enum with underlying type: string +type SummarizeManagedInstanceAnalyticsSortOrderEnum string + +// Set of constants representing the allowable values for SummarizeManagedInstanceAnalyticsSortOrderEnum +const ( + SummarizeManagedInstanceAnalyticsSortOrderAsc SummarizeManagedInstanceAnalyticsSortOrderEnum = "ASC" + SummarizeManagedInstanceAnalyticsSortOrderDesc SummarizeManagedInstanceAnalyticsSortOrderEnum = "DESC" +) + +var mappingSummarizeManagedInstanceAnalyticsSortOrderEnum = map[string]SummarizeManagedInstanceAnalyticsSortOrderEnum{ + "ASC": SummarizeManagedInstanceAnalyticsSortOrderAsc, + "DESC": SummarizeManagedInstanceAnalyticsSortOrderDesc, +} + +var mappingSummarizeManagedInstanceAnalyticsSortOrderEnumLowerCase = map[string]SummarizeManagedInstanceAnalyticsSortOrderEnum{ + "asc": SummarizeManagedInstanceAnalyticsSortOrderAsc, + "desc": SummarizeManagedInstanceAnalyticsSortOrderDesc, +} + +// GetSummarizeManagedInstanceAnalyticsSortOrderEnumValues Enumerates the set of values for SummarizeManagedInstanceAnalyticsSortOrderEnum +func GetSummarizeManagedInstanceAnalyticsSortOrderEnumValues() []SummarizeManagedInstanceAnalyticsSortOrderEnum { + values := make([]SummarizeManagedInstanceAnalyticsSortOrderEnum, 0) + for _, v := range mappingSummarizeManagedInstanceAnalyticsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeManagedInstanceAnalyticsSortOrderEnumStringValues Enumerates the set of values in String for SummarizeManagedInstanceAnalyticsSortOrderEnum +func GetSummarizeManagedInstanceAnalyticsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSummarizeManagedInstanceAnalyticsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeManagedInstanceAnalyticsSortOrderEnum(val string) (SummarizeManagedInstanceAnalyticsSortOrderEnum, bool) { + enum, ok := mappingSummarizeManagedInstanceAnalyticsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/switch_module_stream_on_managed_instance_details.go b/osmanagementhub/switch_module_stream_on_managed_instance_details.go new file mode 100644 index 0000000000..8344a19791 --- /dev/null +++ b/osmanagementhub/switch_module_stream_on_managed_instance_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SwitchModuleStreamOnManagedInstanceDetails The details of the module stream to be version switched on a managed instance. +type SwitchModuleStreamOnManagedInstanceDetails struct { + + // The name of a module. + ModuleName *string `mandatory:"true" json:"moduleName"` + + // The name of a stream of the specified module. + StreamName *string `mandatory:"true" json:"streamName"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m SwitchModuleStreamOnManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SwitchModuleStreamOnManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/switch_module_stream_on_managed_instance_request_response.go b/osmanagementhub/switch_module_stream_on_managed_instance_request_response.go new file mode 100644 index 0000000000..9c211a366d --- /dev/null +++ b/osmanagementhub/switch_module_stream_on_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SwitchModuleStreamOnManagedInstanceRequest wrapper for the SwitchModuleStreamOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SwitchModuleStreamOnManagedInstance.go.html to see an example of how to use SwitchModuleStreamOnManagedInstanceRequest. +type SwitchModuleStreamOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // The details of the module stream to be switched on a managed instance. + SwitchModuleStreamOnManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SwitchModuleStreamOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SwitchModuleStreamOnManagedInstanceRequest) 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 SwitchModuleStreamOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SwitchModuleStreamOnManagedInstanceRequest) 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 SwitchModuleStreamOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SwitchModuleStreamOnManagedInstanceResponse wrapper for the SwitchModuleStreamOnManagedInstance operation +type SwitchModuleStreamOnManagedInstanceResponse 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 SwitchModuleStreamOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SwitchModuleStreamOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/synchronize_mirrors_details.go b/osmanagementhub/synchronize_mirrors_details.go new file mode 100644 index 0000000000..7780656dd2 --- /dev/null +++ b/osmanagementhub/synchronize_mirrors_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SynchronizeMirrorsDetails Details for syncing selected mirrors +type SynchronizeMirrorsDetails struct { + + // List of Software Source OCIDs to synchronize + SoftwareSourceList []string `mandatory:"true" json:"softwareSourceList"` +} + +func (m SynchronizeMirrorsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SynchronizeMirrorsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/synchronize_mirrors_request_response.go b/osmanagementhub/synchronize_mirrors_request_response.go new file mode 100644 index 0000000000..b6ac141579 --- /dev/null +++ b/osmanagementhub/synchronize_mirrors_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SynchronizeMirrorsRequest wrapper for the SynchronizeMirrors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SynchronizeMirrors.go.html to see an example of how to use SynchronizeMirrorsRequest. +type SynchronizeMirrorsRequest struct { + + // The OCID of the management station. + ManagementStationId *string `mandatory:"true" contributesTo:"path" name:"managementStationId"` + + // Details for syncing mirrors + SynchronizeMirrorsDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SynchronizeMirrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SynchronizeMirrorsRequest) 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 SynchronizeMirrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SynchronizeMirrorsRequest) 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 SynchronizeMirrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SynchronizeMirrorsResponse wrapper for the SynchronizeMirrors operation +type SynchronizeMirrorsResponse 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 SynchronizeMirrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SynchronizeMirrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/synchronize_single_mirrors_request_response.go b/osmanagementhub/synchronize_single_mirrors_request_response.go new file mode 100644 index 0000000000..8b9b0098b6 --- /dev/null +++ b/osmanagementhub/synchronize_single_mirrors_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SynchronizeSingleMirrorsRequest wrapper for the SynchronizeSingleMirrors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/SynchronizeSingleMirrors.go.html to see an example of how to use SynchronizeSingleMirrorsRequest. +type SynchronizeSingleMirrorsRequest struct { + + // The OCID of the management station. + ManagementStationId *string `mandatory:"true" contributesTo:"path" name:"managementStationId"` + + // Unique Software Source identifier + MirrorId *string `mandatory:"true" contributesTo:"path" name:"mirrorId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SynchronizeSingleMirrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SynchronizeSingleMirrorsRequest) 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 SynchronizeSingleMirrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SynchronizeSingleMirrorsRequest) 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 SynchronizeSingleMirrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SynchronizeSingleMirrorsResponse wrapper for the SynchronizeSingleMirrors operation +type SynchronizeSingleMirrorsResponse 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 SynchronizeSingleMirrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SynchronizeSingleMirrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/target_resource_entity_type.go b/osmanagementhub/target_resource_entity_type.go new file mode 100644 index 0000000000..48ede0194f --- /dev/null +++ b/osmanagementhub/target_resource_entity_type.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// TargetResourceEntityTypeEnum Enum with underlying type: string +type TargetResourceEntityTypeEnum string + +// Set of constants representing the allowable values for TargetResourceEntityTypeEnum +const ( + TargetResourceEntityTypeInstance TargetResourceEntityTypeEnum = "INSTANCE" + TargetResourceEntityTypeGroup TargetResourceEntityTypeEnum = "GROUP" + TargetResourceEntityTypeCompartment TargetResourceEntityTypeEnum = "COMPARTMENT" + TargetResourceEntityTypeLifecycleEnvironment TargetResourceEntityTypeEnum = "LIFECYCLE_ENVIRONMENT" + TargetResourceEntityTypeSoftwareSource TargetResourceEntityTypeEnum = "SOFTWARE_SOURCE" +) + +var mappingTargetResourceEntityTypeEnum = map[string]TargetResourceEntityTypeEnum{ + "INSTANCE": TargetResourceEntityTypeInstance, + "GROUP": TargetResourceEntityTypeGroup, + "COMPARTMENT": TargetResourceEntityTypeCompartment, + "LIFECYCLE_ENVIRONMENT": TargetResourceEntityTypeLifecycleEnvironment, + "SOFTWARE_SOURCE": TargetResourceEntityTypeSoftwareSource, +} + +var mappingTargetResourceEntityTypeEnumLowerCase = map[string]TargetResourceEntityTypeEnum{ + "instance": TargetResourceEntityTypeInstance, + "group": TargetResourceEntityTypeGroup, + "compartment": TargetResourceEntityTypeCompartment, + "lifecycle_environment": TargetResourceEntityTypeLifecycleEnvironment, + "software_source": TargetResourceEntityTypeSoftwareSource, +} + +// GetTargetResourceEntityTypeEnumValues Enumerates the set of values for TargetResourceEntityTypeEnum +func GetTargetResourceEntityTypeEnumValues() []TargetResourceEntityTypeEnum { + values := make([]TargetResourceEntityTypeEnum, 0) + for _, v := range mappingTargetResourceEntityTypeEnum { + values = append(values, v) + } + return values +} + +// GetTargetResourceEntityTypeEnumStringValues Enumerates the set of values in String for TargetResourceEntityTypeEnum +func GetTargetResourceEntityTypeEnumStringValues() []string { + return []string{ + "INSTANCE", + "GROUP", + "COMPARTMENT", + "LIFECYCLE_ENVIRONMENT", + "SOFTWARE_SOURCE", + } +} + +// GetMappingTargetResourceEntityTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTargetResourceEntityTypeEnum(val string) (TargetResourceEntityTypeEnum, bool) { + enum, ok := mappingTargetResourceEntityTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/updatable_package_collection.go b/osmanagementhub/updatable_package_collection.go new file mode 100644 index 0000000000..2562c58718 --- /dev/null +++ b/osmanagementhub/updatable_package_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdatablePackageCollection Results of an updatable package search on a managed instance. +type UpdatablePackageCollection struct { + + // List of updatable packages. + Items []UpdatablePackageSummary `mandatory:"true" json:"items"` +} + +func (m UpdatablePackageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdatablePackageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/updatable_package_summary.go b/osmanagementhub/updatable_package_summary.go new file mode 100644 index 0000000000..23de68b595 --- /dev/null +++ b/osmanagementhub/updatable_package_summary.go @@ -0,0 +1,118 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdatablePackageSummary A software package available for install on a managed instance. +type UpdatablePackageSummary struct { + + // Package name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Unique identifier for the package. + Name *string `mandatory:"true" json:"name"` + + // Type of the package. + Type *string `mandatory:"true" json:"type"` + + // Version of the installed package. + Version *string `mandatory:"true" json:"version"` + + // list of software sources that provide the software package. + SoftwareSources []SoftwareSourceDetails `mandatory:"false" json:"softwareSources"` + + // The version of this upgradable package already installed on the instance. + InstalledVersion *string `mandatory:"false" json:"installedVersion"` + + // List of errata containing this update. + Errata []string `mandatory:"false" json:"errata"` + + // List of CVEs applicable to this erratum. + RelatedCves []string `mandatory:"false" json:"relatedCves"` + + // The architecture for which this package was built. + Architecture ArchTypeEnum `mandatory:"false" json:"architecture,omitempty"` + + // The classification of this update. + UpdateType ClassificationTypesEnum `mandatory:"true" json:"updateType"` +} + +//GetDisplayName returns DisplayName +func (m UpdatablePackageSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetName returns Name +func (m UpdatablePackageSummary) GetName() *string { + return m.Name +} + +//GetType returns Type +func (m UpdatablePackageSummary) GetType() *string { + return m.Type +} + +//GetVersion returns Version +func (m UpdatablePackageSummary) GetVersion() *string { + return m.Version +} + +//GetArchitecture returns Architecture +func (m UpdatablePackageSummary) GetArchitecture() ArchTypeEnum { + return m.Architecture +} + +//GetSoftwareSources returns SoftwareSources +func (m UpdatablePackageSummary) GetSoftwareSources() []SoftwareSourceDetails { + return m.SoftwareSources +} + +func (m UpdatablePackageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdatablePackageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArchTypeEnum(string(m.Architecture)); !ok && m.Architecture != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Architecture: %s. Supported values are: %s.", m.Architecture, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingClassificationTypesEnum(string(m.UpdateType)); !ok && m.UpdateType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UpdateType: %s. Supported values are: %s.", m.UpdateType, strings.Join(GetClassificationTypesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdatablePackageSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdatablePackageSummary UpdatablePackageSummary + s := struct { + DiscriminatorParam string `json:"packageClassification"` + MarshalTypeUpdatablePackageSummary + }{ + "UPDATABLE", + (MarshalTypeUpdatablePackageSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/update_all_packages_on_managed_instance_group_details.go b/osmanagementhub/update_all_packages_on_managed_instance_group_details.go new file mode 100644 index 0000000000..da844b92a9 --- /dev/null +++ b/osmanagementhub/update_all_packages_on_managed_instance_group_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateAllPackagesOnManagedInstanceGroupDetails The work request details for the update operation on the managed instance group. +type UpdateAllPackagesOnManagedInstanceGroupDetails struct { + + // The type of updates to be applied. + UpdateTypes []UpdateTypesEnum `mandatory:"false" json:"updateTypes,omitempty"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m UpdateAllPackagesOnManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateAllPackagesOnManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.UpdateTypes { + if _, ok := GetMappingUpdateTypesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UpdateTypes: %s. Supported values are: %s.", val, strings.Join(GetUpdateTypesEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_all_packages_on_managed_instance_group_request_response.go b/osmanagementhub/update_all_packages_on_managed_instance_group_request_response.go new file mode 100644 index 0000000000..a575b5913b --- /dev/null +++ b/osmanagementhub/update_all_packages_on_managed_instance_group_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateAllPackagesOnManagedInstanceGroupRequest wrapper for the UpdateAllPackagesOnManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateAllPackagesOnManagedInstanceGroup.go.html to see an example of how to use UpdateAllPackagesOnManagedInstanceGroupRequest. +type UpdateAllPackagesOnManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // Details for update operation on the managed instance group. + UpdateAllPackagesOnManagedInstanceGroupDetails `contributesTo:"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 `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 UpdateAllPackagesOnManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAllPackagesOnManagedInstanceGroupRequest) 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 UpdateAllPackagesOnManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAllPackagesOnManagedInstanceGroupRequest) 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 UpdateAllPackagesOnManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateAllPackagesOnManagedInstanceGroupResponse wrapper for the UpdateAllPackagesOnManagedInstanceGroup operation +type UpdateAllPackagesOnManagedInstanceGroupResponse 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 UpdateAllPackagesOnManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAllPackagesOnManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_all_packages_on_managed_instances_in_compartment_details.go b/osmanagementhub/update_all_packages_on_managed_instances_in_compartment_details.go new file mode 100644 index 0000000000..b5c7b7d2cd --- /dev/null +++ b/osmanagementhub/update_all_packages_on_managed_instances_in_compartment_details.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateAllPackagesOnManagedInstancesInCompartmentDetails The details about the package types to be updated. +type UpdateAllPackagesOnManagedInstancesInCompartmentDetails struct { + + // The compartment being targeted by this operation. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The type of updates to be applied. + UpdateTypes []UpdateTypesEnum `mandatory:"false" json:"updateTypes,omitempty"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m UpdateAllPackagesOnManagedInstancesInCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateAllPackagesOnManagedInstancesInCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.UpdateTypes { + if _, ok := GetMappingUpdateTypesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UpdateTypes: %s. Supported values are: %s.", val, strings.Join(GetUpdateTypesEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_all_packages_on_managed_instances_in_compartment_request_response.go b/osmanagementhub/update_all_packages_on_managed_instances_in_compartment_request_response.go new file mode 100644 index 0000000000..8dea833f29 --- /dev/null +++ b/osmanagementhub/update_all_packages_on_managed_instances_in_compartment_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateAllPackagesOnManagedInstancesInCompartmentRequest wrapper for the UpdateAllPackagesOnManagedInstancesInCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateAllPackagesOnManagedInstancesInCompartment.go.html to see an example of how to use UpdateAllPackagesOnManagedInstancesInCompartmentRequest. +type UpdateAllPackagesOnManagedInstancesInCompartmentRequest struct { + + // The details about package types are to be updated on all managed instances in a compartment. + UpdateAllPackagesOnManagedInstancesInCompartmentDetails `contributesTo:"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 `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 UpdateAllPackagesOnManagedInstancesInCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAllPackagesOnManagedInstancesInCompartmentRequest) 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 UpdateAllPackagesOnManagedInstancesInCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAllPackagesOnManagedInstancesInCompartmentRequest) 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 UpdateAllPackagesOnManagedInstancesInCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateAllPackagesOnManagedInstancesInCompartmentResponse wrapper for the UpdateAllPackagesOnManagedInstancesInCompartment operation +type UpdateAllPackagesOnManagedInstancesInCompartmentResponse 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 UpdateAllPackagesOnManagedInstancesInCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAllPackagesOnManagedInstancesInCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_custom_software_source_details.go b/osmanagementhub/update_custom_software_source_details.go new file mode 100644 index 0000000000..6ff4b7fc9f --- /dev/null +++ b/osmanagementhub/update_custom_software_source_details.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateCustomSoftwareSourceDetails Information for updating a custom or software source. +type UpdateCustomSoftwareSourceDetails struct { + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // List of vendor software sources. + VendorSoftwareSources []Id `mandatory:"false" json:"vendorSoftwareSources"` + + CustomSoftwareSourceFilter *CustomSoftwareSourceFilter `mandatory:"false" json:"customSoftwareSourceFilter"` + + // Indicates whether service should automatically update the custom software source for the user. + IsAutomaticallyUpdated *bool `mandatory:"false" json:"isAutomaticallyUpdated"` +} + +//GetCompartmentId returns CompartmentId +func (m UpdateCustomSoftwareSourceDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m UpdateCustomSoftwareSourceDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m UpdateCustomSoftwareSourceDetails) GetDescription() *string { + return m.Description +} + +//GetFreeformTags returns FreeformTags +func (m UpdateCustomSoftwareSourceDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m UpdateCustomSoftwareSourceDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateCustomSoftwareSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateCustomSoftwareSourceDetails) 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 UpdateCustomSoftwareSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateCustomSoftwareSourceDetails UpdateCustomSoftwareSourceDetails + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeUpdateCustomSoftwareSourceDetails + }{ + "CUSTOM", + (MarshalTypeUpdateCustomSoftwareSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/update_lifecycle_environment_details.go b/osmanagementhub/update_lifecycle_environment_details.go new file mode 100644 index 0000000000..d08d774de3 --- /dev/null +++ b/osmanagementhub/update_lifecycle_environment_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateLifecycleEnvironmentDetails The information to be updated. +type UpdateLifecycleEnvironmentDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // User specified information about the lifecycle environment. Does not have to be unique, and it's changeable. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // The list of lifecycle stages to be updated. + Stages []UpdateLifecycleStageDetails `mandatory:"false" json:"stages"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateLifecycleEnvironmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateLifecycleEnvironmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_lifecycle_environment_request_response.go b/osmanagementhub/update_lifecycle_environment_request_response.go new file mode 100644 index 0000000000..ddf296cdf2 --- /dev/null +++ b/osmanagementhub/update_lifecycle_environment_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateLifecycleEnvironmentRequest wrapper for the UpdateLifecycleEnvironment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateLifecycleEnvironment.go.html to see an example of how to use UpdateLifecycleEnvironmentRequest. +type UpdateLifecycleEnvironmentRequest struct { + + // The OCID of the lifecycle environment. + LifecycleEnvironmentId *string `mandatory:"true" contributesTo:"path" name:"lifecycleEnvironmentId"` + + // The information to be updated. + UpdateLifecycleEnvironmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 UpdateLifecycleEnvironmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateLifecycleEnvironmentRequest) 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 UpdateLifecycleEnvironmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateLifecycleEnvironmentRequest) 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 UpdateLifecycleEnvironmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateLifecycleEnvironmentResponse wrapper for the UpdateLifecycleEnvironment operation +type UpdateLifecycleEnvironmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The LifecycleEnvironment instance + LifecycleEnvironment `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 UpdateLifecycleEnvironmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateLifecycleEnvironmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_lifecycle_stage_details.go b/osmanagementhub/update_lifecycle_stage_details.go new file mode 100644 index 0000000000..c8bbee4e25 --- /dev/null +++ b/osmanagementhub/update_lifecycle_stage_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateLifecycleStageDetails The information to be updated. +type UpdateLifecycleStageDetails struct { + + // The lifecycle stage OCID that is immutable on creation. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateLifecycleStageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateLifecycleStageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_managed_instance_details.go b/osmanagementhub/update_managed_instance_details.go new file mode 100644 index 0000000000..3fbdf0a9f9 --- /dev/null +++ b/osmanagementhub/update_managed_instance_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateManagedInstanceDetails The information to be updated. +type UpdateManagedInstanceDetails struct { + + // The OCID of a management station to be used as the preferred primary. + PrimaryManagementStationId *string `mandatory:"false" json:"primaryManagementStationId"` + + // The OCID of a management station to be used as the preferred secondary. + SecondaryManagementStationId *string `mandatory:"false" json:"secondaryManagementStationId"` +} + +func (m UpdateManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_managed_instance_group_details.go b/osmanagementhub/update_managed_instance_group_details.go new file mode 100644 index 0000000000..9e6219cc2d --- /dev/null +++ b/osmanagementhub/update_managed_instance_group_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateManagedInstanceGroupDetails The information to be updated. +type UpdateManagedInstanceGroupDetails struct { + + // A user-friendly name for the managed instance group job. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // User specified information about the managed instance group. Does not have to be unique, and it's changeable. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateManagedInstanceGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateManagedInstanceGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_managed_instance_group_request_response.go b/osmanagementhub/update_managed_instance_group_request_response.go new file mode 100644 index 0000000000..ca58067db6 --- /dev/null +++ b/osmanagementhub/update_managed_instance_group_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateManagedInstanceGroupRequest wrapper for the UpdateManagedInstanceGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateManagedInstanceGroup.go.html to see an example of how to use UpdateManagedInstanceGroupRequest. +type UpdateManagedInstanceGroupRequest struct { + + // The managed instance group OCID. + ManagedInstanceGroupId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceGroupId"` + + // The information to be updated. + UpdateManagedInstanceGroupDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 UpdateManagedInstanceGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateManagedInstanceGroupRequest) 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 UpdateManagedInstanceGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateManagedInstanceGroupRequest) 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 UpdateManagedInstanceGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateManagedInstanceGroupResponse wrapper for the UpdateManagedInstanceGroup operation +type UpdateManagedInstanceGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagedInstanceGroup instance + ManagedInstanceGroup `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 UpdateManagedInstanceGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateManagedInstanceGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_managed_instance_request_response.go b/osmanagementhub/update_managed_instance_request_response.go new file mode 100644 index 0000000000..19c952d375 --- /dev/null +++ b/osmanagementhub/update_managed_instance_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateManagedInstanceRequest wrapper for the UpdateManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateManagedInstance.go.html to see an example of how to use UpdateManagedInstanceRequest. +type UpdateManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // Details about a managed instance to be updated. + UpdateManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 UpdateManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateManagedInstanceRequest) 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 UpdateManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateManagedInstanceRequest) 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 UpdateManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateManagedInstanceResponse wrapper for the UpdateManagedInstance operation +type UpdateManagedInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagedInstance instance + ManagedInstance `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 UpdateManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_management_station_details.go b/osmanagementhub/update_management_station_details.go new file mode 100644 index 0000000000..93c7878c22 --- /dev/null +++ b/osmanagementhub/update_management_station_details.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateManagementStationDetails Information for updating an ManagementStation +type UpdateManagementStationDetails struct { + + // ManagementStation name + DisplayName *string `mandatory:"false" json:"displayName"` + + // Details describing the ManagementStation config. + Description *string `mandatory:"false" json:"description"` + + // Name of the host + Hostname *string `mandatory:"false" json:"hostname"` + + Proxy *UpdateProxyConfigurationDetails `mandatory:"false" json:"proxy"` + + Mirror *UpdateMirrorConfigurationDetails `mandatory:"false" json:"mirror"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateManagementStationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateManagementStationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_management_station_request_response.go b/osmanagementhub/update_management_station_request_response.go new file mode 100644 index 0000000000..00f1ad343c --- /dev/null +++ b/osmanagementhub/update_management_station_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateManagementStationRequest wrapper for the UpdateManagementStation operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateManagementStation.go.html to see an example of how to use UpdateManagementStationRequest. +type UpdateManagementStationRequest struct { + + // The OCID of the management station. + ManagementStationId *string `mandatory:"true" contributesTo:"path" name:"managementStationId"` + + // The information to be updated. + UpdateManagementStationDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 UpdateManagementStationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateManagementStationRequest) 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 UpdateManagementStationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateManagementStationRequest) 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 UpdateManagementStationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateManagementStationResponse wrapper for the UpdateManagementStation operation +type UpdateManagementStationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ManagementStation instance + ManagementStation `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 UpdateManagementStationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateManagementStationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_mirror_configuration_details.go b/osmanagementhub/update_mirror_configuration_details.go new file mode 100644 index 0000000000..9eefe90ed5 --- /dev/null +++ b/osmanagementhub/update_mirror_configuration_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateMirrorConfigurationDetails Information for updating a mirror configuration +type UpdateMirrorConfigurationDetails struct { + + // Directory for the mirroring + Directory *string `mandatory:"true" json:"directory"` + + // Default port for the mirror + Port *string `mandatory:"true" json:"port"` + + // Default sslport for the mirror + Sslport *string `mandatory:"true" json:"sslport"` + + // Local path for the sslcert + Sslcert *string `mandatory:"false" json:"sslcert"` +} + +func (m UpdateMirrorConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateMirrorConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_packages_on_managed_instance_details.go b/osmanagementhub/update_packages_on_managed_instance_details.go new file mode 100644 index 0000000000..b4b8eb51f1 --- /dev/null +++ b/osmanagementhub/update_packages_on_managed_instance_details.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdatePackagesOnManagedInstanceDetails The details about the software packages to be updated. +type UpdatePackagesOnManagedInstanceDetails struct { + + // The list of package names. + PackageNames []string `mandatory:"false" json:"packageNames"` + + // The type of updates to be applied. + UpdateTypes []UpdateTypesEnum `mandatory:"false" json:"updateTypes,omitempty"` + + WorkRequestDetails *WorkRequestDetails `mandatory:"false" json:"workRequestDetails"` +} + +func (m UpdatePackagesOnManagedInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdatePackagesOnManagedInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.UpdateTypes { + if _, ok := GetMappingUpdateTypesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UpdateTypes: %s. Supported values are: %s.", val, strings.Join(GetUpdateTypesEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_packages_on_managed_instance_request_response.go b/osmanagementhub/update_packages_on_managed_instance_request_response.go new file mode 100644 index 0000000000..e841301946 --- /dev/null +++ b/osmanagementhub/update_packages_on_managed_instance_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdatePackagesOnManagedInstanceRequest wrapper for the UpdatePackagesOnManagedInstance operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdatePackagesOnManagedInstance.go.html to see an example of how to use UpdatePackagesOnManagedInstanceRequest. +type UpdatePackagesOnManagedInstanceRequest struct { + + // The OCID of the managed instance. + ManagedInstanceId *string `mandatory:"true" contributesTo:"path" name:"managedInstanceId"` + + // Details about packages to be updated on a managed instance. + UpdatePackagesOnManagedInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdatePackagesOnManagedInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdatePackagesOnManagedInstanceRequest) 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 UpdatePackagesOnManagedInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePackagesOnManagedInstanceRequest) 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 UpdatePackagesOnManagedInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdatePackagesOnManagedInstanceResponse wrapper for the UpdatePackagesOnManagedInstance operation +type UpdatePackagesOnManagedInstanceResponse 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 UpdatePackagesOnManagedInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePackagesOnManagedInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_profile_details.go b/osmanagementhub/update_profile_details.go new file mode 100644 index 0000000000..09e0e1e647 --- /dev/null +++ b/osmanagementhub/update_profile_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateProfileDetails Information for updating a registration profile +type UpdateProfileDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Details describing the scheduled job. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateProfileDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_profile_request_response.go b/osmanagementhub/update_profile_request_response.go new file mode 100644 index 0000000000..78308283a9 --- /dev/null +++ b/osmanagementhub/update_profile_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateProfileRequest wrapper for the UpdateProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateProfile.go.html to see an example of how to use UpdateProfileRequest. +type UpdateProfileRequest struct { + + // The OCID of the registration profile. + ProfileId *string `mandatory:"true" contributesTo:"path" name:"profileId"` + + // The information to be updated. + UpdateProfileDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 UpdateProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateProfileRequest) 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 UpdateProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateProfileRequest) 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 UpdateProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateProfileResponse wrapper for the UpdateProfile operation +type UpdateProfileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Profile instance + Profile `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 UpdateProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_proxy_configuration_details.go b/osmanagementhub/update_proxy_configuration_details.go new file mode 100644 index 0000000000..c8ddb1e8c2 --- /dev/null +++ b/osmanagementhub/update_proxy_configuration_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateProxyConfigurationDetails Information for updating a proxy configuration +type UpdateProxyConfigurationDetails struct { + + // To enable or disable the proxy (default true) + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // List of hosts + Hosts []string `mandatory:"false" json:"hosts"` + + // Port that the proxy will use + Port *string `mandatory:"false" json:"port"` + + // URL that the proxy will forward to + Forward *string `mandatory:"false" json:"forward"` +} + +func (m UpdateProxyConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateProxyConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_scheduled_job_details.go b/osmanagementhub/update_scheduled_job_details.go new file mode 100644 index 0000000000..5236d042e8 --- /dev/null +++ b/osmanagementhub/update_scheduled_job_details.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateScheduledJobDetails Information for updating a scheduled job. +type UpdateScheduledJobDetails struct { + + // Scheduled job name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Details describing the scheduled job. + Description *string `mandatory:"false" json:"description"` + + // The type of scheduling this scheduled job follows. + ScheduleType ScheduleTypesEnum `mandatory:"false" json:"scheduleType,omitempty"` + + // The desired time for the next execution of this scheduled job. + TimeNextExecution *common.SDKTime `mandatory:"false" json:"timeNextExecution"` + + // The recurring rule for a recurring scheduled job. + RecurringRule *string `mandatory:"false" json:"recurringRule"` + + // The list of operations this scheduled job needs to perform (can only support one operation if the operationType is not UPDATE_PACKAGES/UPDATE_ALL/UPDATE_SECURITY/UPDATE_BUGFIX/UPDATE_ENHANCEMENT/UPDATE_OTHER/UPDATE_KSPLICE_USERSPACE/UPDATE_KSPLICE_KERNEL). + Operations []ScheduledJobOperation `mandatory:"false" json:"operations"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateScheduledJobDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateScheduledJobDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingScheduleTypesEnum(string(m.ScheduleType)); !ok && m.ScheduleType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduleType: %s. Supported values are: %s.", m.ScheduleType, strings.Join(GetScheduleTypesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_scheduled_job_request_response.go b/osmanagementhub/update_scheduled_job_request_response.go new file mode 100644 index 0000000000..bda141d36b --- /dev/null +++ b/osmanagementhub/update_scheduled_job_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateScheduledJobRequest wrapper for the UpdateScheduledJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateScheduledJob.go.html to see an example of how to use UpdateScheduledJobRequest. +type UpdateScheduledJobRequest struct { + + // The OCID of the scheduled job. + ScheduledJobId *string `mandatory:"true" contributesTo:"path" name:"scheduledJobId"` + + // The information to be updated. + UpdateScheduledJobDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + 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 UpdateScheduledJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateScheduledJobRequest) 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 UpdateScheduledJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateScheduledJobRequest) 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 UpdateScheduledJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateScheduledJobResponse wrapper for the UpdateScheduledJob operation +type UpdateScheduledJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ScheduledJob instance + ScheduledJob `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 UpdateScheduledJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateScheduledJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_software_source_details.go b/osmanagementhub/update_software_source_details.go new file mode 100644 index 0000000000..4158f21738 --- /dev/null +++ b/osmanagementhub/update_software_source_details.go @@ -0,0 +1,136 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateSoftwareSourceDetails Information for updating a software source. +type UpdateSoftwareSourceDetails interface { + + // The OCID of the tenancy containing the software source. + GetCompartmentId() *string + + // User friendly name for the software source. + GetDisplayName() *string + + // Information specified by the user about the software source. + GetDescription() *string + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type updatesoftwaresourcedetails struct { + JsonData []byte + CompartmentId *string `mandatory:"false" json:"compartmentId"` + DisplayName *string `mandatory:"false" json:"displayName"` + Description *string `mandatory:"false" json:"description"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SoftwareSourceType string `json:"softwareSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *updatesoftwaresourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdatesoftwaresourcedetails updatesoftwaresourcedetails + s := struct { + Model Unmarshalerupdatesoftwaresourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.DisplayName = s.Model.DisplayName + m.Description = s.Model.Description + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SoftwareSourceType = s.Model.SoftwareSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updatesoftwaresourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SoftwareSourceType { + case "CUSTOM": + mm := UpdateCustomSoftwareSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VENDOR": + mm := UpdateVendorSoftwareSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateSoftwareSourceDetails: %s.", m.SoftwareSourceType) + return *m, nil + } +} + +//GetCompartmentId returns CompartmentId +func (m updatesoftwaresourcedetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m updatesoftwaresourcedetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m updatesoftwaresourcedetails) GetDescription() *string { + return m.Description +} + +//GetFreeformTags returns FreeformTags +func (m updatesoftwaresourcedetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m updatesoftwaresourcedetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m updatesoftwaresourcedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updatesoftwaresourcedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/update_software_source_request_response.go b/osmanagementhub/update_software_source_request_response.go new file mode 100644 index 0000000000..5c3c53beca --- /dev/null +++ b/osmanagementhub/update_software_source_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateSoftwareSourceRequest wrapper for the UpdateSoftwareSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/osmanagementhub/UpdateSoftwareSource.go.html to see an example of how to use UpdateSoftwareSourceRequest. +type UpdateSoftwareSourceRequest struct { + + // The software source OCID. + SoftwareSourceId *string `mandatory:"true" contributesTo:"path" name:"softwareSourceId"` + + // The information to be updated. + UpdateSoftwareSourceDetails `contributesTo:"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 `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 UpdateSoftwareSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSoftwareSourceRequest) 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 UpdateSoftwareSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSoftwareSourceRequest) 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 UpdateSoftwareSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateSoftwareSourceResponse wrapper for the UpdateSoftwareSource operation +type UpdateSoftwareSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SoftwareSource instance + SoftwareSource `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"` + + // 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 UpdateSoftwareSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSoftwareSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/osmanagementhub/update_types.go b/osmanagementhub/update_types.go new file mode 100644 index 0000000000..e982f18cf0 --- /dev/null +++ b/osmanagementhub/update_types.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// UpdateTypesEnum Enum with underlying type: string +type UpdateTypesEnum string + +// Set of constants representing the allowable values for UpdateTypesEnum +const ( + UpdateTypesSecurity UpdateTypesEnum = "SECURITY" + UpdateTypesBugfix UpdateTypesEnum = "BUGFIX" + UpdateTypesEnhancement UpdateTypesEnum = "ENHANCEMENT" + UpdateTypesOther UpdateTypesEnum = "OTHER" + UpdateTypesKspliceKernel UpdateTypesEnum = "KSPLICE_KERNEL" + UpdateTypesKspliceUserspace UpdateTypesEnum = "KSPLICE_USERSPACE" + UpdateTypesAll UpdateTypesEnum = "ALL" +) + +var mappingUpdateTypesEnum = map[string]UpdateTypesEnum{ + "SECURITY": UpdateTypesSecurity, + "BUGFIX": UpdateTypesBugfix, + "ENHANCEMENT": UpdateTypesEnhancement, + "OTHER": UpdateTypesOther, + "KSPLICE_KERNEL": UpdateTypesKspliceKernel, + "KSPLICE_USERSPACE": UpdateTypesKspliceUserspace, + "ALL": UpdateTypesAll, +} + +var mappingUpdateTypesEnumLowerCase = map[string]UpdateTypesEnum{ + "security": UpdateTypesSecurity, + "bugfix": UpdateTypesBugfix, + "enhancement": UpdateTypesEnhancement, + "other": UpdateTypesOther, + "ksplice_kernel": UpdateTypesKspliceKernel, + "ksplice_userspace": UpdateTypesKspliceUserspace, + "all": UpdateTypesAll, +} + +// GetUpdateTypesEnumValues Enumerates the set of values for UpdateTypesEnum +func GetUpdateTypesEnumValues() []UpdateTypesEnum { + values := make([]UpdateTypesEnum, 0) + for _, v := range mappingUpdateTypesEnum { + values = append(values, v) + } + return values +} + +// GetUpdateTypesEnumStringValues Enumerates the set of values in String for UpdateTypesEnum +func GetUpdateTypesEnumStringValues() []string { + return []string{ + "SECURITY", + "BUGFIX", + "ENHANCEMENT", + "OTHER", + "KSPLICE_KERNEL", + "KSPLICE_USERSPACE", + "ALL", + } +} + +// GetMappingUpdateTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUpdateTypesEnum(val string) (UpdateTypesEnum, bool) { + enum, ok := mappingUpdateTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/update_vendor_software_source_details.go b/osmanagementhub/update_vendor_software_source_details.go new file mode 100644 index 0000000000..b29e563ad6 --- /dev/null +++ b/osmanagementhub/update_vendor_software_source_details.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateVendorSoftwareSourceDetails Information for updating a vendor source. Tags only. +type UpdateVendorSoftwareSourceDetails struct { + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +//GetCompartmentId returns CompartmentId +func (m UpdateVendorSoftwareSourceDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m UpdateVendorSoftwareSourceDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m UpdateVendorSoftwareSourceDetails) GetDescription() *string { + return m.Description +} + +//GetFreeformTags returns FreeformTags +func (m UpdateVendorSoftwareSourceDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m UpdateVendorSoftwareSourceDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateVendorSoftwareSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateVendorSoftwareSourceDetails) 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 UpdateVendorSoftwareSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateVendorSoftwareSourceDetails UpdateVendorSoftwareSourceDetails + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeUpdateVendorSoftwareSourceDetails + }{ + "VENDOR", + (MarshalTypeUpdateVendorSoftwareSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/update_work_request_details.go b/osmanagementhub/update_work_request_details.go new file mode 100644 index 0000000000..cc0f9e88a1 --- /dev/null +++ b/osmanagementhub/update_work_request_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateWorkRequestDetails Detail information for updating a work request. +type UpdateWorkRequestDetails struct { + + // status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The percentage complete of the operation tracked by this work request. + PercentComplete *float32 `mandatory:"false" json:"percentComplete"` + + // 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"` + + // A short description about the work request. + Description *string `mandatory:"false" json:"description"` + + // A short display for about the work request. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m UpdateWorkRequestDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateWorkRequestDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + 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/osmanagementhub/vendor_name.go b/osmanagementhub/vendor_name.go new file mode 100644 index 0000000000..8faed24516 --- /dev/null +++ b/osmanagementhub/vendor_name.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// VendorNameEnum Enum with underlying type: string +type VendorNameEnum string + +// Set of constants representing the allowable values for VendorNameEnum +const ( + VendorNameOracle VendorNameEnum = "ORACLE" +) + +var mappingVendorNameEnum = map[string]VendorNameEnum{ + "ORACLE": VendorNameOracle, +} + +var mappingVendorNameEnumLowerCase = map[string]VendorNameEnum{ + "oracle": VendorNameOracle, +} + +// GetVendorNameEnumValues Enumerates the set of values for VendorNameEnum +func GetVendorNameEnumValues() []VendorNameEnum { + values := make([]VendorNameEnum, 0) + for _, v := range mappingVendorNameEnum { + values = append(values, v) + } + return values +} + +// GetVendorNameEnumStringValues Enumerates the set of values in String for VendorNameEnum +func GetVendorNameEnumStringValues() []string { + return []string{ + "ORACLE", + } +} + +// GetMappingVendorNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingVendorNameEnum(val string) (VendorNameEnum, bool) { + enum, ok := mappingVendorNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/vendor_software_source.go b/osmanagementhub/vendor_software_source.go new file mode 100644 index 0000000000..6fcb9db603 --- /dev/null +++ b/osmanagementhub/vendor_software_source.go @@ -0,0 +1,231 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VendorSoftwareSource A vendor software source contains a collection of packages. +type VendorSoftwareSource struct { + + // OCID for the software source. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The Repo ID for the software source. + RepoId *string `mandatory:"true" json:"repoId"` + + // URL for the repository. + Url *string `mandatory:"true" json:"url"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Number of packages. + PackageCount *int64 `mandatory:"false" json:"packageCount"` + + // URL of the GPG key for this software source. + GpgKeyUrl *string `mandatory:"false" json:"gpgKeyUrl"` + + // ID of the GPG key for this software source. + GpgKeyId *string `mandatory:"false" json:"gpgKeyId"` + + // Fingerprint of the GPG key for this software source. + GpgKeyFingerprint *string `mandatory:"false" json:"gpgKeyFingerprint"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Possible availabilities of a software source. + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + + // The OS family the software source belongs to. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type supported by the software source. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The current state of the software source. + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The yum repository checksum type used by this software source. + ChecksumType ChecksumTypeEnum `mandatory:"false" json:"checksumType,omitempty"` + + // Name of the vendor providing the software source. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` +} + +//GetId returns Id +func (m VendorSoftwareSource) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m VendorSoftwareSource) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m VendorSoftwareSource) GetDisplayName() *string { + return m.DisplayName +} + +//GetTimeCreated returns TimeCreated +func (m VendorSoftwareSource) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetDescription returns Description +func (m VendorSoftwareSource) GetDescription() *string { + return m.Description +} + +//GetAvailability returns Availability +func (m VendorSoftwareSource) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetRepoId returns RepoId +func (m VendorSoftwareSource) GetRepoId() *string { + return m.RepoId +} + +//GetOsFamily returns OsFamily +func (m VendorSoftwareSource) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m VendorSoftwareSource) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetLifecycleState returns LifecycleState +func (m VendorSoftwareSource) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetPackageCount returns PackageCount +func (m VendorSoftwareSource) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetUrl returns Url +func (m VendorSoftwareSource) GetUrl() *string { + return m.Url +} + +//GetChecksumType returns ChecksumType +func (m VendorSoftwareSource) GetChecksumType() ChecksumTypeEnum { + return m.ChecksumType +} + +//GetGpgKeyUrl returns GpgKeyUrl +func (m VendorSoftwareSource) GetGpgKeyUrl() *string { + return m.GpgKeyUrl +} + +//GetGpgKeyId returns GpgKeyId +func (m VendorSoftwareSource) GetGpgKeyId() *string { + return m.GpgKeyId +} + +//GetGpgKeyFingerprint returns GpgKeyFingerprint +func (m VendorSoftwareSource) GetGpgKeyFingerprint() *string { + return m.GpgKeyFingerprint +} + +//GetFreeformTags returns FreeformTags +func (m VendorSoftwareSource) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m VendorSoftwareSource) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m VendorSoftwareSource) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m VendorSoftwareSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VendorSoftwareSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingChecksumTypeEnum(string(m.ChecksumType)); !ok && m.ChecksumType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ChecksumType: %s. Supported values are: %s.", m.ChecksumType, strings.Join(GetChecksumTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m VendorSoftwareSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVendorSoftwareSource VendorSoftwareSource + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeVendorSoftwareSource + }{ + "VENDOR", + (MarshalTypeVendorSoftwareSource)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/vendor_software_source_summary.go b/osmanagementhub/vendor_software_source_summary.go new file mode 100644 index 0000000000..8b186af780 --- /dev/null +++ b/osmanagementhub/vendor_software_source_summary.go @@ -0,0 +1,205 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VendorSoftwareSourceSummary A vendor software source summary summarizes a vendor software source. +type VendorSoftwareSourceSummary struct { + + // The OCID for the software source. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The Repo ID for the software source. + RepoId *string `mandatory:"true" json:"repoId"` + + // URL for the repository. + Url *string `mandatory:"true" json:"url"` + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time of when the software source was updated as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Number of packages. + PackageCount *int64 `mandatory:"false" json:"packageCount"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The current state of the software source. + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Possible availabilities of a software source. + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + + // The OS family the software source belongs to. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type supported by the software source. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // Name of the vendor providing the software source. + VendorName VendorNameEnum `mandatory:"true" json:"vendorName"` +} + +//GetId returns Id +func (m VendorSoftwareSourceSummary) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m VendorSoftwareSourceSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m VendorSoftwareSourceSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetRepoId returns RepoId +func (m VendorSoftwareSourceSummary) GetRepoId() *string { + return m.RepoId +} + +//GetUrl returns Url +func (m VendorSoftwareSourceSummary) GetUrl() *string { + return m.Url +} + +//GetTimeCreated returns TimeCreated +func (m VendorSoftwareSourceSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m VendorSoftwareSourceSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +//GetDescription returns Description +func (m VendorSoftwareSourceSummary) GetDescription() *string { + return m.Description +} + +//GetAvailability returns Availability +func (m VendorSoftwareSourceSummary) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetOsFamily returns OsFamily +func (m VendorSoftwareSourceSummary) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m VendorSoftwareSourceSummary) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetPackageCount returns PackageCount +func (m VendorSoftwareSourceSummary) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetLifecycleState returns LifecycleState +func (m VendorSoftwareSourceSummary) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m VendorSoftwareSourceSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m VendorSoftwareSourceSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m VendorSoftwareSourceSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m VendorSoftwareSourceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VendorSoftwareSourceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingVendorNameEnum(string(m.VendorName)); !ok && m.VendorName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VendorName: %s. Supported values are: %s.", m.VendorName, strings.Join(GetVendorNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m VendorSoftwareSourceSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVendorSoftwareSourceSummary VendorSoftwareSourceSummary + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeVendorSoftwareSourceSummary + }{ + "VENDOR", + (MarshalTypeVendorSoftwareSourceSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/versioned_custom_software_source.go b/osmanagementhub/versioned_custom_software_source.go new file mode 100644 index 0000000000..a39db88a36 --- /dev/null +++ b/osmanagementhub/versioned_custom_software_source.go @@ -0,0 +1,233 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VersionedCustomSoftwareSource An immutable custom software source that is assigned a version and contains a custom collection of packages. +type VersionedCustomSoftwareSource struct { + + // OCID for the software source. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The Repo ID for the software source. + RepoId *string `mandatory:"true" json:"repoId"` + + // URL for the repository. + Url *string `mandatory:"true" json:"url"` + + // List of vendor software sources. + VendorSoftwareSources []Id `mandatory:"true" json:"vendorSoftwareSources"` + + // The version to assign to this custom software source. + SoftwareSourceVersion *string `mandatory:"true" json:"softwareSourceVersion"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Number of packages. + PackageCount *int64 `mandatory:"false" json:"packageCount"` + + // URL of the GPG key for this software source. + GpgKeyUrl *string `mandatory:"false" json:"gpgKeyUrl"` + + // ID of the GPG key for this software source. + GpgKeyId *string `mandatory:"false" json:"gpgKeyId"` + + // Fingerprint of the GPG key for this software source. + GpgKeyFingerprint *string `mandatory:"false" json:"gpgKeyFingerprint"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + CustomSoftwareSourceFilter *CustomSoftwareSourceFilter `mandatory:"false" json:"customSoftwareSourceFilter"` + + // Possible availabilities of a software source. + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + + // The OS family the software source belongs to. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type supported by the software source. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` + + // The current state of the software source. + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The yum repository checksum type used by this software source. + ChecksumType ChecksumTypeEnum `mandatory:"false" json:"checksumType,omitempty"` +} + +//GetId returns Id +func (m VersionedCustomSoftwareSource) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m VersionedCustomSoftwareSource) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m VersionedCustomSoftwareSource) GetDisplayName() *string { + return m.DisplayName +} + +//GetTimeCreated returns TimeCreated +func (m VersionedCustomSoftwareSource) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetDescription returns Description +func (m VersionedCustomSoftwareSource) GetDescription() *string { + return m.Description +} + +//GetAvailability returns Availability +func (m VersionedCustomSoftwareSource) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetRepoId returns RepoId +func (m VersionedCustomSoftwareSource) GetRepoId() *string { + return m.RepoId +} + +//GetOsFamily returns OsFamily +func (m VersionedCustomSoftwareSource) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m VersionedCustomSoftwareSource) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetLifecycleState returns LifecycleState +func (m VersionedCustomSoftwareSource) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetPackageCount returns PackageCount +func (m VersionedCustomSoftwareSource) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetUrl returns Url +func (m VersionedCustomSoftwareSource) GetUrl() *string { + return m.Url +} + +//GetChecksumType returns ChecksumType +func (m VersionedCustomSoftwareSource) GetChecksumType() ChecksumTypeEnum { + return m.ChecksumType +} + +//GetGpgKeyUrl returns GpgKeyUrl +func (m VersionedCustomSoftwareSource) GetGpgKeyUrl() *string { + return m.GpgKeyUrl +} + +//GetGpgKeyId returns GpgKeyId +func (m VersionedCustomSoftwareSource) GetGpgKeyId() *string { + return m.GpgKeyId +} + +//GetGpgKeyFingerprint returns GpgKeyFingerprint +func (m VersionedCustomSoftwareSource) GetGpgKeyFingerprint() *string { + return m.GpgKeyFingerprint +} + +//GetFreeformTags returns FreeformTags +func (m VersionedCustomSoftwareSource) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m VersionedCustomSoftwareSource) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m VersionedCustomSoftwareSource) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m VersionedCustomSoftwareSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VersionedCustomSoftwareSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingChecksumTypeEnum(string(m.ChecksumType)); !ok && m.ChecksumType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ChecksumType: %s. Supported values are: %s.", m.ChecksumType, strings.Join(GetChecksumTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m VersionedCustomSoftwareSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVersionedCustomSoftwareSource VersionedCustomSoftwareSource + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeVersionedCustomSoftwareSource + }{ + "VERSIONED", + (MarshalTypeVersionedCustomSoftwareSource)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/versioned_custom_software_source_summary.go b/osmanagementhub/versioned_custom_software_source_summary.go new file mode 100644 index 0000000000..587de4457d --- /dev/null +++ b/osmanagementhub/versioned_custom_software_source_summary.go @@ -0,0 +1,205 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VersionedCustomSoftwareSourceSummary An immutable custom software source that is assigned a version and contains a custom collection of packages. +type VersionedCustomSoftwareSourceSummary struct { + + // The OCID for the software source. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the tenancy containing the software source. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User friendly name for the software source. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The Repo ID for the software source. + RepoId *string `mandatory:"true" json:"repoId"` + + // URL for the repository. + Url *string `mandatory:"true" json:"url"` + + // The date and time the software source was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time of when the software source was updated as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // List of vendor software sources. + VendorSoftwareSources []Id `mandatory:"true" json:"vendorSoftwareSources"` + + // The version to assign to this custom software source. + SoftwareSourceVersion *string `mandatory:"true" json:"softwareSourceVersion"` + + // Information specified by the user about the software source. + Description *string `mandatory:"false" json:"description"` + + // Number of packages. + PackageCount *int64 `mandatory:"false" json:"packageCount"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The current state of the software source. + LifecycleState SoftwareSourceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Possible availabilities of a software source. + Availability AvailabilityEnum `mandatory:"true" json:"availability"` + + // The OS family the software source belongs to. + OsFamily OsFamilyEnum `mandatory:"true" json:"osFamily"` + + // The architecture type supported by the software source. + ArchType ArchTypeEnum `mandatory:"true" json:"archType"` +} + +//GetId returns Id +func (m VersionedCustomSoftwareSourceSummary) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m VersionedCustomSoftwareSourceSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m VersionedCustomSoftwareSourceSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetRepoId returns RepoId +func (m VersionedCustomSoftwareSourceSummary) GetRepoId() *string { + return m.RepoId +} + +//GetUrl returns Url +func (m VersionedCustomSoftwareSourceSummary) GetUrl() *string { + return m.Url +} + +//GetTimeCreated returns TimeCreated +func (m VersionedCustomSoftwareSourceSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m VersionedCustomSoftwareSourceSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +//GetDescription returns Description +func (m VersionedCustomSoftwareSourceSummary) GetDescription() *string { + return m.Description +} + +//GetAvailability returns Availability +func (m VersionedCustomSoftwareSourceSummary) GetAvailability() AvailabilityEnum { + return m.Availability +} + +//GetOsFamily returns OsFamily +func (m VersionedCustomSoftwareSourceSummary) GetOsFamily() OsFamilyEnum { + return m.OsFamily +} + +//GetArchType returns ArchType +func (m VersionedCustomSoftwareSourceSummary) GetArchType() ArchTypeEnum { + return m.ArchType +} + +//GetPackageCount returns PackageCount +func (m VersionedCustomSoftwareSourceSummary) GetPackageCount() *int64 { + return m.PackageCount +} + +//GetLifecycleState returns LifecycleState +func (m VersionedCustomSoftwareSourceSummary) GetLifecycleState() SoftwareSourceLifecycleStateEnum { + return m.LifecycleState +} + +//GetFreeformTags returns FreeformTags +func (m VersionedCustomSoftwareSourceSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m VersionedCustomSoftwareSourceSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m VersionedCustomSoftwareSourceSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m VersionedCustomSoftwareSourceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VersionedCustomSoftwareSourceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSoftwareSourceLifecycleStateEnum(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(GetSoftwareSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingAvailabilityEnum(string(m.Availability)); !ok && m.Availability != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Availability: %s. Supported values are: %s.", m.Availability, strings.Join(GetAvailabilityEnumStringValues(), ","))) + } + if _, ok := GetMappingOsFamilyEnum(string(m.OsFamily)); !ok && m.OsFamily != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OsFamily: %s. Supported values are: %s.", m.OsFamily, strings.Join(GetOsFamilyEnumStringValues(), ","))) + } + if _, ok := GetMappingArchTypeEnum(string(m.ArchType)); !ok && m.ArchType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchType: %s. Supported values are: %s.", m.ArchType, strings.Join(GetArchTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m VersionedCustomSoftwareSourceSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVersionedCustomSoftwareSourceSummary VersionedCustomSoftwareSourceSummary + s := struct { + DiscriminatorParam string `json:"softwareSourceType"` + MarshalTypeVersionedCustomSoftwareSourceSummary + }{ + "VERSIONED", + (MarshalTypeVersionedCustomSoftwareSourceSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/osmanagementhub/work_request.go b/osmanagementhub/work_request.go new file mode 100644 index 0000000000..9f1e13c840 --- /dev/null +++ b/osmanagementhub/work_request.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest Describes a work request. +type WorkRequest struct { + + // Type of the work request. + OperationType WorkRequestOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID 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 it 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 list of OCIDs for the resources affected by the work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // The percentage complete of the operation tracked by this work request. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the work request was created - as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // A short description about the work request. + Description *string `mandatory:"false" json:"description"` + + // A short display name for the work request. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A progress or error message, if there is any. + Message *string `mandatory:"false" json:"message"` + + // The OCID of the parent work request, if there is any. + ParentId *string `mandatory:"false" json:"parentId"` + + // The list of OCIDs for the child work requests. + ChildrenId []string `mandatory:"false" json:"childrenId"` + + // A list of package names to be installed/updated/removed. + PackageNames []string `mandatory:"false" json:"packageNames"` + + // The list of appstream modules being operated on. + ModuleSpecs []ModuleSpecDetails `mandatory:"false" json:"moduleSpecs"` + + // The date and time the work request was created - as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The date and time the work 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 work request was finished - as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // The OCID of the resource that initiated the work request. + InitiatorId *string `mandatory:"false" json:"initiatorId"` + + ManagementStation *WorkRequestManagementStationDetails `mandatory:"false" json:"managementStation"` +} + +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 := GetMappingWorkRequestOperationTypeEnum(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(GetWorkRequestOperationTypeEnumStringValues(), ","))) + } + 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/osmanagementhub/work_request_details.go b/osmanagementhub/work_request_details.go new file mode 100644 index 0000000000..66c7669be6 --- /dev/null +++ b/osmanagementhub/work_request_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestDetails The details of the user-friendly names to be used for actions. +type WorkRequestDetails struct { + + // A user-friendly name for the resulting job. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // User specified information about the resulting job. Does not have to be unique, and it's changeable. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` +} + +func (m WorkRequestDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/work_request_error.go b/osmanagementhub/work_request_error.go new file mode 100644 index 0000000000..45f1a5d824 --- /dev/null +++ b/osmanagementhub/work_request_error.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +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/osmanagementhub/work_request_error_collection.go b/osmanagementhub/work_request_error_collection.go new file mode 100644 index 0000000000..62deac20ee --- /dev/null +++ b/osmanagementhub/work_request_error_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection Results of a work request error search. Contains both work request error items and other information, such as metadata. +type WorkRequestErrorCollection struct { + + // List of work request error 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/osmanagementhub/work_request_log_entry.go b/osmanagementhub/work_request_log_entry.go new file mode 100644 index 0000000000..f907250232 --- /dev/null +++ b/osmanagementhub/work_request_log_entry.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +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 { + + // A 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/osmanagementhub/work_request_log_entry_collection.go b/osmanagementhub/work_request_log_entry_collection.go new file mode 100644 index 0000000000..b7f40efe4d --- /dev/null +++ b/osmanagementhub/work_request_log_entry_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection Results of a work request log search. Contains both work request log items and other information, such as metadata. +type WorkRequestLogEntryCollection struct { + + // List of work request log entries. + 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/osmanagementhub/work_request_management_station_details.go b/osmanagementhub/work_request_management_station_details.go new file mode 100644 index 0000000000..9c18fc7444 --- /dev/null +++ b/osmanagementhub/work_request_management_station_details.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestManagementStationDetails Details about management station actions. +type WorkRequestManagementStationDetails struct { + + // Target version to update the management station software. + ManagementStationVersion *string `mandatory:"false" json:"managementStationVersion"` + + // Target config needed for set management station config. + Config []byte `mandatory:"false" json:"config"` + + // Optional list for mirrors to sync. + SoftwareSourceIds []string `mandatory:"false" json:"softwareSourceIds"` +} + +func (m WorkRequestManagementStationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestManagementStationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/osmanagementhub/work_request_operation_type.go b/osmanagementhub/work_request_operation_type.go new file mode 100644 index 0000000000..37bf3358bf --- /dev/null +++ b/osmanagementhub/work_request_operation_type.go @@ -0,0 +1,149 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "strings" +) + +// WorkRequestOperationTypeEnum Enum with underlying type: string +type WorkRequestOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestOperationTypeEnum +const ( + WorkRequestOperationTypeInstallPackages WorkRequestOperationTypeEnum = "INSTALL_PACKAGES" + WorkRequestOperationTypeRemovePackages WorkRequestOperationTypeEnum = "REMOVE_PACKAGES" + WorkRequestOperationTypeUpdatePackages WorkRequestOperationTypeEnum = "UPDATE_PACKAGES" + WorkRequestOperationTypeUpdateAllPackages WorkRequestOperationTypeEnum = "UPDATE_ALL_PACKAGES" + WorkRequestOperationTypeUpdateSecurity WorkRequestOperationTypeEnum = "UPDATE_SECURITY" + WorkRequestOperationTypeUpdateBugfix WorkRequestOperationTypeEnum = "UPDATE_BUGFIX" + WorkRequestOperationTypeUpdateEnhancement WorkRequestOperationTypeEnum = "UPDATE_ENHANCEMENT" + WorkRequestOperationTypeUpdateOther WorkRequestOperationTypeEnum = "UPDATE_OTHER" + WorkRequestOperationTypeUpdateKspliceKernel WorkRequestOperationTypeEnum = "UPDATE_KSPLICE_KERNEL" + WorkRequestOperationTypeUpdateKspliceUserspace WorkRequestOperationTypeEnum = "UPDATE_KSPLICE_USERSPACE" + WorkRequestOperationTypeEnableModuleStreams WorkRequestOperationTypeEnum = "ENABLE_MODULE_STREAMS" + WorkRequestOperationTypeDisableModuleStreams WorkRequestOperationTypeEnum = "DISABLE_MODULE_STREAMS" + WorkRequestOperationTypeSwitchModuleStream WorkRequestOperationTypeEnum = "SWITCH_MODULE_STREAM" + WorkRequestOperationTypeInstallModuleProfiles WorkRequestOperationTypeEnum = "INSTALL_MODULE_PROFILES" + WorkRequestOperationTypeRemoveModuleProfiles WorkRequestOperationTypeEnum = "REMOVE_MODULE_PROFILES" + WorkRequestOperationTypeSetSoftwareSources WorkRequestOperationTypeEnum = "SET_SOFTWARE_SOURCES" + WorkRequestOperationTypeListPackages WorkRequestOperationTypeEnum = "LIST_PACKAGES" + WorkRequestOperationTypeSetManagementStationConfig WorkRequestOperationTypeEnum = "SET_MANAGEMENT_STATION_CONFIG" + WorkRequestOperationTypeSyncManagementStationMirror WorkRequestOperationTypeEnum = "SYNC_MANAGEMENT_STATION_MIRROR" + WorkRequestOperationTypeUpdateManagementStationSoftware WorkRequestOperationTypeEnum = "UPDATE_MANAGEMENT_STATION_SOFTWARE" + WorkRequestOperationTypeUpdate WorkRequestOperationTypeEnum = "UPDATE" + WorkRequestOperationTypeModuleActions WorkRequestOperationTypeEnum = "MODULE_ACTIONS" + WorkRequestOperationTypeLifecyclePromotion WorkRequestOperationTypeEnum = "LIFECYCLE_PROMOTION" + WorkRequestOperationTypeCreateSoftwareSource WorkRequestOperationTypeEnum = "CREATE_SOFTWARE_SOURCE" + WorkRequestOperationTypeUpdateSoftwareSource WorkRequestOperationTypeEnum = "UPDATE_SOFTWARE_SOURCE" +) + +var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnum{ + "INSTALL_PACKAGES": WorkRequestOperationTypeInstallPackages, + "REMOVE_PACKAGES": WorkRequestOperationTypeRemovePackages, + "UPDATE_PACKAGES": WorkRequestOperationTypeUpdatePackages, + "UPDATE_ALL_PACKAGES": WorkRequestOperationTypeUpdateAllPackages, + "UPDATE_SECURITY": WorkRequestOperationTypeUpdateSecurity, + "UPDATE_BUGFIX": WorkRequestOperationTypeUpdateBugfix, + "UPDATE_ENHANCEMENT": WorkRequestOperationTypeUpdateEnhancement, + "UPDATE_OTHER": WorkRequestOperationTypeUpdateOther, + "UPDATE_KSPLICE_KERNEL": WorkRequestOperationTypeUpdateKspliceKernel, + "UPDATE_KSPLICE_USERSPACE": WorkRequestOperationTypeUpdateKspliceUserspace, + "ENABLE_MODULE_STREAMS": WorkRequestOperationTypeEnableModuleStreams, + "DISABLE_MODULE_STREAMS": WorkRequestOperationTypeDisableModuleStreams, + "SWITCH_MODULE_STREAM": WorkRequestOperationTypeSwitchModuleStream, + "INSTALL_MODULE_PROFILES": WorkRequestOperationTypeInstallModuleProfiles, + "REMOVE_MODULE_PROFILES": WorkRequestOperationTypeRemoveModuleProfiles, + "SET_SOFTWARE_SOURCES": WorkRequestOperationTypeSetSoftwareSources, + "LIST_PACKAGES": WorkRequestOperationTypeListPackages, + "SET_MANAGEMENT_STATION_CONFIG": WorkRequestOperationTypeSetManagementStationConfig, + "SYNC_MANAGEMENT_STATION_MIRROR": WorkRequestOperationTypeSyncManagementStationMirror, + "UPDATE_MANAGEMENT_STATION_SOFTWARE": WorkRequestOperationTypeUpdateManagementStationSoftware, + "UPDATE": WorkRequestOperationTypeUpdate, + "MODULE_ACTIONS": WorkRequestOperationTypeModuleActions, + "LIFECYCLE_PROMOTION": WorkRequestOperationTypeLifecyclePromotion, + "CREATE_SOFTWARE_SOURCE": WorkRequestOperationTypeCreateSoftwareSource, + "UPDATE_SOFTWARE_SOURCE": WorkRequestOperationTypeUpdateSoftwareSource, +} + +var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperationTypeEnum{ + "install_packages": WorkRequestOperationTypeInstallPackages, + "remove_packages": WorkRequestOperationTypeRemovePackages, + "update_packages": WorkRequestOperationTypeUpdatePackages, + "update_all_packages": WorkRequestOperationTypeUpdateAllPackages, + "update_security": WorkRequestOperationTypeUpdateSecurity, + "update_bugfix": WorkRequestOperationTypeUpdateBugfix, + "update_enhancement": WorkRequestOperationTypeUpdateEnhancement, + "update_other": WorkRequestOperationTypeUpdateOther, + "update_ksplice_kernel": WorkRequestOperationTypeUpdateKspliceKernel, + "update_ksplice_userspace": WorkRequestOperationTypeUpdateKspliceUserspace, + "enable_module_streams": WorkRequestOperationTypeEnableModuleStreams, + "disable_module_streams": WorkRequestOperationTypeDisableModuleStreams, + "switch_module_stream": WorkRequestOperationTypeSwitchModuleStream, + "install_module_profiles": WorkRequestOperationTypeInstallModuleProfiles, + "remove_module_profiles": WorkRequestOperationTypeRemoveModuleProfiles, + "set_software_sources": WorkRequestOperationTypeSetSoftwareSources, + "list_packages": WorkRequestOperationTypeListPackages, + "set_management_station_config": WorkRequestOperationTypeSetManagementStationConfig, + "sync_management_station_mirror": WorkRequestOperationTypeSyncManagementStationMirror, + "update_management_station_software": WorkRequestOperationTypeUpdateManagementStationSoftware, + "update": WorkRequestOperationTypeUpdate, + "module_actions": WorkRequestOperationTypeModuleActions, + "lifecycle_promotion": WorkRequestOperationTypeLifecyclePromotion, + "create_software_source": WorkRequestOperationTypeCreateSoftwareSource, + "update_software_source": WorkRequestOperationTypeUpdateSoftwareSource, +} + +// GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum +func GetWorkRequestOperationTypeEnumValues() []WorkRequestOperationTypeEnum { + values := make([]WorkRequestOperationTypeEnum, 0) + for _, v := range mappingWorkRequestOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetWorkRequestOperationTypeEnumStringValues Enumerates the set of values in String for WorkRequestOperationTypeEnum +func GetWorkRequestOperationTypeEnumStringValues() []string { + return []string{ + "INSTALL_PACKAGES", + "REMOVE_PACKAGES", + "UPDATE_PACKAGES", + "UPDATE_ALL_PACKAGES", + "UPDATE_SECURITY", + "UPDATE_BUGFIX", + "UPDATE_ENHANCEMENT", + "UPDATE_OTHER", + "UPDATE_KSPLICE_KERNEL", + "UPDATE_KSPLICE_USERSPACE", + "ENABLE_MODULE_STREAMS", + "DISABLE_MODULE_STREAMS", + "SWITCH_MODULE_STREAM", + "INSTALL_MODULE_PROFILES", + "REMOVE_MODULE_PROFILES", + "SET_SOFTWARE_SOURCES", + "LIST_PACKAGES", + "SET_MANAGEMENT_STATION_CONFIG", + "SYNC_MANAGEMENT_STATION_MIRROR", + "UPDATE_MANAGEMENT_STATION_SOFTWARE", + "UPDATE", + "MODULE_ACTIONS", + "LIFECYCLE_PROMOTION", + "CREATE_SOFTWARE_SOURCE", + "UPDATE_SOFTWARE_SOURCE", + } +} + +// GetMappingWorkRequestOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingWorkRequestOperationTypeEnum(val string) (WorkRequestOperationTypeEnum, bool) { + enum, ok := mappingWorkRequestOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/osmanagementhub/work_request_resource.go b/osmanagementhub/work_request_resource.go new file mode 100644 index 0000000000..2ad915cc56 --- /dev/null +++ b/osmanagementhub/work_request_resource.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +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 that the work request affects. + EntityType TargetResourceEntityTypeEnum `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"` + + // The name of the resource. Not all resources will have a name specified. + Name *string `mandatory:"false" json:"name"` + + // 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 := GetMappingTargetResourceEntityTypeEnum(string(m.EntityType)); !ok && m.EntityType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EntityType: %s. Supported values are: %s.", m.EntityType, strings.Join(GetTargetResourceEntityTypeEnumStringValues(), ","))) + } + 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/osmanagementhub/work_request_resource_metadata_key.go b/osmanagementhub/work_request_resource_metadata_key.go new file mode 100644 index 0000000000..e639e2512e --- /dev/null +++ b/osmanagementhub/work_request_resource_metadata_key.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +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/osmanagementhub/work_request_summary.go b/osmanagementhub/work_request_summary.go new file mode 100644 index 0000000000..8877b72753 --- /dev/null +++ b/osmanagementhub/work_request_summary.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary The summary of a work request. +type WorkRequestSummary struct { + + // Type of the work request. + OperationType WorkRequestOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID 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 date and time the request was created - as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // A short description about the work request. + Description *string `mandatory:"false" json:"description"` + + // A short display name for the work request. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A progress or error message, if there is any. + Message *string `mandatory:"false" json:"message"` + + // The OCID of the parent work request. + ParentId *string `mandatory:"false" json:"parentId"` + + // The list of OCIDs for the child work requests. + ChildrenId []string `mandatory:"false" json:"childrenId"` + + // The percentage complete of the operation tracked by this work request. + PercentComplete *float32 `mandatory:"false" json:"percentComplete"` +} + +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 := GetMappingWorkRequestOperationTypeEnum(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(GetWorkRequestOperationTypeEnumStringValues(), ","))) + } + 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/osmanagementhub/work_request_summary_collection.go b/osmanagementhub/work_request_summary_collection.go new file mode 100644 index 0000000000..09f24b4bf3 --- /dev/null +++ b/osmanagementhub/work_request_summary_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// OS Management Hub API +// +// Use the OS Management Hub API to manage and monitor updates and patches for the operating system environments in your private data centers through a single management console. For more information, see Overview of OS Management Hub (https://docs.cloud.oracle.com/iaas/osmh/doc/overview.htm). +// Use the table of contents and search tool to explore the OS Management Hub API. +// + +package osmanagementhub + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection Results of a work request search. Contains both work request items and other information, such as metadata. +type WorkRequestSummaryCollection struct { + + // List of work request summary 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 +}