diff --git a/CHANGELOG.md b/CHANGELOG.md index 4483bae3f8..3d000c7b8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.61.2 - 2024-03-19 +### Added +- Support for standalone Oracle HTTP server discovery and monitoring in the Stack Monitoring service +- Support for attribute management for traces in the Application Performance Monitoring service +- Support for async jobs and document translations in the AI language service + + ## 65.61.1 - 2024-03-12 ### Added - Support for new development license type on dedicated infrastructure in the Database service diff --git a/ailanguage/ailanguage_aiservicelanguage_client.go b/ailanguage/ailanguage_aiservicelanguage_client.go index 2c769b69d9..f0991ec9e9 100644 --- a/ailanguage/ailanguage_aiservicelanguage_client.go +++ b/ailanguage/ailanguage_aiservicelanguage_client.go @@ -527,6 +527,69 @@ func (client AIServiceLanguageClient) batchLanguageTranslation(ctx context.Conte return response, err } +// CancelJob Canceling the job cancels all the tasks under it. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/CancelJob.go.html to see an example of how to use CancelJob API. +// A default retry strategy applies to this operation CancelJob() +func (client AIServiceLanguageClient) CancelJob(ctx context.Context, request CancelJobRequest) (response CancelJobResponse, 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.cancelJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelJobResponse") + } + return +} + +// cancelJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceLanguageClient) cancelJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/jobs/{jobId}/actions/cancel", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelJobResponse + 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/language/20221001/Job/CancelJob" + err = common.PostProcessServiceError(err, "AIServiceLanguage", "CancelJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeEndpointCompartment Moves a Endpoint into a different compartment. When provided, If-Match is checked against ETag values of the resource. // // # See also @@ -590,6 +653,69 @@ func (client AIServiceLanguageClient) changeEndpointCompartment(ctx context.Cont return response, err } +// ChangeJobCompartment Moves a Job into a different compartment. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/ChangeJobCompartment.go.html to see an example of how to use ChangeJobCompartment API. +// A default retry strategy applies to this operation ChangeJobCompartment() +func (client AIServiceLanguageClient) ChangeJobCompartment(ctx context.Context, request ChangeJobCompartmentRequest) (response ChangeJobCompartmentResponse, 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.changeJobCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeJobCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeJobCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeJobCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeJobCompartmentResponse") + } + return +} + +// changeJobCompartment implements the OCIOperation interface (enables retrying operations) +func (client AIServiceLanguageClient) changeJobCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/jobs/{jobId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeJobCompartmentResponse + 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/language/20221001/Job/ChangeJobCompartment" + err = common.PostProcessServiceError(err, "AIServiceLanguage", "ChangeJobCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeModelCompartment Moves a Model into a different compartment. When provided, If-Match is checked against ETag values of the resource. // // # See also @@ -779,6 +905,69 @@ func (client AIServiceLanguageClient) createEndpoint(ctx context.Context, reques return response, err } +// CreateJob Creates a new language service async job. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/CreateJob.go.html to see an example of how to use CreateJob API. +// A default retry strategy applies to this operation CreateJob() +func (client AIServiceLanguageClient) CreateJob(ctx context.Context, request CreateJobRequest) (response CreateJobResponse, 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.createJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateJobResponse") + } + return +} + +// createJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceLanguageClient) createJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/jobs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateJobResponse + 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/language/20221001/Job/CreateJob" + err = common.PostProcessServiceError(err, "AIServiceLanguage", "CreateJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateModel Creates a new model for training and train the model with date provided. // // # See also @@ -963,6 +1152,64 @@ func (client AIServiceLanguageClient) deleteEndpoint(ctx context.Context, reques return response, err } +// DeleteJob Deletes the language service async Job +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/DeleteJob.go.html to see an example of how to use DeleteJob API. +// A default retry strategy applies to this operation DeleteJob() +func (client AIServiceLanguageClient) DeleteJob(ctx context.Context, request DeleteJobRequest) (response DeleteJobResponse, 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.deleteJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteJobResponse") + } + return +} + +// deleteJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceLanguageClient) deleteJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/jobs/{jobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteJobResponse + 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/language/20221001/Job/DeleteJob" + err = common.PostProcessServiceError(err, "AIServiceLanguage", "DeleteJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteModel Deletes a provisioned model resource by identifier. This operation fails with a 409 error unless all associated resources are in a DELETED state. You must delete all associated resources before deleting a model. // // # See also @@ -1449,6 +1696,64 @@ func (client AIServiceLanguageClient) getEndpoint(ctx context.Context, request c return response, err } +// GetJob Gets a language service async job +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/GetJob.go.html to see an example of how to use GetJob API. +// A default retry strategy applies to this operation GetJob() +func (client AIServiceLanguageClient) GetJob(ctx context.Context, request GetJobRequest) (response GetJobResponse, 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.getJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetJobResponse") + } + return +} + +// getJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceLanguageClient) getJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs/{jobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetJobResponse + 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/language/20221001/Job/GetJob" + err = common.PostProcessServiceError(err, "AIServiceLanguage", "GetJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetModel Gets a model by identifier // // # See also @@ -1797,6 +2102,64 @@ func (client AIServiceLanguageClient) listEvaluationResults(ctx context.Context, return response, err } +// ListJobs Returns a list of language service async Jobs. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/ListJobs.go.html to see an example of how to use ListJobs API. +// A default retry strategy applies to this operation ListJobs() +func (client AIServiceLanguageClient) ListJobs(ctx context.Context, request ListJobsRequest) (response ListJobsResponse, 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.listJobs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListJobsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListJobsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListJobsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListJobsResponse") + } + return +} + +// listJobs implements the OCIOperation interface (enables retrying operations) +func (client AIServiceLanguageClient) listJobs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListJobsResponse + 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/language/20221001/Job/ListJobs" + err = common.PostProcessServiceError(err, "AIServiceLanguage", "ListJobs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListModels Returns a list of models. // // # See also @@ -2145,6 +2508,64 @@ func (client AIServiceLanguageClient) updateEndpoint(ctx context.Context, reques return response, err } +// UpdateJob Updates the language service async Job +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/UpdateJob.go.html to see an example of how to use UpdateJob API. +// A default retry strategy applies to this operation UpdateJob() +func (client AIServiceLanguageClient) UpdateJob(ctx context.Context, request UpdateJobRequest) (response UpdateJobResponse, 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.updateJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateJobResponse") + } + return +} + +// updateJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceLanguageClient) updateJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/jobs/{jobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateJobResponse + 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/language/20221001/Job/UpdateJob" + err = common.PostProcessServiceError(err, "AIServiceLanguage", "UpdateJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateModel Updates the model // // # See also diff --git a/ailanguage/cancel_job_request_response.go b/ailanguage/cancel_job_request_response.go new file mode 100644 index 0000000000..b1682e0425 --- /dev/null +++ b/ailanguage/cancel_job_request_response.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelJobRequest wrapper for the CancelJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/CancelJob.go.html to see an example of how to use CancelJobRequest. +type CancelJobRequest struct { + + // Unique Transcription Job identifier. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without 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 CancelJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CancelJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CancelJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelJobResponse wrapper for the CancelJob operation +type CancelJobResponse 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 CancelJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ailanguage/change_job_compartment_details.go b/ailanguage/change_job_compartment_details.go new file mode 100644 index 0000000000..16685336dc --- /dev/null +++ b/ailanguage/change_job_compartment_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeJobCompartmentDetails Details for changing the compartment of a language job. +type ChangeJobCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment + // where the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeJobCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeJobCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/change_job_compartment_request_response.go b/ailanguage/change_job_compartment_request_response.go new file mode 100644 index 0000000000..3d6b7a76a5 --- /dev/null +++ b/ailanguage/change_job_compartment_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeJobCompartmentRequest wrapper for the ChangeJobCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/ChangeJobCompartment.go.html to see an example of how to use ChangeJobCompartmentRequest. +type ChangeJobCompartmentRequest struct { + + // unique job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + ChangeJobCompartmentDetails `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"` + + // 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 ChangeJobCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeJobCompartmentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ChangeJobCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeJobCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ChangeJobCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeJobCompartmentResponse wrapper for the ChangeJobCompartment operation +type ChangeJobCompartmentResponse 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 ChangeJobCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeJobCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ailanguage/configuration_details.go b/ailanguage/configuration_details.go new file mode 100644 index 0000000000..526d352b5a --- /dev/null +++ b/ailanguage/configuration_details.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConfigurationDetails training model details +type ConfigurationDetails struct { + + // model configuration details + // For PII : ConfigurationDetails will be PiiEntityMasking can be anyone of the following + // ex.{ "mode" : "MASK","maskingCharacter" : "&","leaveCharactersUnmasked": 3,"isUnmaskedFromEnd" : true } + // { "mode" : "MASK","replaceWith" : "&" } + // { "mode" : "REPLACE" } + // For language translation : { "languageCodes" : ["cs", "ar"]} + // Language code supported + // Automatically detect language - auto + // Arabic - ar + // Brazilian Portuguese - pt-BR + // Czech - cs + // Danish - da + // Dutch - nl + // English - en + // Finnish - fi + // French - fr + // Canadian French - fr-CA + // German - de + // Italian - it + // Japanese - ja + // Korean - ko + // Norwegian - no + // Polish - pl + // Romanian - ro + // Simplified Chinese - zh-CN + // Spanish - es + // Swedish - sv + // Traditional Chinese - zh-TW + // Turkish - tr + // Greek - el + // Hebrew - he + ConfigurationMap map[string]string `mandatory:"false" json:"configurationMap"` +} + +func (m ConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/create_job_details.go b/ailanguage/create_job_details.go new file mode 100644 index 0000000000..bf2d9ed92f --- /dev/null +++ b/ailanguage/create_job_details.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateJobDetails Job creation detail which will have documents on which language services need to run prediction along with output folder +type CreateJobDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the job. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + InputLocation InputLocation `mandatory:"true" json:"inputLocation"` + + // training model details + // For this release only one model is allowed to be input here. + // One of the three modelType, ModelId, endpointId should be given other wise error will be thrown from API + ModelMetadataDetails []ModelMetadataDetails `mandatory:"true" json:"modelMetadataDetails"` + + OutputLocation *ObjectPrefixOutputLocation `mandatory:"true" json:"outputLocation"` + + // A user-friendly display name for the job. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the job. + Description *string `mandatory:"false" json:"description"` + + InputConfiguration *InputConfiguration `mandatory:"false" json:"inputConfiguration"` +} + +func (m CreateJobDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateJobDetails) 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 *CreateJobDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + InputConfiguration *InputConfiguration `json:"inputConfiguration"` + CompartmentId *string `json:"compartmentId"` + InputLocation inputlocation `json:"inputLocation"` + ModelMetadataDetails []ModelMetadataDetails `json:"modelMetadataDetails"` + OutputLocation *ObjectPrefixOutputLocation `json:"outputLocation"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.InputConfiguration = model.InputConfiguration + + m.CompartmentId = model.CompartmentId + + nn, e = model.InputLocation.UnmarshalPolymorphicJSON(model.InputLocation.JsonData) + if e != nil { + return + } + if nn != nil { + m.InputLocation = nn.(InputLocation) + } else { + m.InputLocation = nil + } + + m.ModelMetadataDetails = make([]ModelMetadataDetails, len(model.ModelMetadataDetails)) + copy(m.ModelMetadataDetails, model.ModelMetadataDetails) + m.OutputLocation = model.OutputLocation + + return +} diff --git a/ailanguage/create_job_request_response.go b/ailanguage/create_job_request_response.go new file mode 100644 index 0000000000..dbdad024a6 --- /dev/null +++ b/ailanguage/create_job_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateJobRequest wrapper for the CreateJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/CreateJob.go.html to see an example of how to use CreateJobRequest. +type CreateJobRequest struct { + + // Details for the new job. + CreateJobDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateJobResponse wrapper for the CreateJob operation +type CreateJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Job instance + Job `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"` + + // 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 CreateJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ailanguage/delete_job_request_response.go b/ailanguage/delete_job_request_response.go new file mode 100644 index 0000000000..66d00bd63f --- /dev/null +++ b/ailanguage/delete_job_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteJobRequest wrapper for the DeleteJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/DeleteJob.go.html to see an example of how to use DeleteJobRequest. +type DeleteJobRequest struct { + + // Unique Transcription Job identifier. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteJobResponse wrapper for the DeleteJob operation +type DeleteJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ailanguage/documents_configuration.go b/ailanguage/documents_configuration.go new file mode 100644 index 0000000000..8b5ca41903 --- /dev/null +++ b/ailanguage/documents_configuration.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentsConfiguration Input documents configuration +type DocumentsConfiguration struct { + + // meta data about documents + // For CSV valid JSON format is {"CSV" :{inputColumn: "reviewDetails", rowId: "reviewId", copyColumnsToOutput: ["reviewId" "userId"] , delimiter: ","} + // Note: In future if new file types added we will update here in documentation about input file meta data + Config map[string]string `mandatory:"false" json:"config"` +} + +func (m DocumentsConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentsConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/get_job_request_response.go b/ailanguage/get_job_request_response.go new file mode 100644 index 0000000000..8a355de540 --- /dev/null +++ b/ailanguage/get_job_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetJobRequest wrapper for the GetJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/GetJob.go.html to see an example of how to use GetJobRequest. +type GetJobRequest struct { + + // Unique Transcription Job identifier. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // 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 GetJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetJobResponse wrapper for the GetJob operation +type GetJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Job instance + Job `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 GetJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ailanguage/input_configuration.go b/ailanguage/input_configuration.go new file mode 100644 index 0000000000..07cb6a6fcd --- /dev/null +++ b/ailanguage/input_configuration.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InputConfiguration input documents configuration +// by default TXT files will be processed and this behaviour will not change in future after adding new types +type InputConfiguration struct { + + // Type of documents supported + // for this release only TXT,CSV and one element is allowed here. + // for future scope this is marked as list + DocumentTypes []string `mandatory:"false" json:"documentTypes"` + + // meta data about documents + // For CSV valid JSON format is {"CSV" :{inputColumn: "reviewDetails", rowId: "reviewId", copyColumnsToOutput: ["reviewId" "userId"] , delimiter: ","} + // Note: In future if new file types added we will update here in documentation about input file meta data + Configuration map[string]DocumentsConfiguration `mandatory:"false" json:"configuration"` +} + +func (m InputConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InputConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/input_location.go b/ailanguage/input_location.go new file mode 100644 index 0000000000..c0067f2832 --- /dev/null +++ b/ailanguage/input_location.go @@ -0,0 +1,127 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InputLocation document location and other meta data about documents +// For TXT both ObjectStoragePrefixLocation and ObjectStorageFileNameLocation supported +// For CSV only ObjectStorageFileNameLocation is supported +type InputLocation interface { +} + +type inputlocation struct { + JsonData []byte + LocationType string `json:"locationType"` +} + +// UnmarshalJSON unmarshals json +func (m *inputlocation) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerinputlocation inputlocation + s := struct { + Model Unmarshalerinputlocation + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.LocationType = s.Model.LocationType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *inputlocation) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.LocationType { + case "OBJECT_STORAGE_PREFIX": + mm := ObjectStoragePrefixLocation{} + err = json.Unmarshal(data, &mm) + return mm, err + case "OBJECT_STORAGE_FILE_LIST": + mm := ObjectStorageFileNameLocation{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for InputLocation: %s.", m.LocationType) + return *m, nil + } +} + +func (m inputlocation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m inputlocation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// InputLocationLocationTypeEnum Enum with underlying type: string +type InputLocationLocationTypeEnum string + +// Set of constants representing the allowable values for InputLocationLocationTypeEnum +const ( + InputLocationLocationTypePrefix InputLocationLocationTypeEnum = "OBJECT_STORAGE_PREFIX" + InputLocationLocationTypeFileList InputLocationLocationTypeEnum = "OBJECT_STORAGE_FILE_LIST" +) + +var mappingInputLocationLocationTypeEnum = map[string]InputLocationLocationTypeEnum{ + "OBJECT_STORAGE_PREFIX": InputLocationLocationTypePrefix, + "OBJECT_STORAGE_FILE_LIST": InputLocationLocationTypeFileList, +} + +var mappingInputLocationLocationTypeEnumLowerCase = map[string]InputLocationLocationTypeEnum{ + "object_storage_prefix": InputLocationLocationTypePrefix, + "object_storage_file_list": InputLocationLocationTypeFileList, +} + +// GetInputLocationLocationTypeEnumValues Enumerates the set of values for InputLocationLocationTypeEnum +func GetInputLocationLocationTypeEnumValues() []InputLocationLocationTypeEnum { + values := make([]InputLocationLocationTypeEnum, 0) + for _, v := range mappingInputLocationLocationTypeEnum { + values = append(values, v) + } + return values +} + +// GetInputLocationLocationTypeEnumStringValues Enumerates the set of values in String for InputLocationLocationTypeEnum +func GetInputLocationLocationTypeEnumStringValues() []string { + return []string{ + "OBJECT_STORAGE_PREFIX", + "OBJECT_STORAGE_FILE_LIST", + } +} + +// GetMappingInputLocationLocationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingInputLocationLocationTypeEnum(val string) (InputLocationLocationTypeEnum, bool) { + enum, ok := mappingInputLocationLocationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ailanguage/job.go b/ailanguage/job.go new file mode 100644 index 0000000000..66c5e1ce66 --- /dev/null +++ b/ailanguage/job.go @@ -0,0 +1,254 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Job Job details which contain input document details on which prediction need to run, features (which and all language services ) need to run and where to store results +type Job struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the job. + Id *string `mandatory:"true" json:"id"` + + InputLocation InputLocation `mandatory:"true" json:"inputLocation"` + + // training model details + // For this release only one model is allowed to be input here. + // One of the three modelType, ModelId, endpointId should be given other wise error will be thrown from API + ModelMetadataDetails []ModelMetadataDetails `mandatory:"true" json:"modelMetadataDetails"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the job. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + OutputLocation *ObjectPrefixOutputLocation `mandatory:"true" json:"outputLocation"` + + // A user-friendly display name for the job. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the job. + Description *string `mandatory:"false" json:"description"` + + InputConfiguration *InputConfiguration `mandatory:"false" json:"inputConfiguration"` + + // The current state of the Job. + LifecycleState JobLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // How much progress the operation has made, vs the total amount of work that must be performed. + PercentComplete *int `mandatory:"false" json:"percentComplete"` + + // Total number of documents given as input for prediction. For CSV this signifies number of rows and for TXT this signifies number of files. + TotalDocuments *int `mandatory:"false" json:"totalDocuments"` + + // Number of documents still to process. For CSV this signifies number of rows and for TXT this signifies number of files. + PendingDocuments *int `mandatory:"false" json:"pendingDocuments"` + + // Number of documents processed for prediction. For CSV this signifies number of rows and for TXT this signifies number of files. + CompletedDocuments *int `mandatory:"false" json:"completedDocuments"` + + // Number of documents failed for prediction. For CSV this signifies number of rows and for TXT this signifies number of files. + FailedDocuments *int `mandatory:"false" json:"failedDocuments"` + + // warnings count + WarningsCount *int `mandatory:"false" json:"warningsCount"` + + // Time to live duration in days for Job. Job will be available till max 90 days. + TtlInDays *int `mandatory:"false" json:"ttlInDays"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the job. + CreatedBy *string `mandatory:"false" json:"createdBy"` + + // Job accepted time. + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // Job started time. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // Job finished time. + TimeCompleted *common.SDKTime `mandatory:"false" json:"timeCompleted"` +} + +func (m Job) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Job) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingJobLifecycleStateEnum(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(GetJobLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *Job) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + InputConfiguration *InputConfiguration `json:"inputConfiguration"` + LifecycleState JobLifecycleStateEnum `json:"lifecycleState"` + LifecycleDetails *string `json:"lifecycleDetails"` + PercentComplete *int `json:"percentComplete"` + TotalDocuments *int `json:"totalDocuments"` + PendingDocuments *int `json:"pendingDocuments"` + CompletedDocuments *int `json:"completedDocuments"` + FailedDocuments *int `json:"failedDocuments"` + WarningsCount *int `json:"warningsCount"` + TtlInDays *int `json:"ttlInDays"` + CreatedBy *string `json:"createdBy"` + TimeAccepted *common.SDKTime `json:"timeAccepted"` + TimeStarted *common.SDKTime `json:"timeStarted"` + TimeCompleted *common.SDKTime `json:"timeCompleted"` + Id *string `json:"id"` + InputLocation inputlocation `json:"inputLocation"` + ModelMetadataDetails []ModelMetadataDetails `json:"modelMetadataDetails"` + CompartmentId *string `json:"compartmentId"` + OutputLocation *ObjectPrefixOutputLocation `json:"outputLocation"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.InputConfiguration = model.InputConfiguration + + m.LifecycleState = model.LifecycleState + + m.LifecycleDetails = model.LifecycleDetails + + m.PercentComplete = model.PercentComplete + + m.TotalDocuments = model.TotalDocuments + + m.PendingDocuments = model.PendingDocuments + + m.CompletedDocuments = model.CompletedDocuments + + m.FailedDocuments = model.FailedDocuments + + m.WarningsCount = model.WarningsCount + + m.TtlInDays = model.TtlInDays + + m.CreatedBy = model.CreatedBy + + m.TimeAccepted = model.TimeAccepted + + m.TimeStarted = model.TimeStarted + + m.TimeCompleted = model.TimeCompleted + + m.Id = model.Id + + nn, e = model.InputLocation.UnmarshalPolymorphicJSON(model.InputLocation.JsonData) + if e != nil { + return + } + if nn != nil { + m.InputLocation = nn.(InputLocation) + } else { + m.InputLocation = nil + } + + m.ModelMetadataDetails = make([]ModelMetadataDetails, len(model.ModelMetadataDetails)) + copy(m.ModelMetadataDetails, model.ModelMetadataDetails) + m.CompartmentId = model.CompartmentId + + m.OutputLocation = model.OutputLocation + + return +} + +// JobLifecycleStateEnum Enum with underlying type: string +type JobLifecycleStateEnum string + +// Set of constants representing the allowable values for JobLifecycleStateEnum +const ( + JobLifecycleStateAccepted JobLifecycleStateEnum = "ACCEPTED" + JobLifecycleStateInProgress JobLifecycleStateEnum = "IN_PROGRESS" + JobLifecycleStateSucceeded JobLifecycleStateEnum = "SUCCEEDED" + JobLifecycleStateFailed JobLifecycleStateEnum = "FAILED" + JobLifecycleStateCanceling JobLifecycleStateEnum = "CANCELING" + JobLifecycleStateCanceled JobLifecycleStateEnum = "CANCELED" + JobLifecycleStateDeleting JobLifecycleStateEnum = "DELETING" + JobLifecycleStateDeleted JobLifecycleStateEnum = "DELETED" +) + +var mappingJobLifecycleStateEnum = map[string]JobLifecycleStateEnum{ + "ACCEPTED": JobLifecycleStateAccepted, + "IN_PROGRESS": JobLifecycleStateInProgress, + "SUCCEEDED": JobLifecycleStateSucceeded, + "FAILED": JobLifecycleStateFailed, + "CANCELING": JobLifecycleStateCanceling, + "CANCELED": JobLifecycleStateCanceled, + "DELETING": JobLifecycleStateDeleting, + "DELETED": JobLifecycleStateDeleted, +} + +var mappingJobLifecycleStateEnumLowerCase = map[string]JobLifecycleStateEnum{ + "accepted": JobLifecycleStateAccepted, + "in_progress": JobLifecycleStateInProgress, + "succeeded": JobLifecycleStateSucceeded, + "failed": JobLifecycleStateFailed, + "canceling": JobLifecycleStateCanceling, + "canceled": JobLifecycleStateCanceled, + "deleting": JobLifecycleStateDeleting, + "deleted": JobLifecycleStateDeleted, +} + +// GetJobLifecycleStateEnumValues Enumerates the set of values for JobLifecycleStateEnum +func GetJobLifecycleStateEnumValues() []JobLifecycleStateEnum { + values := make([]JobLifecycleStateEnum, 0) + for _, v := range mappingJobLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetJobLifecycleStateEnumStringValues Enumerates the set of values in String for JobLifecycleStateEnum +func GetJobLifecycleStateEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "SUCCEEDED", + "FAILED", + "CANCELING", + "CANCELED", + "DELETING", + "DELETED", + } +} + +// GetMappingJobLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingJobLifecycleStateEnum(val string) (JobLifecycleStateEnum, bool) { + enum, ok := mappingJobLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ailanguage/job_collection.go b/ailanguage/job_collection.go new file mode 100644 index 0000000000..ecc10ac4de --- /dev/null +++ b/ailanguage/job_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JobCollection list of Jobs created in the compartment and/or after applying filters based on filters provided by user +type JobCollection struct { + + // List of jobs. + Items []JobSummary `mandatory:"true" json:"items"` +} + +func (m JobCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JobCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/job_summary.go b/ailanguage/job_summary.go new file mode 100644 index 0000000000..9007bcbb4f --- /dev/null +++ b/ailanguage/job_summary.go @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JobSummary sub set of Job details data which need returns in list API +type JobSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the job. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly display name for the job. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the job. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A short description of the job. + Description *string `mandatory:"false" json:"description"` + + // The current state of the Speech Job. + LifecycleState JobLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // How much progress the operation has made, vs the total amount of work that must be performed. + PercentComplete *int `mandatory:"false" json:"percentComplete"` + + // Total number of documents given as input for prediction. For CSV this signifies number of rows and for TXT this signifies number of files. + TotalDocuments *int `mandatory:"false" json:"totalDocuments"` + + // Number of documents still to process. For CSV this signifies number of rows and for TXT this signifies number of files. + PendingDocuments *int `mandatory:"false" json:"pendingDocuments"` + + // Number of documents processed for prediction. For CSV this signifies number of rows and for TXT this signifies number of files. + CompletedDocuments *int `mandatory:"false" json:"completedDocuments"` + + // Number of documents failed for prediction. For CSV this signifies number of rows and for TXT this signifies number of files. + FailedDocuments *int `mandatory:"false" json:"failedDocuments"` + + // warnings count + WarningsCount *int `mandatory:"false" json:"warningsCount"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the job. + CreatedBy *string `mandatory:"false" json:"createdBy"` + + // Job accepted time. + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // Job started time. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // Job finished time. + TimeCompleted *common.SDKTime `mandatory:"false" json:"timeCompleted"` +} + +func (m JobSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JobSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingJobLifecycleStateEnum(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(GetJobLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/list_jobs_request_response.go b/ailanguage/list_jobs_request_response.go new file mode 100644 index 0000000000..5de2e8a308 --- /dev/null +++ b/ailanguage/list_jobs_request_response.go @@ -0,0 +1,209 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListJobsRequest wrapper for the ListJobs operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/ListJobs.go.html to see an example of how to use ListJobsRequest. +type ListJobsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources whose lifecycleState matches the given lifecycleState. + LifecycleState JobLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique identifier(OCID). + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListJobsSortOrderEnum `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 ListJobsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListJobsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListJobsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListJobsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListJobsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListJobsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingJobLifecycleStateEnum(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(GetJobLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListJobsSortOrderEnum(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(GetListJobsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListJobsSortByEnum(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(GetListJobsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListJobsResponse wrapper for the ListJobs operation +type ListJobsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of JobCollection instances + JobCollection `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 ListJobsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListJobsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListJobsSortOrderEnum Enum with underlying type: string +type ListJobsSortOrderEnum string + +// Set of constants representing the allowable values for ListJobsSortOrderEnum +const ( + ListJobsSortOrderAsc ListJobsSortOrderEnum = "ASC" + ListJobsSortOrderDesc ListJobsSortOrderEnum = "DESC" +) + +var mappingListJobsSortOrderEnum = map[string]ListJobsSortOrderEnum{ + "ASC": ListJobsSortOrderAsc, + "DESC": ListJobsSortOrderDesc, +} + +var mappingListJobsSortOrderEnumLowerCase = map[string]ListJobsSortOrderEnum{ + "asc": ListJobsSortOrderAsc, + "desc": ListJobsSortOrderDesc, +} + +// GetListJobsSortOrderEnumValues Enumerates the set of values for ListJobsSortOrderEnum +func GetListJobsSortOrderEnumValues() []ListJobsSortOrderEnum { + values := make([]ListJobsSortOrderEnum, 0) + for _, v := range mappingListJobsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListJobsSortOrderEnumStringValues Enumerates the set of values in String for ListJobsSortOrderEnum +func GetListJobsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListJobsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListJobsSortOrderEnum(val string) (ListJobsSortOrderEnum, bool) { + enum, ok := mappingListJobsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListJobsSortByEnum Enum with underlying type: string +type ListJobsSortByEnum string + +// Set of constants representing the allowable values for ListJobsSortByEnum +const ( + ListJobsSortByTimecreated ListJobsSortByEnum = "timeCreated" + ListJobsSortByDisplayname ListJobsSortByEnum = "displayName" +) + +var mappingListJobsSortByEnum = map[string]ListJobsSortByEnum{ + "timeCreated": ListJobsSortByTimecreated, + "displayName": ListJobsSortByDisplayname, +} + +var mappingListJobsSortByEnumLowerCase = map[string]ListJobsSortByEnum{ + "timecreated": ListJobsSortByTimecreated, + "displayname": ListJobsSortByDisplayname, +} + +// GetListJobsSortByEnumValues Enumerates the set of values for ListJobsSortByEnum +func GetListJobsSortByEnumValues() []ListJobsSortByEnum { + values := make([]ListJobsSortByEnum, 0) + for _, v := range mappingListJobsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListJobsSortByEnumStringValues Enumerates the set of values in String for ListJobsSortByEnum +func GetListJobsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListJobsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListJobsSortByEnum(val string) (ListJobsSortByEnum, bool) { + enum, ok := mappingListJobsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ailanguage/model_metadata_details.go b/ailanguage/model_metadata_details.go new file mode 100644 index 0000000000..b652674fa4 --- /dev/null +++ b/ailanguage/model_metadata_details.go @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModelMetadataDetails training model details +// For this release only one model is allowed to be input here. +// One of the three modelType, ModelId, endpointId should be given other wise error will be thrown from API +type ModelMetadataDetails struct { + + // model type to used for inference allowed values are + // - LANGUAGE_SENTIMENT_ANALYSIS + // - LANGUAGE_DETECTION + // - TEXT_CLASSIFICATION + // - NAMED_ENTITY_RECOGNITION + // - KEY_PHRASE_EXTRACTION + // - LANGUAGE_PII_ENTITIES + // - LANGUAGE_TRANSLATION + ModelType *string `mandatory:"false" json:"modelType"` + + // Unique identifier model OCID that should be used for inference + ModelId *string `mandatory:"false" json:"modelId"` + + // Unique identifier endpoint OCID that should be used for inference + EndpointId *string `mandatory:"false" json:"endpointId"` + + // Language code supported + // - auto : Automatically detect language + // - ar : Arabic + // - pt-BR : Brazilian Portuguese + // - cs : Czech + // - da : Danish + // - nl : Dutch + // - en : English + // - fi : Finnish + // - fr : French + // - fr-CA : Canadian French + // - de : German + // - it : Italian + // - ja : Japanese + // - ko : Korean + // - no : Norwegian + // - pl : Polish + // - ro : Romanian + // - zh-CN : Simplified Chinese + // - es : Spanish + // - sv : Swedish + // - zh-TW : Traditional Chinese + // - tr : Turkish + // - el : Greek + // - he : Hebrew + LanguageCode *string `mandatory:"false" json:"languageCode"` + + // model configuration details + // For PII : < ENTITY_TYPE , ConfigurationDetails> + // ex."ORACLE":{ "mode" : "MASK","maskingCharacter" : "&","leaveCharactersUnmasked": 3,"isUnmaskedFromEnd" : true } + // For language translation : { "targetLanguageCodes" : ConfigurationDetails} + Configuration map[string]ConfigurationDetails `mandatory:"false" json:"configuration"` +} + +func (m ModelMetadataDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ModelMetadataDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/object_prefix_output_location.go b/ailanguage/object_prefix_output_location.go new file mode 100644 index 0000000000..4c5ff295ce --- /dev/null +++ b/ailanguage/object_prefix_output_location.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectPrefixOutputLocation Object storage output location to write inference results +type ObjectPrefixOutputLocation struct { + + // Object Storage namespace name. + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // Object Storage bucket name. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The prefix (directory) in an Object Storage bucket. + Prefix *string `mandatory:"false" json:"prefix"` +} + +func (m ObjectPrefixOutputLocation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ObjectPrefixOutputLocation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/object_storage_file_name_location.go b/ailanguage/object_storage_file_name_location.go new file mode 100644 index 0000000000..9b4821785a --- /dev/null +++ b/ailanguage/object_storage_file_name_location.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectStorageFileNameLocation list of text files need to be used for prediction +type ObjectStorageFileNameLocation struct { + + // Object Storage namespace name. + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // Object Storage bucket name. + BucketName *string `mandatory:"true" json:"bucketName"` + + // List of objects to be processed + ObjectNames []string `mandatory:"true" json:"objectNames"` +} + +func (m ObjectStorageFileNameLocation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ObjectStorageFileNameLocation) 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 ObjectStorageFileNameLocation) MarshalJSON() (buff []byte, e error) { + type MarshalTypeObjectStorageFileNameLocation ObjectStorageFileNameLocation + s := struct { + DiscriminatorParam string `json:"locationType"` + MarshalTypeObjectStorageFileNameLocation + }{ + "OBJECT_STORAGE_FILE_LIST", + (MarshalTypeObjectStorageFileNameLocation)(m), + } + + return json.Marshal(&s) +} diff --git a/ailanguage/object_storage_prefix_location.go b/ailanguage/object_storage_prefix_location.go new file mode 100644 index 0000000000..a970574d86 --- /dev/null +++ b/ailanguage/object_storage_prefix_location.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectStoragePrefixLocation Properties specific to object storage prefix location +type ObjectStoragePrefixLocation struct { + + // Object Storage namespace name. + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // Object Storage bucket name. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The prefix (directory) in an Object Storage bucket. + Prefix *string `mandatory:"false" json:"prefix"` +} + +func (m ObjectStoragePrefixLocation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ObjectStoragePrefixLocation) 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 ObjectStoragePrefixLocation) MarshalJSON() (buff []byte, e error) { + type MarshalTypeObjectStoragePrefixLocation ObjectStoragePrefixLocation + s := struct { + DiscriminatorParam string `json:"locationType"` + MarshalTypeObjectStoragePrefixLocation + }{ + "OBJECT_STORAGE_PREFIX", + (MarshalTypeObjectStoragePrefixLocation)(m), + } + + return json.Marshal(&s) +} diff --git a/ailanguage/translation_document_result.go b/ailanguage/translation_document_result.go index c46de9180b..4323860736 100644 --- a/ailanguage/translation_document_result.go +++ b/ailanguage/translation_document_result.go @@ -26,10 +26,73 @@ type TranslationDocumentResult struct { // Translated text in selected target language. TranslatedText *string `mandatory:"true" json:"translatedText"` - // Language code of the document. Please refer to respective model API documentation (https://docs.cloud.oracle.com/iaas/language/using/overview.htm) for supported languages. + // Language code supported + // Automatically detect language - auto + // Arabic - ar + // Brazilian Portuguese - pt-BR + // Canadian French - fr-CA + // Croatian - hr + // Czech - cs + // Danish - da + // Dutch - nl + // English - en + // Finnish - fi + // French - fr + // German - de + // Greek - el + // Hebrew - he + // Hungarian - hu + // Italian - it + // Japanese - ja + // Korean - ko + // Norwegian - no + // Polish - pl + // Portuguese - pt + // Romanian - ro + // Russian - ru + // Simplified Chinese - zh-CN + // Slovak - sk + // Slovenian - sl + // Spanish - es + // Swedish - sv + // Thai - th + // Traditional Chinese - zh-TW + // Turkish - tr + // Vietnamese - vi SourceLanguageCode *string `mandatory:"true" json:"sourceLanguageCode"` - // Language code of the document. Please refer to respective model API documentation (https://docs.cloud.oracle.com/iaas/language/using/overview.htm) for supported languages. + // Language code supported + // Arabic - ar + // Brazilian Portuguese - pt-BR + // Canadian French - fr-CA + // Croatian - hr + // Czech - cs + // Danish - da + // Dutch - nl + // English - en + // Finnish - fi + // French - fr + // German - de + // Greek - el + // Hebrew - he + // Hungarian - hu + // Italian - it + // Japanese - ja + // Korean - ko + // Norwegian - no + // Polish - pl + // Portuguese - pt + // Romanian - ro + // Russian - ru + // Simplified Chinese - zh-CN + // Slovak - sk + // Slovenian - sl + // Spanish - es + // Swedish - sv + // Thai - th + // Traditional Chinese - zh-TW + // Turkish - tr + // Vietnamese - vi TargetLanguageCode *string `mandatory:"true" json:"targetLanguageCode"` } diff --git a/ailanguage/update_job_details.go b/ailanguage/update_job_details.go new file mode 100644 index 0000000000..0b85290c58 --- /dev/null +++ b/ailanguage/update_job_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Language API +// +// OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, +// pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. +// This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market. +// + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateJobDetails The information to be updated. +type UpdateJobDetails struct { + + // A user-friendly display name for the job. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the job. + Description *string `mandatory:"false" json:"description"` +} + +func (m UpdateJobDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateJobDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ailanguage/update_job_request_response.go b/ailanguage/update_job_request_response.go new file mode 100644 index 0000000000..bdcbd3eff1 --- /dev/null +++ b/ailanguage/update_job_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package ailanguage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateJobRequest wrapper for the UpdateJob operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ailanguage/UpdateJob.go.html to see an example of how to use UpdateJobRequest. +type UpdateJobRequest struct { + + // Unique Transcription Job identifier. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // The information to be updated. + UpdateJobDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateJobResponse wrapper for the UpdateJob operation +type UpdateJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Job instance + Job `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 UpdateJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/apmtraces/apmtraces_attributes_client.go b/apmtraces/apmtraces_attributes_client.go new file mode 100644 index 0000000000..3d3b70780e --- /dev/null +++ b/apmtraces/apmtraces_attributes_client.go @@ -0,0 +1,564 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// AttributesClient a client for Attributes +type AttributesClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewAttributesClientWithConfigurationProvider Creates a new default Attributes client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewAttributesClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client AttributesClient, err error) { + if enabled := common.CheckForEnabledServices("apmtraces"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newAttributesClientFromBaseClient(baseClient, provider) +} + +// NewAttributesClientWithOboToken Creates a new default Attributes 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 NewAttributesClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client AttributesClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newAttributesClientFromBaseClient(baseClient, configProvider) +} + +func newAttributesClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client AttributesClient, err error) { + // Attributes service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Attributes")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = AttributesClient{BaseClient: baseClient} + client.BasePath = "20200630" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *AttributesClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("apmtraces", "https://apm-trace.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *AttributesClient) 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 *AttributesClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// BulkActivateAttribute Activates a set of attributes for the given APM Domain. The API is not case-sensitive. Any duplicates present in the bulk activation +// request are deduplicated and only unique attributes are activated. A maximum number of 700 string attributes and 100 numeric attributes +// can be activated in an APM Domain subject to the available string and numeric slots. Once an attribute has been activated, it may take sometime +// for it to be appear in searches as ingest might not have picked up the changes or any associated caches might not have refreshed. The +// bulk activation operation is atomic, and the operation succeeds only if all the attributes in the request have been processed successfully and they +// get a success status back. If the processing of any attribute results in a processing or validation error, then none of the attributes in the bulk +// request are activated. Attributes that are activated are unpinned by default if they are pinned. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkActivateAttribute.go.html to see an example of how to use BulkActivateAttribute API. +func (client AttributesClient) BulkActivateAttribute(ctx context.Context, request BulkActivateAttributeRequest) (response BulkActivateAttributeResponse, 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.bulkActivateAttribute, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkActivateAttributeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkActivateAttributeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkActivateAttributeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkActivateAttributeResponse") + } + return +} + +// bulkActivateAttribute implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) bulkActivateAttribute(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/attributes/actions/activateAttributes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkActivateAttributeResponse + 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/apm-trace-explorer/20200630/BulkActivationStatus/BulkActivateAttribute" + err = common.PostProcessServiceError(err, "Attributes", "BulkActivateAttribute", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkDeActivateAttribute Deactivates a set of attributes for the given APM Domain. The API is case in-sensitive. Any duplicates present in the bulk deactivation +// request are deduplicated and only unique attributes are deactivated. A maximum number of 700 string attributes and 100 numeric attributes +// can be deactivated in an APM Domain subject to the available string and numeric slots. Out of box attributes (Trace and Span) cannot be +// deactivated, and will result in a processing error. Once an attribute has been deactivated, it may take sometime for it to disappear in +// searches as ingest might not have picked up the changes or any associated caches might not have refreshed. The bulk deactivation +// operation is atomic, and the operation succeeds only if all the attributes in the request have been processed successfully and they get a success +// status back. If the processing of any attribute results in a processing or validation error, then none of the attributes in the bulk request +// are deactivated. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkDeActivateAttribute.go.html to see an example of how to use BulkDeActivateAttribute API. +func (client AttributesClient) BulkDeActivateAttribute(ctx context.Context, request BulkDeActivateAttributeRequest) (response BulkDeActivateAttributeResponse, 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.bulkDeActivateAttribute, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkDeActivateAttributeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkDeActivateAttributeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkDeActivateAttributeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkDeActivateAttributeResponse") + } + return +} + +// bulkDeActivateAttribute implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) bulkDeActivateAttribute(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/attributes/actions/deActivateAttributes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkDeActivateAttributeResponse + 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/apm-trace-explorer/20200630/BulkDeActivationStatus/BulkDeActivateAttribute" + err = common.PostProcessServiceError(err, "Attributes", "BulkDeActivateAttribute", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkPinAttribute Pin a set of attributes in the APM Domain. Attributes that are marked pinned are not autoactivated by ingest. +// Attributes that are deactivated are pinned by default. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkPinAttribute.go.html to see an example of how to use BulkPinAttribute API. +func (client AttributesClient) BulkPinAttribute(ctx context.Context, request BulkPinAttributeRequest) (response BulkPinAttributeResponse, 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.bulkPinAttribute, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkPinAttributeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkPinAttributeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkPinAttributeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkPinAttributeResponse") + } + return +} + +// bulkPinAttribute implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) bulkPinAttribute(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/attributes/actions/pinAttributes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkPinAttributeResponse + 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/apm-trace-explorer/20200630/BulkPinStatus/BulkPinAttribute" + err = common.PostProcessServiceError(err, "Attributes", "BulkPinAttribute", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUnpinAttribute Unpin a set of attributes in the APM Domain. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkUnpinAttribute.go.html to see an example of how to use BulkUnpinAttribute API. +func (client AttributesClient) BulkUnpinAttribute(ctx context.Context, request BulkUnpinAttributeRequest) (response BulkUnpinAttributeResponse, 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.bulkUnpinAttribute, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUnpinAttributeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUnpinAttributeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUnpinAttributeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUnpinAttributeResponse") + } + return +} + +// bulkUnpinAttribute implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) bulkUnpinAttribute(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/attributes/actions/unPinAttributes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUnpinAttributeResponse + 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/apm-trace-explorer/20200630/BulkUnpinStatus/BulkUnpinAttribute" + err = common.PostProcessServiceError(err, "Attributes", "BulkUnpinAttribute", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUpdateAttribute Update a set of attribute properties in the APM Domain. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkUpdateAttribute.go.html to see an example of how to use BulkUpdateAttribute API. +func (client AttributesClient) BulkUpdateAttribute(ctx context.Context, request BulkUpdateAttributeRequest) (response BulkUpdateAttributeResponse, 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.bulkUpdateAttribute, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUpdateAttributeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUpdateAttributeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUpdateAttributeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUpdateAttributeResponse") + } + return +} + +// bulkUpdateAttribute implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) bulkUpdateAttribute(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/attributes/actions/updateAttributes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUpdateAttributeResponse + 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/apm-trace-explorer/20200630/BulkUpdateAttributeStatus/BulkUpdateAttribute" + err = common.PostProcessServiceError(err, "Attributes", "BulkUpdateAttribute", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUpdateAttributeNotes Add or edit notes to a set of attributes in the APM Domain. Notes can be added to either an active or an inactive attribute. The +// notes will be preserved even if the attribute changes state (when an active attribute is deactivated or when an inactive attribute +// is activated). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkUpdateAttributeNotes.go.html to see an example of how to use BulkUpdateAttributeNotes API. +func (client AttributesClient) BulkUpdateAttributeNotes(ctx context.Context, request BulkUpdateAttributeNotesRequest) (response BulkUpdateAttributeNotesResponse, 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.bulkUpdateAttributeNotes, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUpdateAttributeNotesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUpdateAttributeNotesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUpdateAttributeNotesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUpdateAttributeNotesResponse") + } + return +} + +// bulkUpdateAttributeNotes implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) bulkUpdateAttributeNotes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/attributes/actions/updateNotes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUpdateAttributeNotesResponse + 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/apm-trace-explorer/20200630/BulkUpdateNotesStatus/BulkUpdateAttributeNotes" + err = common.PostProcessServiceError(err, "Attributes", "BulkUpdateAttributeNotes", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetStatusAutoActivate Get autoactivation status for a private data key or public data key in the APM Domain. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/GetStatusAutoActivate.go.html to see an example of how to use GetStatusAutoActivate API. +func (client AttributesClient) GetStatusAutoActivate(ctx context.Context, request GetStatusAutoActivateRequest) (response GetStatusAutoActivateResponse, 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.getStatusAutoActivate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetStatusAutoActivateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetStatusAutoActivateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetStatusAutoActivateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetStatusAutoActivateResponse") + } + return +} + +// getStatusAutoActivate implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) getStatusAutoActivate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/attributes/autoActivateStatus", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetStatusAutoActivateResponse + 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/apm-trace-explorer/20200630/AutoActivateStatus/GetStatusAutoActivate" + err = common.PostProcessServiceError(err, "Attributes", "GetStatusAutoActivate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PutToggleAutoActivate Turn on or off autoactivate for private data key or public data key traffic a given APM Domain. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/PutToggleAutoActivate.go.html to see an example of how to use PutToggleAutoActivate API. +func (client AttributesClient) PutToggleAutoActivate(ctx context.Context, request PutToggleAutoActivateRequest) (response PutToggleAutoActivateResponse, 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.putToggleAutoActivate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PutToggleAutoActivateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PutToggleAutoActivateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PutToggleAutoActivateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PutToggleAutoActivateResponse") + } + return +} + +// putToggleAutoActivate implements the OCIOperation interface (enables retrying operations) +func (client AttributesClient) putToggleAutoActivate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/attributes/actions/autoActivate", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PutToggleAutoActivateResponse + 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/apm-trace-explorer/20200630/AutoActivateToggleStatus/PutToggleAutoActivate" + err = common.PostProcessServiceError(err, "Attributes", "PutToggleAutoActivate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/apmtraces/attribute_pin_response.go b/apmtraces/attribute_pin_response.go new file mode 100644 index 0000000000..97154ae0ec --- /dev/null +++ b/apmtraces/attribute_pin_response.go @@ -0,0 +1,213 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttributePinResponse Response of an individual attribute item in the bulk pin operation. +type AttributePinResponse struct { + + // Attribute that was pinned by this bulk operation. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Notes added to this attribute. + Notes *string `mandatory:"true" json:"notes"` + + // Type of operation - pin. + OperationType AttributePinResponseOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Namespace of the attribute whose properties were updated. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace AttributePinResponseAttributeNameSpaceEnum `mandatory:"true" json:"attributeNameSpace"` + + // Status of the attribute after this operation. The attribute can have one of the following statuses after the pin operation. The attribute + // can have either a success status or an error status. The status of the attribute must be correlated with the operation status property in the bulk operation metadata + // object. The bulk operation will be successful only when all attributes in the bulk request are processed successfully and they get a success status back. + // The following are successful status values of individual attribute items in a bulk attribute pin operation. + // ATTRIBUTE_PINNED - The attribute is marked pinned and associated notes have been added. + // ATTRIBUTE_ALREADY_PINNED - The caller is trying to pin an attribute that has already been pinned. + // DUPLICATE_ATTRIBUTE - The attribute is a duplicate of an attribute that was present in this bulk request. Note that we deduplicate the attribute collection, process only unique attributes, + // and call out duplicates. A duplicate attribute in a bulk request will not prevent the processing of further attributes in the bulk operation. + // The following values are error statuses and the bulk processing is stopped when the first error is encountered. + // PIN_NOT_ALLOWED - The caller has asked to pin an active attribute which is not allowed. + // INVALID_ATTRIBUTE - The attribute is invalid. + // ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error. + AttributeStatus AttributePinResponseAttributeStatusEnum `mandatory:"true" json:"attributeStatus"` + + // Time when the attribute was activated or deactivated. Note that ingest might not have picked up the changes even if this time has elapsed. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m AttributePinResponse) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttributePinResponse) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAttributePinResponseOperationTypeEnum(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(GetAttributePinResponseOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributePinResponseAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetAttributePinResponseAttributeNameSpaceEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributePinResponseAttributeStatusEnum(string(m.AttributeStatus)); !ok && m.AttributeStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeStatus: %s. Supported values are: %s.", m.AttributeStatus, strings.Join(GetAttributePinResponseAttributeStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttributePinResponseOperationTypeEnum Enum with underlying type: string +type AttributePinResponseOperationTypeEnum string + +// Set of constants representing the allowable values for AttributePinResponseOperationTypeEnum +const ( + AttributePinResponseOperationTypePin AttributePinResponseOperationTypeEnum = "PIN" +) + +var mappingAttributePinResponseOperationTypeEnum = map[string]AttributePinResponseOperationTypeEnum{ + "PIN": AttributePinResponseOperationTypePin, +} + +var mappingAttributePinResponseOperationTypeEnumLowerCase = map[string]AttributePinResponseOperationTypeEnum{ + "pin": AttributePinResponseOperationTypePin, +} + +// GetAttributePinResponseOperationTypeEnumValues Enumerates the set of values for AttributePinResponseOperationTypeEnum +func GetAttributePinResponseOperationTypeEnumValues() []AttributePinResponseOperationTypeEnum { + values := make([]AttributePinResponseOperationTypeEnum, 0) + for _, v := range mappingAttributePinResponseOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetAttributePinResponseOperationTypeEnumStringValues Enumerates the set of values in String for AttributePinResponseOperationTypeEnum +func GetAttributePinResponseOperationTypeEnumStringValues() []string { + return []string{ + "PIN", + } +} + +// GetMappingAttributePinResponseOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributePinResponseOperationTypeEnum(val string) (AttributePinResponseOperationTypeEnum, bool) { + enum, ok := mappingAttributePinResponseOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributePinResponseAttributeNameSpaceEnum Enum with underlying type: string +type AttributePinResponseAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for AttributePinResponseAttributeNameSpaceEnum +const ( + AttributePinResponseAttributeNameSpaceTraces AttributePinResponseAttributeNameSpaceEnum = "TRACES" + AttributePinResponseAttributeNameSpaceSynthetic AttributePinResponseAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingAttributePinResponseAttributeNameSpaceEnum = map[string]AttributePinResponseAttributeNameSpaceEnum{ + "TRACES": AttributePinResponseAttributeNameSpaceTraces, + "SYNTHETIC": AttributePinResponseAttributeNameSpaceSynthetic, +} + +var mappingAttributePinResponseAttributeNameSpaceEnumLowerCase = map[string]AttributePinResponseAttributeNameSpaceEnum{ + "traces": AttributePinResponseAttributeNameSpaceTraces, + "synthetic": AttributePinResponseAttributeNameSpaceSynthetic, +} + +// GetAttributePinResponseAttributeNameSpaceEnumValues Enumerates the set of values for AttributePinResponseAttributeNameSpaceEnum +func GetAttributePinResponseAttributeNameSpaceEnumValues() []AttributePinResponseAttributeNameSpaceEnum { + values := make([]AttributePinResponseAttributeNameSpaceEnum, 0) + for _, v := range mappingAttributePinResponseAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetAttributePinResponseAttributeNameSpaceEnumStringValues Enumerates the set of values in String for AttributePinResponseAttributeNameSpaceEnum +func GetAttributePinResponseAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingAttributePinResponseAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributePinResponseAttributeNameSpaceEnum(val string) (AttributePinResponseAttributeNameSpaceEnum, bool) { + enum, ok := mappingAttributePinResponseAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributePinResponseAttributeStatusEnum Enum with underlying type: string +type AttributePinResponseAttributeStatusEnum string + +// Set of constants representing the allowable values for AttributePinResponseAttributeStatusEnum +const ( + AttributePinResponseAttributeStatusAttributeAlreadyPinned AttributePinResponseAttributeStatusEnum = "ATTRIBUTE_ALREADY_PINNED" + AttributePinResponseAttributeStatusAttributePinned AttributePinResponseAttributeStatusEnum = "ATTRIBUTE_PINNED" + AttributePinResponseAttributeStatusPinNotAllowed AttributePinResponseAttributeStatusEnum = "PIN_NOT_ALLOWED" + AttributePinResponseAttributeStatusDuplicateAttribute AttributePinResponseAttributeStatusEnum = "DUPLICATE_ATTRIBUTE" + AttributePinResponseAttributeStatusInvalidAttribute AttributePinResponseAttributeStatusEnum = "INVALID_ATTRIBUTE" + AttributePinResponseAttributeStatusAttributeNotProcessed AttributePinResponseAttributeStatusEnum = "ATTRIBUTE_NOT_PROCESSED" +) + +var mappingAttributePinResponseAttributeStatusEnum = map[string]AttributePinResponseAttributeStatusEnum{ + "ATTRIBUTE_ALREADY_PINNED": AttributePinResponseAttributeStatusAttributeAlreadyPinned, + "ATTRIBUTE_PINNED": AttributePinResponseAttributeStatusAttributePinned, + "PIN_NOT_ALLOWED": AttributePinResponseAttributeStatusPinNotAllowed, + "DUPLICATE_ATTRIBUTE": AttributePinResponseAttributeStatusDuplicateAttribute, + "INVALID_ATTRIBUTE": AttributePinResponseAttributeStatusInvalidAttribute, + "ATTRIBUTE_NOT_PROCESSED": AttributePinResponseAttributeStatusAttributeNotProcessed, +} + +var mappingAttributePinResponseAttributeStatusEnumLowerCase = map[string]AttributePinResponseAttributeStatusEnum{ + "attribute_already_pinned": AttributePinResponseAttributeStatusAttributeAlreadyPinned, + "attribute_pinned": AttributePinResponseAttributeStatusAttributePinned, + "pin_not_allowed": AttributePinResponseAttributeStatusPinNotAllowed, + "duplicate_attribute": AttributePinResponseAttributeStatusDuplicateAttribute, + "invalid_attribute": AttributePinResponseAttributeStatusInvalidAttribute, + "attribute_not_processed": AttributePinResponseAttributeStatusAttributeNotProcessed, +} + +// GetAttributePinResponseAttributeStatusEnumValues Enumerates the set of values for AttributePinResponseAttributeStatusEnum +func GetAttributePinResponseAttributeStatusEnumValues() []AttributePinResponseAttributeStatusEnum { + values := make([]AttributePinResponseAttributeStatusEnum, 0) + for _, v := range mappingAttributePinResponseAttributeStatusEnum { + values = append(values, v) + } + return values +} + +// GetAttributePinResponseAttributeStatusEnumStringValues Enumerates the set of values in String for AttributePinResponseAttributeStatusEnum +func GetAttributePinResponseAttributeStatusEnumStringValues() []string { + return []string{ + "ATTRIBUTE_ALREADY_PINNED", + "ATTRIBUTE_PINNED", + "PIN_NOT_ALLOWED", + "DUPLICATE_ATTRIBUTE", + "INVALID_ATTRIBUTE", + "ATTRIBUTE_NOT_PROCESSED", + } +} + +// GetMappingAttributePinResponseAttributeStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributePinResponseAttributeStatusEnum(val string) (AttributePinResponseAttributeStatusEnum, bool) { + enum, ok := mappingAttributePinResponseAttributeStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/attribute_response.go b/apmtraces/attribute_response.go new file mode 100644 index 0000000000..6342e261f7 --- /dev/null +++ b/apmtraces/attribute_response.go @@ -0,0 +1,361 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttributeResponse Response of an individual attribute item in the bulk activate or deactivate operation. +type AttributeResponse struct { + + // Attribute that was activated or deactivated by this bulk operation. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Type of the attribute. + AttributeType AttributeResponseAttributeTypeEnum `mandatory:"true" json:"attributeType"` + + // Type of operation - activate or deactivate. + OperationType AttributeResponseOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Namespace of the attribute whose properties were updated. The attributeNamespace will default to TRACES if it is + // not passed in. + AttributeNameSpace AttributeResponseAttributeNameSpaceEnum `mandatory:"true" json:"attributeNameSpace"` + + // Status of the attribute after this operation. The attribute can have one of the following statuses after the activate or deactivate operation. The attribute + // can have either a success status or an error status. The status of the attribute must be correlated with the operation status property in the bulk operation metadata + // object. The bulk operation will be successful only when all attributes in the bulk request are processed successful and they get a success status back. + // The following are successful status values of individual attribute items in a bulk attribute activation operation. + // ATTRIBUTE_ACTIVATED - The attribute is activated and is available to be queried. Note that ingest might still have not picked up the changes, and the + // associated caches would not have refreshed yet to pick up the changes. + // ATTRIBUTE_ALREADY_ACTIVE - The caller is trying to activate an attribute that is already active or in the process of getting activated. + // ATTRIBUTE_DEACTIVATED - The attribute is deactivated and will not appear in searches. Ingest might not have picked up the new changes and the associated caches + // might not have refreshed yet. + // ATTRIBUTE_ALREADY_DEACTIVATED - The caller is trying to deactivate an attribute that has already been deactivated or in the process of deactivation. + // DUPLICATE_ATTRIBUTE - The attribute is a duplicate of an attribute that was present in this bulk request. Note that we deduplicate the attribute collection, process only unique attributes, + // and call out duplicates. A duplicate attribute in a bulk request will not prevent the processing of further attributes in the bulk operation. + // The following values are error statuses and the bulk processing is stopped when the first error is encountered. None of the attributes in the bulk request would have been activated or + // deactivated by this bulk operation. + // DEACTIVATION_NOT_ALLOWED - The caller has asked for the deactivation of an out of box tag which is not permitted. + // ATTRIBUTE_DOES_NOT_EXIST - The caller tries to deactivate an attribute that doesn't exist in the APM Domain. + // INVALID_ATTRIBUTE - The attribute is invalid. + // INVALID_ATTRIBUTE_TYPE_CONFLICT - The attribute is invalid. There were two attributes with same name but different type in the bulk request. + // ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error. + // ATTRIBUTE_UPDATE_NOT_ALLOWED - The unit of the attribute cannot be updated as it is an in-built system attribute. + AttributeStatus AttributeResponseAttributeStatusEnum `mandatory:"true" json:"attributeStatus"` + + // Time when the attribute was activated or deactivated. Note that ingest might not have picked up the changes even if this time has elapsed. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Unit of the attribute. + Unit AttributeResponseUnitEnum `mandatory:"false" json:"unit,omitempty"` + + // Notes for the activated attribute. + Notes *string `mandatory:"false" json:"notes"` +} + +func (m AttributeResponse) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttributeResponse) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAttributeResponseAttributeTypeEnum(string(m.AttributeType)); !ok && m.AttributeType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeType: %s. Supported values are: %s.", m.AttributeType, strings.Join(GetAttributeResponseAttributeTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeResponseOperationTypeEnum(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(GetAttributeResponseOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeResponseAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetAttributeResponseAttributeNameSpaceEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeResponseAttributeStatusEnum(string(m.AttributeStatus)); !ok && m.AttributeStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeStatus: %s. Supported values are: %s.", m.AttributeStatus, strings.Join(GetAttributeResponseAttributeStatusEnumStringValues(), ","))) + } + + if _, ok := GetMappingAttributeResponseUnitEnum(string(m.Unit)); !ok && m.Unit != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Unit: %s. Supported values are: %s.", m.Unit, strings.Join(GetAttributeResponseUnitEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttributeResponseAttributeTypeEnum Enum with underlying type: string +type AttributeResponseAttributeTypeEnum string + +// Set of constants representing the allowable values for AttributeResponseAttributeTypeEnum +const ( + AttributeResponseAttributeTypeNumeric AttributeResponseAttributeTypeEnum = "NUMERIC" + AttributeResponseAttributeTypeString AttributeResponseAttributeTypeEnum = "STRING" +) + +var mappingAttributeResponseAttributeTypeEnum = map[string]AttributeResponseAttributeTypeEnum{ + "NUMERIC": AttributeResponseAttributeTypeNumeric, + "STRING": AttributeResponseAttributeTypeString, +} + +var mappingAttributeResponseAttributeTypeEnumLowerCase = map[string]AttributeResponseAttributeTypeEnum{ + "numeric": AttributeResponseAttributeTypeNumeric, + "string": AttributeResponseAttributeTypeString, +} + +// GetAttributeResponseAttributeTypeEnumValues Enumerates the set of values for AttributeResponseAttributeTypeEnum +func GetAttributeResponseAttributeTypeEnumValues() []AttributeResponseAttributeTypeEnum { + values := make([]AttributeResponseAttributeTypeEnum, 0) + for _, v := range mappingAttributeResponseAttributeTypeEnum { + values = append(values, v) + } + return values +} + +// GetAttributeResponseAttributeTypeEnumStringValues Enumerates the set of values in String for AttributeResponseAttributeTypeEnum +func GetAttributeResponseAttributeTypeEnumStringValues() []string { + return []string{ + "NUMERIC", + "STRING", + } +} + +// GetMappingAttributeResponseAttributeTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeResponseAttributeTypeEnum(val string) (AttributeResponseAttributeTypeEnum, bool) { + enum, ok := mappingAttributeResponseAttributeTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeResponseUnitEnum Enum with underlying type: string +type AttributeResponseUnitEnum string + +// Set of constants representing the allowable values for AttributeResponseUnitEnum +const ( + AttributeResponseUnitNone AttributeResponseUnitEnum = "NONE" + AttributeResponseUnitEpochTimeMs AttributeResponseUnitEnum = "EPOCH_TIME_MS" + AttributeResponseUnitBytes AttributeResponseUnitEnum = "BYTES" + AttributeResponseUnitCount AttributeResponseUnitEnum = "COUNT" + AttributeResponseUnitDurationMs AttributeResponseUnitEnum = "DURATION_MS" + AttributeResponseUnitTraceStatus AttributeResponseUnitEnum = "TRACE_STATUS" + AttributeResponseUnitPercentage AttributeResponseUnitEnum = "PERCENTAGE" +) + +var mappingAttributeResponseUnitEnum = map[string]AttributeResponseUnitEnum{ + "NONE": AttributeResponseUnitNone, + "EPOCH_TIME_MS": AttributeResponseUnitEpochTimeMs, + "BYTES": AttributeResponseUnitBytes, + "COUNT": AttributeResponseUnitCount, + "DURATION_MS": AttributeResponseUnitDurationMs, + "TRACE_STATUS": AttributeResponseUnitTraceStatus, + "PERCENTAGE": AttributeResponseUnitPercentage, +} + +var mappingAttributeResponseUnitEnumLowerCase = map[string]AttributeResponseUnitEnum{ + "none": AttributeResponseUnitNone, + "epoch_time_ms": AttributeResponseUnitEpochTimeMs, + "bytes": AttributeResponseUnitBytes, + "count": AttributeResponseUnitCount, + "duration_ms": AttributeResponseUnitDurationMs, + "trace_status": AttributeResponseUnitTraceStatus, + "percentage": AttributeResponseUnitPercentage, +} + +// GetAttributeResponseUnitEnumValues Enumerates the set of values for AttributeResponseUnitEnum +func GetAttributeResponseUnitEnumValues() []AttributeResponseUnitEnum { + values := make([]AttributeResponseUnitEnum, 0) + for _, v := range mappingAttributeResponseUnitEnum { + values = append(values, v) + } + return values +} + +// GetAttributeResponseUnitEnumStringValues Enumerates the set of values in String for AttributeResponseUnitEnum +func GetAttributeResponseUnitEnumStringValues() []string { + return []string{ + "NONE", + "EPOCH_TIME_MS", + "BYTES", + "COUNT", + "DURATION_MS", + "TRACE_STATUS", + "PERCENTAGE", + } +} + +// GetMappingAttributeResponseUnitEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeResponseUnitEnum(val string) (AttributeResponseUnitEnum, bool) { + enum, ok := mappingAttributeResponseUnitEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeResponseOperationTypeEnum Enum with underlying type: string +type AttributeResponseOperationTypeEnum string + +// Set of constants representing the allowable values for AttributeResponseOperationTypeEnum +const ( + AttributeResponseOperationTypeActivate AttributeResponseOperationTypeEnum = "ACTIVATE" + AttributeResponseOperationTypeDeactivate AttributeResponseOperationTypeEnum = "DEACTIVATE" +) + +var mappingAttributeResponseOperationTypeEnum = map[string]AttributeResponseOperationTypeEnum{ + "ACTIVATE": AttributeResponseOperationTypeActivate, + "DEACTIVATE": AttributeResponseOperationTypeDeactivate, +} + +var mappingAttributeResponseOperationTypeEnumLowerCase = map[string]AttributeResponseOperationTypeEnum{ + "activate": AttributeResponseOperationTypeActivate, + "deactivate": AttributeResponseOperationTypeDeactivate, +} + +// GetAttributeResponseOperationTypeEnumValues Enumerates the set of values for AttributeResponseOperationTypeEnum +func GetAttributeResponseOperationTypeEnumValues() []AttributeResponseOperationTypeEnum { + values := make([]AttributeResponseOperationTypeEnum, 0) + for _, v := range mappingAttributeResponseOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetAttributeResponseOperationTypeEnumStringValues Enumerates the set of values in String for AttributeResponseOperationTypeEnum +func GetAttributeResponseOperationTypeEnumStringValues() []string { + return []string{ + "ACTIVATE", + "DEACTIVATE", + } +} + +// GetMappingAttributeResponseOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeResponseOperationTypeEnum(val string) (AttributeResponseOperationTypeEnum, bool) { + enum, ok := mappingAttributeResponseOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeResponseAttributeNameSpaceEnum Enum with underlying type: string +type AttributeResponseAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for AttributeResponseAttributeNameSpaceEnum +const ( + AttributeResponseAttributeNameSpaceTraces AttributeResponseAttributeNameSpaceEnum = "TRACES" + AttributeResponseAttributeNameSpaceSynthetic AttributeResponseAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingAttributeResponseAttributeNameSpaceEnum = map[string]AttributeResponseAttributeNameSpaceEnum{ + "TRACES": AttributeResponseAttributeNameSpaceTraces, + "SYNTHETIC": AttributeResponseAttributeNameSpaceSynthetic, +} + +var mappingAttributeResponseAttributeNameSpaceEnumLowerCase = map[string]AttributeResponseAttributeNameSpaceEnum{ + "traces": AttributeResponseAttributeNameSpaceTraces, + "synthetic": AttributeResponseAttributeNameSpaceSynthetic, +} + +// GetAttributeResponseAttributeNameSpaceEnumValues Enumerates the set of values for AttributeResponseAttributeNameSpaceEnum +func GetAttributeResponseAttributeNameSpaceEnumValues() []AttributeResponseAttributeNameSpaceEnum { + values := make([]AttributeResponseAttributeNameSpaceEnum, 0) + for _, v := range mappingAttributeResponseAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetAttributeResponseAttributeNameSpaceEnumStringValues Enumerates the set of values in String for AttributeResponseAttributeNameSpaceEnum +func GetAttributeResponseAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingAttributeResponseAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeResponseAttributeNameSpaceEnum(val string) (AttributeResponseAttributeNameSpaceEnum, bool) { + enum, ok := mappingAttributeResponseAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeResponseAttributeStatusEnum Enum with underlying type: string +type AttributeResponseAttributeStatusEnum string + +// Set of constants representing the allowable values for AttributeResponseAttributeStatusEnum +const ( + AttributeResponseAttributeStatusAttributeAlreadyActive AttributeResponseAttributeStatusEnum = "ATTRIBUTE_ALREADY_ACTIVE" + AttributeResponseAttributeStatusAttributeActivated AttributeResponseAttributeStatusEnum = "ATTRIBUTE_ACTIVATED" + AttributeResponseAttributeStatusAttributeDeactivated AttributeResponseAttributeStatusEnum = "ATTRIBUTE_DEACTIVATED" + AttributeResponseAttributeStatusDeactivationNotAllowed AttributeResponseAttributeStatusEnum = "DEACTIVATION_NOT_ALLOWED" + AttributeResponseAttributeStatusAttributeDoesNotExist AttributeResponseAttributeStatusEnum = "ATTRIBUTE_DOES_NOT_EXIST" + AttributeResponseAttributeStatusAttributeAlreadyDeactivated AttributeResponseAttributeStatusEnum = "ATTRIBUTE_ALREADY_DEACTIVATED" + AttributeResponseAttributeStatusDuplicateAttribute AttributeResponseAttributeStatusEnum = "DUPLICATE_ATTRIBUTE" + AttributeResponseAttributeStatusInvalidAttribute AttributeResponseAttributeStatusEnum = "INVALID_ATTRIBUTE" + AttributeResponseAttributeStatusInvalidAttributeTypeConflict AttributeResponseAttributeStatusEnum = "INVALID_ATTRIBUTE_TYPE_CONFLICT" + AttributeResponseAttributeStatusAttributeNotProcessed AttributeResponseAttributeStatusEnum = "ATTRIBUTE_NOT_PROCESSED" + AttributeResponseAttributeStatusAttributeUpdateNotAllowed AttributeResponseAttributeStatusEnum = "ATTRIBUTE_UPDATE_NOT_ALLOWED" +) + +var mappingAttributeResponseAttributeStatusEnum = map[string]AttributeResponseAttributeStatusEnum{ + "ATTRIBUTE_ALREADY_ACTIVE": AttributeResponseAttributeStatusAttributeAlreadyActive, + "ATTRIBUTE_ACTIVATED": AttributeResponseAttributeStatusAttributeActivated, + "ATTRIBUTE_DEACTIVATED": AttributeResponseAttributeStatusAttributeDeactivated, + "DEACTIVATION_NOT_ALLOWED": AttributeResponseAttributeStatusDeactivationNotAllowed, + "ATTRIBUTE_DOES_NOT_EXIST": AttributeResponseAttributeStatusAttributeDoesNotExist, + "ATTRIBUTE_ALREADY_DEACTIVATED": AttributeResponseAttributeStatusAttributeAlreadyDeactivated, + "DUPLICATE_ATTRIBUTE": AttributeResponseAttributeStatusDuplicateAttribute, + "INVALID_ATTRIBUTE": AttributeResponseAttributeStatusInvalidAttribute, + "INVALID_ATTRIBUTE_TYPE_CONFLICT": AttributeResponseAttributeStatusInvalidAttributeTypeConflict, + "ATTRIBUTE_NOT_PROCESSED": AttributeResponseAttributeStatusAttributeNotProcessed, + "ATTRIBUTE_UPDATE_NOT_ALLOWED": AttributeResponseAttributeStatusAttributeUpdateNotAllowed, +} + +var mappingAttributeResponseAttributeStatusEnumLowerCase = map[string]AttributeResponseAttributeStatusEnum{ + "attribute_already_active": AttributeResponseAttributeStatusAttributeAlreadyActive, + "attribute_activated": AttributeResponseAttributeStatusAttributeActivated, + "attribute_deactivated": AttributeResponseAttributeStatusAttributeDeactivated, + "deactivation_not_allowed": AttributeResponseAttributeStatusDeactivationNotAllowed, + "attribute_does_not_exist": AttributeResponseAttributeStatusAttributeDoesNotExist, + "attribute_already_deactivated": AttributeResponseAttributeStatusAttributeAlreadyDeactivated, + "duplicate_attribute": AttributeResponseAttributeStatusDuplicateAttribute, + "invalid_attribute": AttributeResponseAttributeStatusInvalidAttribute, + "invalid_attribute_type_conflict": AttributeResponseAttributeStatusInvalidAttributeTypeConflict, + "attribute_not_processed": AttributeResponseAttributeStatusAttributeNotProcessed, + "attribute_update_not_allowed": AttributeResponseAttributeStatusAttributeUpdateNotAllowed, +} + +// GetAttributeResponseAttributeStatusEnumValues Enumerates the set of values for AttributeResponseAttributeStatusEnum +func GetAttributeResponseAttributeStatusEnumValues() []AttributeResponseAttributeStatusEnum { + values := make([]AttributeResponseAttributeStatusEnum, 0) + for _, v := range mappingAttributeResponseAttributeStatusEnum { + values = append(values, v) + } + return values +} + +// GetAttributeResponseAttributeStatusEnumStringValues Enumerates the set of values in String for AttributeResponseAttributeStatusEnum +func GetAttributeResponseAttributeStatusEnumStringValues() []string { + return []string{ + "ATTRIBUTE_ALREADY_ACTIVE", + "ATTRIBUTE_ACTIVATED", + "ATTRIBUTE_DEACTIVATED", + "DEACTIVATION_NOT_ALLOWED", + "ATTRIBUTE_DOES_NOT_EXIST", + "ATTRIBUTE_ALREADY_DEACTIVATED", + "DUPLICATE_ATTRIBUTE", + "INVALID_ATTRIBUTE", + "INVALID_ATTRIBUTE_TYPE_CONFLICT", + "ATTRIBUTE_NOT_PROCESSED", + "ATTRIBUTE_UPDATE_NOT_ALLOWED", + } +} + +// GetMappingAttributeResponseAttributeStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeResponseAttributeStatusEnum(val string) (AttributeResponseAttributeStatusEnum, bool) { + enum, ok := mappingAttributeResponseAttributeStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/attribute_unpin_response.go b/apmtraces/attribute_unpin_response.go new file mode 100644 index 0000000000..6f6f8efdb2 --- /dev/null +++ b/apmtraces/attribute_unpin_response.go @@ -0,0 +1,205 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttributeUnpinResponse Response of an individual attribute item in the bulk unpin operation. +type AttributeUnpinResponse struct { + + // Attribute that was unpinned by this bulk operation. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Type of operation - unpin. + OperationType AttributeUnpinResponseOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Namespace of the attribute whose properties were updated. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace AttributeUnpinResponseAttributeNameSpaceEnum `mandatory:"true" json:"attributeNameSpace"` + + // Status of the attribute after this operation. The attribute can have one of the following statuses after the unpin operation. The attribute + // can have either a success status or an error status. The status of the attribute must be correlated with the operation status property in the bulk operation metadata + // object. The bulk operation will be successful only when all attributes in the bulk request are processed successfully and they get a success status back. + // The following are successful status values of individual attribute items in a bulk attribute unpin operation. + // ATTRIBUTE_UNPINNED - The attribute is marked unpinned and associated notes have been cleared. + // DUPLICATE_ATTRIBUTE - The attribute is a duplicate of an attribute that was present in this bulk request. Note that we deduplicate the attribute collection, process only unique attributes, + // and call out duplicates. A duplicate attribute in a bulk request will not prevent the processing of further attributes in the bulk operation. + // The following values are error statuses and the bulk processing is stopped when the first error is encountered. + // INVALID_ATTRIBUTE - The attribute is invalid. The size of the attribute is more than a 1000 chars. + // ATTRIBUTE_NOT_FOUND - The attribute was not found in the set of pinned attributes. + // ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error. + AttributeStatus AttributeUnpinResponseAttributeStatusEnum `mandatory:"true" json:"attributeStatus"` + + // Time when the attribute was activated or deactivated. Note that ingest might not have picked up the changes even if this time has elapsed. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m AttributeUnpinResponse) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttributeUnpinResponse) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAttributeUnpinResponseOperationTypeEnum(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(GetAttributeUnpinResponseOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeUnpinResponseAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetAttributeUnpinResponseAttributeNameSpaceEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeUnpinResponseAttributeStatusEnum(string(m.AttributeStatus)); !ok && m.AttributeStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeStatus: %s. Supported values are: %s.", m.AttributeStatus, strings.Join(GetAttributeUnpinResponseAttributeStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttributeUnpinResponseOperationTypeEnum Enum with underlying type: string +type AttributeUnpinResponseOperationTypeEnum string + +// Set of constants representing the allowable values for AttributeUnpinResponseOperationTypeEnum +const ( + AttributeUnpinResponseOperationTypeUnpin AttributeUnpinResponseOperationTypeEnum = "UNPIN" +) + +var mappingAttributeUnpinResponseOperationTypeEnum = map[string]AttributeUnpinResponseOperationTypeEnum{ + "UNPIN": AttributeUnpinResponseOperationTypeUnpin, +} + +var mappingAttributeUnpinResponseOperationTypeEnumLowerCase = map[string]AttributeUnpinResponseOperationTypeEnum{ + "unpin": AttributeUnpinResponseOperationTypeUnpin, +} + +// GetAttributeUnpinResponseOperationTypeEnumValues Enumerates the set of values for AttributeUnpinResponseOperationTypeEnum +func GetAttributeUnpinResponseOperationTypeEnumValues() []AttributeUnpinResponseOperationTypeEnum { + values := make([]AttributeUnpinResponseOperationTypeEnum, 0) + for _, v := range mappingAttributeUnpinResponseOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUnpinResponseOperationTypeEnumStringValues Enumerates the set of values in String for AttributeUnpinResponseOperationTypeEnum +func GetAttributeUnpinResponseOperationTypeEnumStringValues() []string { + return []string{ + "UNPIN", + } +} + +// GetMappingAttributeUnpinResponseOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUnpinResponseOperationTypeEnum(val string) (AttributeUnpinResponseOperationTypeEnum, bool) { + enum, ok := mappingAttributeUnpinResponseOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUnpinResponseAttributeNameSpaceEnum Enum with underlying type: string +type AttributeUnpinResponseAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for AttributeUnpinResponseAttributeNameSpaceEnum +const ( + AttributeUnpinResponseAttributeNameSpaceTraces AttributeUnpinResponseAttributeNameSpaceEnum = "TRACES" + AttributeUnpinResponseAttributeNameSpaceSynthetic AttributeUnpinResponseAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingAttributeUnpinResponseAttributeNameSpaceEnum = map[string]AttributeUnpinResponseAttributeNameSpaceEnum{ + "TRACES": AttributeUnpinResponseAttributeNameSpaceTraces, + "SYNTHETIC": AttributeUnpinResponseAttributeNameSpaceSynthetic, +} + +var mappingAttributeUnpinResponseAttributeNameSpaceEnumLowerCase = map[string]AttributeUnpinResponseAttributeNameSpaceEnum{ + "traces": AttributeUnpinResponseAttributeNameSpaceTraces, + "synthetic": AttributeUnpinResponseAttributeNameSpaceSynthetic, +} + +// GetAttributeUnpinResponseAttributeNameSpaceEnumValues Enumerates the set of values for AttributeUnpinResponseAttributeNameSpaceEnum +func GetAttributeUnpinResponseAttributeNameSpaceEnumValues() []AttributeUnpinResponseAttributeNameSpaceEnum { + values := make([]AttributeUnpinResponseAttributeNameSpaceEnum, 0) + for _, v := range mappingAttributeUnpinResponseAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUnpinResponseAttributeNameSpaceEnumStringValues Enumerates the set of values in String for AttributeUnpinResponseAttributeNameSpaceEnum +func GetAttributeUnpinResponseAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingAttributeUnpinResponseAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUnpinResponseAttributeNameSpaceEnum(val string) (AttributeUnpinResponseAttributeNameSpaceEnum, bool) { + enum, ok := mappingAttributeUnpinResponseAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUnpinResponseAttributeStatusEnum Enum with underlying type: string +type AttributeUnpinResponseAttributeStatusEnum string + +// Set of constants representing the allowable values for AttributeUnpinResponseAttributeStatusEnum +const ( + AttributeUnpinResponseAttributeStatusAttributeUnpinned AttributeUnpinResponseAttributeStatusEnum = "ATTRIBUTE_UNPINNED" + AttributeUnpinResponseAttributeStatusDuplicateAttribute AttributeUnpinResponseAttributeStatusEnum = "DUPLICATE_ATTRIBUTE" + AttributeUnpinResponseAttributeStatusInvalidAttribute AttributeUnpinResponseAttributeStatusEnum = "INVALID_ATTRIBUTE" + AttributeUnpinResponseAttributeStatusAttributeNotFound AttributeUnpinResponseAttributeStatusEnum = "ATTRIBUTE_NOT_FOUND" + AttributeUnpinResponseAttributeStatusAttributeNotProcessed AttributeUnpinResponseAttributeStatusEnum = "ATTRIBUTE_NOT_PROCESSED" +) + +var mappingAttributeUnpinResponseAttributeStatusEnum = map[string]AttributeUnpinResponseAttributeStatusEnum{ + "ATTRIBUTE_UNPINNED": AttributeUnpinResponseAttributeStatusAttributeUnpinned, + "DUPLICATE_ATTRIBUTE": AttributeUnpinResponseAttributeStatusDuplicateAttribute, + "INVALID_ATTRIBUTE": AttributeUnpinResponseAttributeStatusInvalidAttribute, + "ATTRIBUTE_NOT_FOUND": AttributeUnpinResponseAttributeStatusAttributeNotFound, + "ATTRIBUTE_NOT_PROCESSED": AttributeUnpinResponseAttributeStatusAttributeNotProcessed, +} + +var mappingAttributeUnpinResponseAttributeStatusEnumLowerCase = map[string]AttributeUnpinResponseAttributeStatusEnum{ + "attribute_unpinned": AttributeUnpinResponseAttributeStatusAttributeUnpinned, + "duplicate_attribute": AttributeUnpinResponseAttributeStatusDuplicateAttribute, + "invalid_attribute": AttributeUnpinResponseAttributeStatusInvalidAttribute, + "attribute_not_found": AttributeUnpinResponseAttributeStatusAttributeNotFound, + "attribute_not_processed": AttributeUnpinResponseAttributeStatusAttributeNotProcessed, +} + +// GetAttributeUnpinResponseAttributeStatusEnumValues Enumerates the set of values for AttributeUnpinResponseAttributeStatusEnum +func GetAttributeUnpinResponseAttributeStatusEnumValues() []AttributeUnpinResponseAttributeStatusEnum { + values := make([]AttributeUnpinResponseAttributeStatusEnum, 0) + for _, v := range mappingAttributeUnpinResponseAttributeStatusEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUnpinResponseAttributeStatusEnumStringValues Enumerates the set of values in String for AttributeUnpinResponseAttributeStatusEnum +func GetAttributeUnpinResponseAttributeStatusEnumStringValues() []string { + return []string{ + "ATTRIBUTE_UNPINNED", + "DUPLICATE_ATTRIBUTE", + "INVALID_ATTRIBUTE", + "ATTRIBUTE_NOT_FOUND", + "ATTRIBUTE_NOT_PROCESSED", + } +} + +// GetMappingAttributeUnpinResponseAttributeStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUnpinResponseAttributeStatusEnum(val string) (AttributeUnpinResponseAttributeStatusEnum, bool) { + enum, ok := mappingAttributeUnpinResponseAttributeStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/attribute_update_notes_response.go b/apmtraces/attribute_update_notes_response.go new file mode 100644 index 0000000000..47eeaada1c --- /dev/null +++ b/apmtraces/attribute_update_notes_response.go @@ -0,0 +1,213 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttributeUpdateNotesResponse Response of an individual attribute item in the bulk update notes operation. +type AttributeUpdateNotesResponse struct { + + // Attribute for which notes were added to or edited in this bulk operation. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Notes added to or edited for this attribute. + Notes *string `mandatory:"true" json:"notes"` + + // Type of operation - UPDATE_NOTES. + OperationType AttributeUpdateNotesResponseOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Namespace of the attribute whose notes were updated. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace AttributeUpdateNotesResponseAttributeNameSpaceEnum `mandatory:"true" json:"attributeNameSpace"` + + // Status of the attribute after this operation. The attribute can have one of the following statuses after the update notes operation. The attribute + // can have either a success status or an error status. The status of the attribute must be correlated with the operation status property in the bulk operation metadata + // object. The bulk operation will be successful only when all attributes in the bulk request are processed successfully and they get a success status back. + // The following are successful status values of individual attribute items in a bulk update notes operation. + // ATTRIBUTE_NOTES_UPDATED - The attribute's notes have been updated with the given notes. + // DUPLICATE_ATTRIBUTE - The attribute is a duplicate of an attribute that was present in this bulk request. Note that we deduplicate the attribute collection, process only unique attributes, + // and call out duplicates. A duplicate attribute in a bulk request will not prevent the processing of further attributes in the bulk operation. + // The following values are error statuses and the bulk processing is stopped when the first error is encountered. + // INVALID_ATTRIBUTE - The attribute is invalid. The length of the notes is more than a 1000 characters. + // ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error. + // ATTRIBUTE_DOES_NOT_EXIST - Attribute was neither active nor pinned inactive. + // NOTES_TOO_LONG - Attribute notes were too long (more than 1000 chars). + AttributeStatus AttributeUpdateNotesResponseAttributeStatusEnum `mandatory:"true" json:"attributeStatus"` + + // Time when the attribute's notes were updated. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m AttributeUpdateNotesResponse) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttributeUpdateNotesResponse) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAttributeUpdateNotesResponseOperationTypeEnum(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(GetAttributeUpdateNotesResponseOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeUpdateNotesResponseAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetAttributeUpdateNotesResponseAttributeNameSpaceEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeUpdateNotesResponseAttributeStatusEnum(string(m.AttributeStatus)); !ok && m.AttributeStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeStatus: %s. Supported values are: %s.", m.AttributeStatus, strings.Join(GetAttributeUpdateNotesResponseAttributeStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttributeUpdateNotesResponseOperationTypeEnum Enum with underlying type: string +type AttributeUpdateNotesResponseOperationTypeEnum string + +// Set of constants representing the allowable values for AttributeUpdateNotesResponseOperationTypeEnum +const ( + AttributeUpdateNotesResponseOperationTypeUpdateNotes AttributeUpdateNotesResponseOperationTypeEnum = "UPDATE_NOTES" +) + +var mappingAttributeUpdateNotesResponseOperationTypeEnum = map[string]AttributeUpdateNotesResponseOperationTypeEnum{ + "UPDATE_NOTES": AttributeUpdateNotesResponseOperationTypeUpdateNotes, +} + +var mappingAttributeUpdateNotesResponseOperationTypeEnumLowerCase = map[string]AttributeUpdateNotesResponseOperationTypeEnum{ + "update_notes": AttributeUpdateNotesResponseOperationTypeUpdateNotes, +} + +// GetAttributeUpdateNotesResponseOperationTypeEnumValues Enumerates the set of values for AttributeUpdateNotesResponseOperationTypeEnum +func GetAttributeUpdateNotesResponseOperationTypeEnumValues() []AttributeUpdateNotesResponseOperationTypeEnum { + values := make([]AttributeUpdateNotesResponseOperationTypeEnum, 0) + for _, v := range mappingAttributeUpdateNotesResponseOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateNotesResponseOperationTypeEnumStringValues Enumerates the set of values in String for AttributeUpdateNotesResponseOperationTypeEnum +func GetAttributeUpdateNotesResponseOperationTypeEnumStringValues() []string { + return []string{ + "UPDATE_NOTES", + } +} + +// GetMappingAttributeUpdateNotesResponseOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateNotesResponseOperationTypeEnum(val string) (AttributeUpdateNotesResponseOperationTypeEnum, bool) { + enum, ok := mappingAttributeUpdateNotesResponseOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUpdateNotesResponseAttributeNameSpaceEnum Enum with underlying type: string +type AttributeUpdateNotesResponseAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for AttributeUpdateNotesResponseAttributeNameSpaceEnum +const ( + AttributeUpdateNotesResponseAttributeNameSpaceTraces AttributeUpdateNotesResponseAttributeNameSpaceEnum = "TRACES" + AttributeUpdateNotesResponseAttributeNameSpaceSynthetic AttributeUpdateNotesResponseAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingAttributeUpdateNotesResponseAttributeNameSpaceEnum = map[string]AttributeUpdateNotesResponseAttributeNameSpaceEnum{ + "TRACES": AttributeUpdateNotesResponseAttributeNameSpaceTraces, + "SYNTHETIC": AttributeUpdateNotesResponseAttributeNameSpaceSynthetic, +} + +var mappingAttributeUpdateNotesResponseAttributeNameSpaceEnumLowerCase = map[string]AttributeUpdateNotesResponseAttributeNameSpaceEnum{ + "traces": AttributeUpdateNotesResponseAttributeNameSpaceTraces, + "synthetic": AttributeUpdateNotesResponseAttributeNameSpaceSynthetic, +} + +// GetAttributeUpdateNotesResponseAttributeNameSpaceEnumValues Enumerates the set of values for AttributeUpdateNotesResponseAttributeNameSpaceEnum +func GetAttributeUpdateNotesResponseAttributeNameSpaceEnumValues() []AttributeUpdateNotesResponseAttributeNameSpaceEnum { + values := make([]AttributeUpdateNotesResponseAttributeNameSpaceEnum, 0) + for _, v := range mappingAttributeUpdateNotesResponseAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateNotesResponseAttributeNameSpaceEnumStringValues Enumerates the set of values in String for AttributeUpdateNotesResponseAttributeNameSpaceEnum +func GetAttributeUpdateNotesResponseAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingAttributeUpdateNotesResponseAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateNotesResponseAttributeNameSpaceEnum(val string) (AttributeUpdateNotesResponseAttributeNameSpaceEnum, bool) { + enum, ok := mappingAttributeUpdateNotesResponseAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUpdateNotesResponseAttributeStatusEnum Enum with underlying type: string +type AttributeUpdateNotesResponseAttributeStatusEnum string + +// Set of constants representing the allowable values for AttributeUpdateNotesResponseAttributeStatusEnum +const ( + AttributeUpdateNotesResponseAttributeStatusAttributeNotesUpdated AttributeUpdateNotesResponseAttributeStatusEnum = "ATTRIBUTE_NOTES_UPDATED" + AttributeUpdateNotesResponseAttributeStatusDuplicateAttribute AttributeUpdateNotesResponseAttributeStatusEnum = "DUPLICATE_ATTRIBUTE" + AttributeUpdateNotesResponseAttributeStatusInvalidAttribute AttributeUpdateNotesResponseAttributeStatusEnum = "INVALID_ATTRIBUTE" + AttributeUpdateNotesResponseAttributeStatusAttributeNotProcessed AttributeUpdateNotesResponseAttributeStatusEnum = "ATTRIBUTE_NOT_PROCESSED" + AttributeUpdateNotesResponseAttributeStatusAttributeDoesNotExist AttributeUpdateNotesResponseAttributeStatusEnum = "ATTRIBUTE_DOES_NOT_EXIST" + AttributeUpdateNotesResponseAttributeStatusNotesTooLong AttributeUpdateNotesResponseAttributeStatusEnum = "NOTES_TOO_LONG" +) + +var mappingAttributeUpdateNotesResponseAttributeStatusEnum = map[string]AttributeUpdateNotesResponseAttributeStatusEnum{ + "ATTRIBUTE_NOTES_UPDATED": AttributeUpdateNotesResponseAttributeStatusAttributeNotesUpdated, + "DUPLICATE_ATTRIBUTE": AttributeUpdateNotesResponseAttributeStatusDuplicateAttribute, + "INVALID_ATTRIBUTE": AttributeUpdateNotesResponseAttributeStatusInvalidAttribute, + "ATTRIBUTE_NOT_PROCESSED": AttributeUpdateNotesResponseAttributeStatusAttributeNotProcessed, + "ATTRIBUTE_DOES_NOT_EXIST": AttributeUpdateNotesResponseAttributeStatusAttributeDoesNotExist, + "NOTES_TOO_LONG": AttributeUpdateNotesResponseAttributeStatusNotesTooLong, +} + +var mappingAttributeUpdateNotesResponseAttributeStatusEnumLowerCase = map[string]AttributeUpdateNotesResponseAttributeStatusEnum{ + "attribute_notes_updated": AttributeUpdateNotesResponseAttributeStatusAttributeNotesUpdated, + "duplicate_attribute": AttributeUpdateNotesResponseAttributeStatusDuplicateAttribute, + "invalid_attribute": AttributeUpdateNotesResponseAttributeStatusInvalidAttribute, + "attribute_not_processed": AttributeUpdateNotesResponseAttributeStatusAttributeNotProcessed, + "attribute_does_not_exist": AttributeUpdateNotesResponseAttributeStatusAttributeDoesNotExist, + "notes_too_long": AttributeUpdateNotesResponseAttributeStatusNotesTooLong, +} + +// GetAttributeUpdateNotesResponseAttributeStatusEnumValues Enumerates the set of values for AttributeUpdateNotesResponseAttributeStatusEnum +func GetAttributeUpdateNotesResponseAttributeStatusEnumValues() []AttributeUpdateNotesResponseAttributeStatusEnum { + values := make([]AttributeUpdateNotesResponseAttributeStatusEnum, 0) + for _, v := range mappingAttributeUpdateNotesResponseAttributeStatusEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateNotesResponseAttributeStatusEnumStringValues Enumerates the set of values in String for AttributeUpdateNotesResponseAttributeStatusEnum +func GetAttributeUpdateNotesResponseAttributeStatusEnumStringValues() []string { + return []string{ + "ATTRIBUTE_NOTES_UPDATED", + "DUPLICATE_ATTRIBUTE", + "INVALID_ATTRIBUTE", + "ATTRIBUTE_NOT_PROCESSED", + "ATTRIBUTE_DOES_NOT_EXIST", + "NOTES_TOO_LONG", + } +} + +// GetMappingAttributeUpdateNotesResponseAttributeStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateNotesResponseAttributeStatusEnum(val string) (AttributeUpdateNotesResponseAttributeStatusEnum, bool) { + enum, ok := mappingAttributeUpdateNotesResponseAttributeStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/attribute_update_response.go b/apmtraces/attribute_update_response.go new file mode 100644 index 0000000000..ab9048c404 --- /dev/null +++ b/apmtraces/attribute_update_response.go @@ -0,0 +1,329 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttributeUpdateResponse Response of an individual attribute item in the bulk update attribute operation. +type AttributeUpdateResponse struct { + + // Attribute for which properties were updated in this bulk operation. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Namespace of the attribute whose properties were updated. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace AttributeUpdateResponseAttributeNameSpaceEnum `mandatory:"true" json:"attributeNameSpace"` + + // Time when the attribute's properties were updated. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Type of the attribute. + AttributeType AttributeUpdateResponseAttributeTypeEnum `mandatory:"false" json:"attributeType,omitempty"` + + // Unit updated for this attribute. + Unit AttributeUpdateResponseUnitEnum `mandatory:"false" json:"unit,omitempty"` + + // Notes for the attribute. + Notes *string `mandatory:"false" json:"notes"` + + // Type of operation - UPDATE_ATTRIBUTE_PROPERTIES. + OperationType AttributeUpdateResponseOperationTypeEnum `mandatory:"false" json:"operationType,omitempty"` + + // Status of the attribute after this operation. The attribute can have one of the following statuses after the update operation. The attribute + // can have either a success status or an error status. The status of the attribute must be correlated with the operation status property in the bulk operation metadata + // object. The bulk operation will be successful only when all attributes in the bulk request are processed successfully and they get a success status back. + // The following are successful status values of individual attribute items in a bulk update attribute operation. + // ATTRIBUTE_UPDATED - The attribute's properites have been updated with the given properties. + // DUPLICATE_ATTRIBUTE - The attribute is a duplicate of an attribute that was present in this bulk request. Note that we deduplicate the attribute collection, process only unique attributes, + // and call out duplicates. A duplicate attribute in a bulk request will not prevent the processing of further attributes in the bulk operation. + // The following values are error statuses and the bulk processing is stopped when the first error is encountered. + // INVALID_ATTRIBUTE - The attribute is invalid. + // ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error. + // ATTRIBUTE_DOES_NOT_EXIST - Attribute was neither active nor pinned inactive. + // ATTRIBUTE_UPDATE_NOT_ALLOWED - Attribute update is not allowed as it is an in-built system attribute. + AttributeStatus AttributeUpdateResponseAttributeStatusEnum `mandatory:"false" json:"attributeStatus,omitempty"` +} + +func (m AttributeUpdateResponse) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AttributeUpdateResponse) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAttributeUpdateResponseAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetAttributeUpdateResponseAttributeNameSpaceEnumStringValues(), ","))) + } + + if _, ok := GetMappingAttributeUpdateResponseAttributeTypeEnum(string(m.AttributeType)); !ok && m.AttributeType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeType: %s. Supported values are: %s.", m.AttributeType, strings.Join(GetAttributeUpdateResponseAttributeTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeUpdateResponseUnitEnum(string(m.Unit)); !ok && m.Unit != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Unit: %s. Supported values are: %s.", m.Unit, strings.Join(GetAttributeUpdateResponseUnitEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeUpdateResponseOperationTypeEnum(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(GetAttributeUpdateResponseOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAttributeUpdateResponseAttributeStatusEnum(string(m.AttributeStatus)); !ok && m.AttributeStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeStatus: %s. Supported values are: %s.", m.AttributeStatus, strings.Join(GetAttributeUpdateResponseAttributeStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttributeUpdateResponseAttributeTypeEnum Enum with underlying type: string +type AttributeUpdateResponseAttributeTypeEnum string + +// Set of constants representing the allowable values for AttributeUpdateResponseAttributeTypeEnum +const ( + AttributeUpdateResponseAttributeTypeNumeric AttributeUpdateResponseAttributeTypeEnum = "NUMERIC" + AttributeUpdateResponseAttributeTypeString AttributeUpdateResponseAttributeTypeEnum = "STRING" +) + +var mappingAttributeUpdateResponseAttributeTypeEnum = map[string]AttributeUpdateResponseAttributeTypeEnum{ + "NUMERIC": AttributeUpdateResponseAttributeTypeNumeric, + "STRING": AttributeUpdateResponseAttributeTypeString, +} + +var mappingAttributeUpdateResponseAttributeTypeEnumLowerCase = map[string]AttributeUpdateResponseAttributeTypeEnum{ + "numeric": AttributeUpdateResponseAttributeTypeNumeric, + "string": AttributeUpdateResponseAttributeTypeString, +} + +// GetAttributeUpdateResponseAttributeTypeEnumValues Enumerates the set of values for AttributeUpdateResponseAttributeTypeEnum +func GetAttributeUpdateResponseAttributeTypeEnumValues() []AttributeUpdateResponseAttributeTypeEnum { + values := make([]AttributeUpdateResponseAttributeTypeEnum, 0) + for _, v := range mappingAttributeUpdateResponseAttributeTypeEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateResponseAttributeTypeEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseAttributeTypeEnum +func GetAttributeUpdateResponseAttributeTypeEnumStringValues() []string { + return []string{ + "NUMERIC", + "STRING", + } +} + +// GetMappingAttributeUpdateResponseAttributeTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateResponseAttributeTypeEnum(val string) (AttributeUpdateResponseAttributeTypeEnum, bool) { + enum, ok := mappingAttributeUpdateResponseAttributeTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUpdateResponseUnitEnum Enum with underlying type: string +type AttributeUpdateResponseUnitEnum string + +// Set of constants representing the allowable values for AttributeUpdateResponseUnitEnum +const ( + AttributeUpdateResponseUnitNone AttributeUpdateResponseUnitEnum = "NONE" + AttributeUpdateResponseUnitEpochTimeMs AttributeUpdateResponseUnitEnum = "EPOCH_TIME_MS" + AttributeUpdateResponseUnitBytes AttributeUpdateResponseUnitEnum = "BYTES" + AttributeUpdateResponseUnitCount AttributeUpdateResponseUnitEnum = "COUNT" + AttributeUpdateResponseUnitDurationMs AttributeUpdateResponseUnitEnum = "DURATION_MS" + AttributeUpdateResponseUnitTraceStatus AttributeUpdateResponseUnitEnum = "TRACE_STATUS" + AttributeUpdateResponseUnitPercentage AttributeUpdateResponseUnitEnum = "PERCENTAGE" +) + +var mappingAttributeUpdateResponseUnitEnum = map[string]AttributeUpdateResponseUnitEnum{ + "NONE": AttributeUpdateResponseUnitNone, + "EPOCH_TIME_MS": AttributeUpdateResponseUnitEpochTimeMs, + "BYTES": AttributeUpdateResponseUnitBytes, + "COUNT": AttributeUpdateResponseUnitCount, + "DURATION_MS": AttributeUpdateResponseUnitDurationMs, + "TRACE_STATUS": AttributeUpdateResponseUnitTraceStatus, + "PERCENTAGE": AttributeUpdateResponseUnitPercentage, +} + +var mappingAttributeUpdateResponseUnitEnumLowerCase = map[string]AttributeUpdateResponseUnitEnum{ + "none": AttributeUpdateResponseUnitNone, + "epoch_time_ms": AttributeUpdateResponseUnitEpochTimeMs, + "bytes": AttributeUpdateResponseUnitBytes, + "count": AttributeUpdateResponseUnitCount, + "duration_ms": AttributeUpdateResponseUnitDurationMs, + "trace_status": AttributeUpdateResponseUnitTraceStatus, + "percentage": AttributeUpdateResponseUnitPercentage, +} + +// GetAttributeUpdateResponseUnitEnumValues Enumerates the set of values for AttributeUpdateResponseUnitEnum +func GetAttributeUpdateResponseUnitEnumValues() []AttributeUpdateResponseUnitEnum { + values := make([]AttributeUpdateResponseUnitEnum, 0) + for _, v := range mappingAttributeUpdateResponseUnitEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateResponseUnitEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseUnitEnum +func GetAttributeUpdateResponseUnitEnumStringValues() []string { + return []string{ + "NONE", + "EPOCH_TIME_MS", + "BYTES", + "COUNT", + "DURATION_MS", + "TRACE_STATUS", + "PERCENTAGE", + } +} + +// GetMappingAttributeUpdateResponseUnitEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateResponseUnitEnum(val string) (AttributeUpdateResponseUnitEnum, bool) { + enum, ok := mappingAttributeUpdateResponseUnitEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUpdateResponseOperationTypeEnum Enum with underlying type: string +type AttributeUpdateResponseOperationTypeEnum string + +// Set of constants representing the allowable values for AttributeUpdateResponseOperationTypeEnum +const ( + AttributeUpdateResponseOperationTypeUpdateAttributeProperties AttributeUpdateResponseOperationTypeEnum = "UPDATE_ATTRIBUTE_PROPERTIES" +) + +var mappingAttributeUpdateResponseOperationTypeEnum = map[string]AttributeUpdateResponseOperationTypeEnum{ + "UPDATE_ATTRIBUTE_PROPERTIES": AttributeUpdateResponseOperationTypeUpdateAttributeProperties, +} + +var mappingAttributeUpdateResponseOperationTypeEnumLowerCase = map[string]AttributeUpdateResponseOperationTypeEnum{ + "update_attribute_properties": AttributeUpdateResponseOperationTypeUpdateAttributeProperties, +} + +// GetAttributeUpdateResponseOperationTypeEnumValues Enumerates the set of values for AttributeUpdateResponseOperationTypeEnum +func GetAttributeUpdateResponseOperationTypeEnumValues() []AttributeUpdateResponseOperationTypeEnum { + values := make([]AttributeUpdateResponseOperationTypeEnum, 0) + for _, v := range mappingAttributeUpdateResponseOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateResponseOperationTypeEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseOperationTypeEnum +func GetAttributeUpdateResponseOperationTypeEnumStringValues() []string { + return []string{ + "UPDATE_ATTRIBUTE_PROPERTIES", + } +} + +// GetMappingAttributeUpdateResponseOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateResponseOperationTypeEnum(val string) (AttributeUpdateResponseOperationTypeEnum, bool) { + enum, ok := mappingAttributeUpdateResponseOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUpdateResponseAttributeStatusEnum Enum with underlying type: string +type AttributeUpdateResponseAttributeStatusEnum string + +// Set of constants representing the allowable values for AttributeUpdateResponseAttributeStatusEnum +const ( + AttributeUpdateResponseAttributeStatusAttributeUpdated AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_UPDATED" + AttributeUpdateResponseAttributeStatusDuplicateAttribute AttributeUpdateResponseAttributeStatusEnum = "DUPLICATE_ATTRIBUTE" + AttributeUpdateResponseAttributeStatusInvalidAttribute AttributeUpdateResponseAttributeStatusEnum = "INVALID_ATTRIBUTE" + AttributeUpdateResponseAttributeStatusAttributeNotProcessed AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_NOT_PROCESSED" + AttributeUpdateResponseAttributeStatusAttributeDoesNotExist AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_DOES_NOT_EXIST" + AttributeUpdateResponseAttributeStatusAttributeUpdateNotAllowed AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_UPDATE_NOT_ALLOWED" +) + +var mappingAttributeUpdateResponseAttributeStatusEnum = map[string]AttributeUpdateResponseAttributeStatusEnum{ + "ATTRIBUTE_UPDATED": AttributeUpdateResponseAttributeStatusAttributeUpdated, + "DUPLICATE_ATTRIBUTE": AttributeUpdateResponseAttributeStatusDuplicateAttribute, + "INVALID_ATTRIBUTE": AttributeUpdateResponseAttributeStatusInvalidAttribute, + "ATTRIBUTE_NOT_PROCESSED": AttributeUpdateResponseAttributeStatusAttributeNotProcessed, + "ATTRIBUTE_DOES_NOT_EXIST": AttributeUpdateResponseAttributeStatusAttributeDoesNotExist, + "ATTRIBUTE_UPDATE_NOT_ALLOWED": AttributeUpdateResponseAttributeStatusAttributeUpdateNotAllowed, +} + +var mappingAttributeUpdateResponseAttributeStatusEnumLowerCase = map[string]AttributeUpdateResponseAttributeStatusEnum{ + "attribute_updated": AttributeUpdateResponseAttributeStatusAttributeUpdated, + "duplicate_attribute": AttributeUpdateResponseAttributeStatusDuplicateAttribute, + "invalid_attribute": AttributeUpdateResponseAttributeStatusInvalidAttribute, + "attribute_not_processed": AttributeUpdateResponseAttributeStatusAttributeNotProcessed, + "attribute_does_not_exist": AttributeUpdateResponseAttributeStatusAttributeDoesNotExist, + "attribute_update_not_allowed": AttributeUpdateResponseAttributeStatusAttributeUpdateNotAllowed, +} + +// GetAttributeUpdateResponseAttributeStatusEnumValues Enumerates the set of values for AttributeUpdateResponseAttributeStatusEnum +func GetAttributeUpdateResponseAttributeStatusEnumValues() []AttributeUpdateResponseAttributeStatusEnum { + values := make([]AttributeUpdateResponseAttributeStatusEnum, 0) + for _, v := range mappingAttributeUpdateResponseAttributeStatusEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateResponseAttributeStatusEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseAttributeStatusEnum +func GetAttributeUpdateResponseAttributeStatusEnumStringValues() []string { + return []string{ + "ATTRIBUTE_UPDATED", + "DUPLICATE_ATTRIBUTE", + "INVALID_ATTRIBUTE", + "ATTRIBUTE_NOT_PROCESSED", + "ATTRIBUTE_DOES_NOT_EXIST", + "ATTRIBUTE_UPDATE_NOT_ALLOWED", + } +} + +// GetMappingAttributeUpdateResponseAttributeStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateResponseAttributeStatusEnum(val string) (AttributeUpdateResponseAttributeStatusEnum, bool) { + enum, ok := mappingAttributeUpdateResponseAttributeStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AttributeUpdateResponseAttributeNameSpaceEnum Enum with underlying type: string +type AttributeUpdateResponseAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for AttributeUpdateResponseAttributeNameSpaceEnum +const ( + AttributeUpdateResponseAttributeNameSpaceTraces AttributeUpdateResponseAttributeNameSpaceEnum = "TRACES" + AttributeUpdateResponseAttributeNameSpaceSynthetic AttributeUpdateResponseAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingAttributeUpdateResponseAttributeNameSpaceEnum = map[string]AttributeUpdateResponseAttributeNameSpaceEnum{ + "TRACES": AttributeUpdateResponseAttributeNameSpaceTraces, + "SYNTHETIC": AttributeUpdateResponseAttributeNameSpaceSynthetic, +} + +var mappingAttributeUpdateResponseAttributeNameSpaceEnumLowerCase = map[string]AttributeUpdateResponseAttributeNameSpaceEnum{ + "traces": AttributeUpdateResponseAttributeNameSpaceTraces, + "synthetic": AttributeUpdateResponseAttributeNameSpaceSynthetic, +} + +// GetAttributeUpdateResponseAttributeNameSpaceEnumValues Enumerates the set of values for AttributeUpdateResponseAttributeNameSpaceEnum +func GetAttributeUpdateResponseAttributeNameSpaceEnumValues() []AttributeUpdateResponseAttributeNameSpaceEnum { + values := make([]AttributeUpdateResponseAttributeNameSpaceEnum, 0) + for _, v := range mappingAttributeUpdateResponseAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetAttributeUpdateResponseAttributeNameSpaceEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseAttributeNameSpaceEnum +func GetAttributeUpdateResponseAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingAttributeUpdateResponseAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAttributeUpdateResponseAttributeNameSpaceEnum(val string) (AttributeUpdateResponseAttributeNameSpaceEnum, bool) { + enum, ok := mappingAttributeUpdateResponseAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/auto_activate_status.go b/apmtraces/auto_activate_status.go new file mode 100644 index 0000000000..736908d019 --- /dev/null +++ b/apmtraces/auto_activate_status.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutoActivateStatus Status of autoactivation for the given data key in the APM Domain. +type AutoActivateStatus struct { + + // State of autoactivation in this APM Domain. If "ON" auto-activate is set to true, if "OFF" auto-activate is set to false. + State *string `mandatory:"true" json:"state"` + + // Data key type for which auto-activate needs needs to be turned on or off. + DataKey AutoActivateStatusDataKeyEnum `mandatory:"true" json:"dataKey"` +} + +func (m AutoActivateStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AutoActivateStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAutoActivateStatusDataKeyEnum(string(m.DataKey)); !ok && m.DataKey != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataKey: %s. Supported values are: %s.", m.DataKey, strings.Join(GetAutoActivateStatusDataKeyEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AutoActivateStatusDataKeyEnum Enum with underlying type: string +type AutoActivateStatusDataKeyEnum string + +// Set of constants representing the allowable values for AutoActivateStatusDataKeyEnum +const ( + AutoActivateStatusDataKeyPrivateDataKey AutoActivateStatusDataKeyEnum = "PRIVATE_DATA_KEY" + AutoActivateStatusDataKeyPublicDataKey AutoActivateStatusDataKeyEnum = "PUBLIC_DATA_KEY" +) + +var mappingAutoActivateStatusDataKeyEnum = map[string]AutoActivateStatusDataKeyEnum{ + "PRIVATE_DATA_KEY": AutoActivateStatusDataKeyPrivateDataKey, + "PUBLIC_DATA_KEY": AutoActivateStatusDataKeyPublicDataKey, +} + +var mappingAutoActivateStatusDataKeyEnumLowerCase = map[string]AutoActivateStatusDataKeyEnum{ + "private_data_key": AutoActivateStatusDataKeyPrivateDataKey, + "public_data_key": AutoActivateStatusDataKeyPublicDataKey, +} + +// GetAutoActivateStatusDataKeyEnumValues Enumerates the set of values for AutoActivateStatusDataKeyEnum +func GetAutoActivateStatusDataKeyEnumValues() []AutoActivateStatusDataKeyEnum { + values := make([]AutoActivateStatusDataKeyEnum, 0) + for _, v := range mappingAutoActivateStatusDataKeyEnum { + values = append(values, v) + } + return values +} + +// GetAutoActivateStatusDataKeyEnumStringValues Enumerates the set of values in String for AutoActivateStatusDataKeyEnum +func GetAutoActivateStatusDataKeyEnumStringValues() []string { + return []string{ + "PRIVATE_DATA_KEY", + "PUBLIC_DATA_KEY", + } +} + +// GetMappingAutoActivateStatusDataKeyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAutoActivateStatusDataKeyEnum(val string) (AutoActivateStatusDataKeyEnum, bool) { + enum, ok := mappingAutoActivateStatusDataKeyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/auto_activate_toggle_status.go b/apmtraces/auto_activate_toggle_status.go new file mode 100644 index 0000000000..c0513c5924 --- /dev/null +++ b/apmtraces/auto_activate_toggle_status.go @@ -0,0 +1,131 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutoActivateToggleStatus Response of a auto-activate toggle operation. +type AutoActivateToggleStatus struct { + + // Status of this operation. + Status AutoActivateToggleStatusStatusEnum `mandatory:"true" json:"status"` + + // State of autoactivation in this APM Domain. If "ON" auto-activate is set to true, if "OFF" auto-activate is set to false. + State *string `mandatory:"true" json:"state"` + + // Data key type for which auto-activate needs needs to be turned on or off. + DataKey AutoActivateToggleStatusDataKeyEnum `mandatory:"true" json:"dataKey"` +} + +func (m AutoActivateToggleStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AutoActivateToggleStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAutoActivateToggleStatusStatusEnum(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(GetAutoActivateToggleStatusStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingAutoActivateToggleStatusDataKeyEnum(string(m.DataKey)); !ok && m.DataKey != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataKey: %s. Supported values are: %s.", m.DataKey, strings.Join(GetAutoActivateToggleStatusDataKeyEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AutoActivateToggleStatusStatusEnum Enum with underlying type: string +type AutoActivateToggleStatusStatusEnum string + +// Set of constants representing the allowable values for AutoActivateToggleStatusStatusEnum +const ( + AutoActivateToggleStatusStatusSuccess AutoActivateToggleStatusStatusEnum = "SUCCESS" +) + +var mappingAutoActivateToggleStatusStatusEnum = map[string]AutoActivateToggleStatusStatusEnum{ + "SUCCESS": AutoActivateToggleStatusStatusSuccess, +} + +var mappingAutoActivateToggleStatusStatusEnumLowerCase = map[string]AutoActivateToggleStatusStatusEnum{ + "success": AutoActivateToggleStatusStatusSuccess, +} + +// GetAutoActivateToggleStatusStatusEnumValues Enumerates the set of values for AutoActivateToggleStatusStatusEnum +func GetAutoActivateToggleStatusStatusEnumValues() []AutoActivateToggleStatusStatusEnum { + values := make([]AutoActivateToggleStatusStatusEnum, 0) + for _, v := range mappingAutoActivateToggleStatusStatusEnum { + values = append(values, v) + } + return values +} + +// GetAutoActivateToggleStatusStatusEnumStringValues Enumerates the set of values in String for AutoActivateToggleStatusStatusEnum +func GetAutoActivateToggleStatusStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + } +} + +// GetMappingAutoActivateToggleStatusStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAutoActivateToggleStatusStatusEnum(val string) (AutoActivateToggleStatusStatusEnum, bool) { + enum, ok := mappingAutoActivateToggleStatusStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// AutoActivateToggleStatusDataKeyEnum Enum with underlying type: string +type AutoActivateToggleStatusDataKeyEnum string + +// Set of constants representing the allowable values for AutoActivateToggleStatusDataKeyEnum +const ( + AutoActivateToggleStatusDataKeyPrivateDataKey AutoActivateToggleStatusDataKeyEnum = "PRIVATE_DATA_KEY" + AutoActivateToggleStatusDataKeyPublicDataKey AutoActivateToggleStatusDataKeyEnum = "PUBLIC_DATA_KEY" +) + +var mappingAutoActivateToggleStatusDataKeyEnum = map[string]AutoActivateToggleStatusDataKeyEnum{ + "PRIVATE_DATA_KEY": AutoActivateToggleStatusDataKeyPrivateDataKey, + "PUBLIC_DATA_KEY": AutoActivateToggleStatusDataKeyPublicDataKey, +} + +var mappingAutoActivateToggleStatusDataKeyEnumLowerCase = map[string]AutoActivateToggleStatusDataKeyEnum{ + "private_data_key": AutoActivateToggleStatusDataKeyPrivateDataKey, + "public_data_key": AutoActivateToggleStatusDataKeyPublicDataKey, +} + +// GetAutoActivateToggleStatusDataKeyEnumValues Enumerates the set of values for AutoActivateToggleStatusDataKeyEnum +func GetAutoActivateToggleStatusDataKeyEnumValues() []AutoActivateToggleStatusDataKeyEnum { + values := make([]AutoActivateToggleStatusDataKeyEnum, 0) + for _, v := range mappingAutoActivateToggleStatusDataKeyEnum { + values = append(values, v) + } + return values +} + +// GetAutoActivateToggleStatusDataKeyEnumStringValues Enumerates the set of values in String for AutoActivateToggleStatusDataKeyEnum +func GetAutoActivateToggleStatusDataKeyEnumStringValues() []string { + return []string{ + "PRIVATE_DATA_KEY", + "PUBLIC_DATA_KEY", + } +} + +// GetMappingAutoActivateToggleStatusDataKeyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAutoActivateToggleStatusDataKeyEnum(val string) (AutoActivateToggleStatusDataKeyEnum, bool) { + enum, ok := mappingAutoActivateToggleStatusDataKeyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_activate_attribute_detail.go b/apmtraces/bulk_activate_attribute_detail.go new file mode 100644 index 0000000000..ab45277f40 --- /dev/null +++ b/apmtraces/bulk_activate_attribute_detail.go @@ -0,0 +1,205 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkActivateAttributeDetail Object that contains the details about a single attribute in the bulk request to be activated. The attributeNameSpace and +// unit are optional parameters, and the attributeNameSpace will default to TRACES if it is not passed in. +type BulkActivateAttributeDetail struct { + + // Name of the attribute to be activated. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Type of the attribute to be activated. + AttributeType BulkActivateAttributeDetailAttributeTypeEnum `mandatory:"true" json:"attributeType"` + + // Unit of the attribute to be updated. + Unit BulkActivateAttributeDetailUnitEnum `mandatory:"false" json:"unit,omitempty"` + + // Namespace of the attribute to be activated. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace BulkActivateAttributeDetailAttributeNameSpaceEnum `mandatory:"false" json:"attributeNameSpace,omitempty"` +} + +func (m BulkActivateAttributeDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkActivateAttributeDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingBulkActivateAttributeDetailAttributeTypeEnum(string(m.AttributeType)); !ok && m.AttributeType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeType: %s. Supported values are: %s.", m.AttributeType, strings.Join(GetBulkActivateAttributeDetailAttributeTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingBulkActivateAttributeDetailUnitEnum(string(m.Unit)); !ok && m.Unit != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Unit: %s. Supported values are: %s.", m.Unit, strings.Join(GetBulkActivateAttributeDetailUnitEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkActivateAttributeDetailAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetBulkActivateAttributeDetailAttributeNameSpaceEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkActivateAttributeDetailAttributeTypeEnum Enum with underlying type: string +type BulkActivateAttributeDetailAttributeTypeEnum string + +// Set of constants representing the allowable values for BulkActivateAttributeDetailAttributeTypeEnum +const ( + BulkActivateAttributeDetailAttributeTypeNumeric BulkActivateAttributeDetailAttributeTypeEnum = "NUMERIC" + BulkActivateAttributeDetailAttributeTypeString BulkActivateAttributeDetailAttributeTypeEnum = "STRING" +) + +var mappingBulkActivateAttributeDetailAttributeTypeEnum = map[string]BulkActivateAttributeDetailAttributeTypeEnum{ + "NUMERIC": BulkActivateAttributeDetailAttributeTypeNumeric, + "STRING": BulkActivateAttributeDetailAttributeTypeString, +} + +var mappingBulkActivateAttributeDetailAttributeTypeEnumLowerCase = map[string]BulkActivateAttributeDetailAttributeTypeEnum{ + "numeric": BulkActivateAttributeDetailAttributeTypeNumeric, + "string": BulkActivateAttributeDetailAttributeTypeString, +} + +// GetBulkActivateAttributeDetailAttributeTypeEnumValues Enumerates the set of values for BulkActivateAttributeDetailAttributeTypeEnum +func GetBulkActivateAttributeDetailAttributeTypeEnumValues() []BulkActivateAttributeDetailAttributeTypeEnum { + values := make([]BulkActivateAttributeDetailAttributeTypeEnum, 0) + for _, v := range mappingBulkActivateAttributeDetailAttributeTypeEnum { + values = append(values, v) + } + return values +} + +// GetBulkActivateAttributeDetailAttributeTypeEnumStringValues Enumerates the set of values in String for BulkActivateAttributeDetailAttributeTypeEnum +func GetBulkActivateAttributeDetailAttributeTypeEnumStringValues() []string { + return []string{ + "NUMERIC", + "STRING", + } +} + +// GetMappingBulkActivateAttributeDetailAttributeTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkActivateAttributeDetailAttributeTypeEnum(val string) (BulkActivateAttributeDetailAttributeTypeEnum, bool) { + enum, ok := mappingBulkActivateAttributeDetailAttributeTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkActivateAttributeDetailUnitEnum Enum with underlying type: string +type BulkActivateAttributeDetailUnitEnum string + +// Set of constants representing the allowable values for BulkActivateAttributeDetailUnitEnum +const ( + BulkActivateAttributeDetailUnitNone BulkActivateAttributeDetailUnitEnum = "NONE" + BulkActivateAttributeDetailUnitEpochTimeMs BulkActivateAttributeDetailUnitEnum = "EPOCH_TIME_MS" + BulkActivateAttributeDetailUnitBytes BulkActivateAttributeDetailUnitEnum = "BYTES" + BulkActivateAttributeDetailUnitCount BulkActivateAttributeDetailUnitEnum = "COUNT" + BulkActivateAttributeDetailUnitDurationMs BulkActivateAttributeDetailUnitEnum = "DURATION_MS" + BulkActivateAttributeDetailUnitTraceStatus BulkActivateAttributeDetailUnitEnum = "TRACE_STATUS" + BulkActivateAttributeDetailUnitPercentage BulkActivateAttributeDetailUnitEnum = "PERCENTAGE" +) + +var mappingBulkActivateAttributeDetailUnitEnum = map[string]BulkActivateAttributeDetailUnitEnum{ + "NONE": BulkActivateAttributeDetailUnitNone, + "EPOCH_TIME_MS": BulkActivateAttributeDetailUnitEpochTimeMs, + "BYTES": BulkActivateAttributeDetailUnitBytes, + "COUNT": BulkActivateAttributeDetailUnitCount, + "DURATION_MS": BulkActivateAttributeDetailUnitDurationMs, + "TRACE_STATUS": BulkActivateAttributeDetailUnitTraceStatus, + "PERCENTAGE": BulkActivateAttributeDetailUnitPercentage, +} + +var mappingBulkActivateAttributeDetailUnitEnumLowerCase = map[string]BulkActivateAttributeDetailUnitEnum{ + "none": BulkActivateAttributeDetailUnitNone, + "epoch_time_ms": BulkActivateAttributeDetailUnitEpochTimeMs, + "bytes": BulkActivateAttributeDetailUnitBytes, + "count": BulkActivateAttributeDetailUnitCount, + "duration_ms": BulkActivateAttributeDetailUnitDurationMs, + "trace_status": BulkActivateAttributeDetailUnitTraceStatus, + "percentage": BulkActivateAttributeDetailUnitPercentage, +} + +// GetBulkActivateAttributeDetailUnitEnumValues Enumerates the set of values for BulkActivateAttributeDetailUnitEnum +func GetBulkActivateAttributeDetailUnitEnumValues() []BulkActivateAttributeDetailUnitEnum { + values := make([]BulkActivateAttributeDetailUnitEnum, 0) + for _, v := range mappingBulkActivateAttributeDetailUnitEnum { + values = append(values, v) + } + return values +} + +// GetBulkActivateAttributeDetailUnitEnumStringValues Enumerates the set of values in String for BulkActivateAttributeDetailUnitEnum +func GetBulkActivateAttributeDetailUnitEnumStringValues() []string { + return []string{ + "NONE", + "EPOCH_TIME_MS", + "BYTES", + "COUNT", + "DURATION_MS", + "TRACE_STATUS", + "PERCENTAGE", + } +} + +// GetMappingBulkActivateAttributeDetailUnitEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkActivateAttributeDetailUnitEnum(val string) (BulkActivateAttributeDetailUnitEnum, bool) { + enum, ok := mappingBulkActivateAttributeDetailUnitEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkActivateAttributeDetailAttributeNameSpaceEnum Enum with underlying type: string +type BulkActivateAttributeDetailAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for BulkActivateAttributeDetailAttributeNameSpaceEnum +const ( + BulkActivateAttributeDetailAttributeNameSpaceTraces BulkActivateAttributeDetailAttributeNameSpaceEnum = "TRACES" + BulkActivateAttributeDetailAttributeNameSpaceSynthetic BulkActivateAttributeDetailAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingBulkActivateAttributeDetailAttributeNameSpaceEnum = map[string]BulkActivateAttributeDetailAttributeNameSpaceEnum{ + "TRACES": BulkActivateAttributeDetailAttributeNameSpaceTraces, + "SYNTHETIC": BulkActivateAttributeDetailAttributeNameSpaceSynthetic, +} + +var mappingBulkActivateAttributeDetailAttributeNameSpaceEnumLowerCase = map[string]BulkActivateAttributeDetailAttributeNameSpaceEnum{ + "traces": BulkActivateAttributeDetailAttributeNameSpaceTraces, + "synthetic": BulkActivateAttributeDetailAttributeNameSpaceSynthetic, +} + +// GetBulkActivateAttributeDetailAttributeNameSpaceEnumValues Enumerates the set of values for BulkActivateAttributeDetailAttributeNameSpaceEnum +func GetBulkActivateAttributeDetailAttributeNameSpaceEnumValues() []BulkActivateAttributeDetailAttributeNameSpaceEnum { + values := make([]BulkActivateAttributeDetailAttributeNameSpaceEnum, 0) + for _, v := range mappingBulkActivateAttributeDetailAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetBulkActivateAttributeDetailAttributeNameSpaceEnumStringValues Enumerates the set of values in String for BulkActivateAttributeDetailAttributeNameSpaceEnum +func GetBulkActivateAttributeDetailAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingBulkActivateAttributeDetailAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkActivateAttributeDetailAttributeNameSpaceEnum(val string) (BulkActivateAttributeDetailAttributeNameSpaceEnum, bool) { + enum, ok := mappingBulkActivateAttributeDetailAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_activate_attribute_details.go b/apmtraces/bulk_activate_attribute_details.go new file mode 100644 index 0000000000..7932bc8100 --- /dev/null +++ b/apmtraces/bulk_activate_attribute_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkActivateAttributeDetails Bulk request object containing the details of the attributes to be activated. +type BulkActivateAttributeDetails struct { + + // Collection of objects containing the details about individual attribute to be activated. + AttributeDetails []BulkActivateAttributeDetail `mandatory:"false" json:"attributeDetails"` +} + +func (m BulkActivateAttributeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkActivateAttributeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_activate_attribute_request_response.go b/apmtraces/bulk_activate_attribute_request_response.go new file mode 100644 index 0000000000..191ecc1e2a --- /dev/null +++ b/apmtraces/bulk_activate_attribute_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// BulkActivateAttributeRequest wrapper for the BulkActivateAttribute operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkActivateAttribute.go.html to see an example of how to use BulkActivateAttributeRequest. +type BulkActivateAttributeRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Request body containing the details about the set of attributes to be activated. + BulkActivateAttributeDetails `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"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkActivateAttributeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkActivateAttributeRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkActivateAttributeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkActivateAttributeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request BulkActivateAttributeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkActivateAttributeResponse wrapper for the BulkActivateAttribute operation +type BulkActivateAttributeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BulkActivationStatus instance + BulkActivationStatus `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 BulkActivateAttributeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkActivateAttributeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/apmtraces/bulk_activation_metadata.go b/apmtraces/bulk_activation_metadata.go new file mode 100644 index 0000000000..7e2d5ca03f --- /dev/null +++ b/apmtraces/bulk_activation_metadata.go @@ -0,0 +1,189 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkActivationMetadata Metadata about the bulk activation operation. The bulk activation operation is atomic and binary. If the processing of any of the attributes in the bulk +// activation request results in a processing or validation error, then none of the attributes in the request are activated. The bulk activation request succeeds +// only when all the attributes in the bulk activation request are processed and they get a successful attributeStatus back. +type BulkActivationMetadata struct { + + // Operation status of the bulk activation operation. The bulk activation operation could have either a success or an error status as defined below. + // The following is a success status for the bulk activation operation. + // SUCCESS - The bulk activation operation has succeeded and all the attributes in the bulk activation request have been activated by this operation or activated earlier. + // The following are error statuses for the bulk activation operation. Note that none of the attributes (string or numeric) in the bulk request have been activated by this bulk + // activation operation if any of the below statuses. + // EMPTY_ATTRIBUTE_LIST - The bulk activation request object was empty and did not contain any attributes to be activated. + // NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED - The number of numeric attributes in the bulk request exceeded the maximum limit (100) of numeric attributes that could be activated in the APM Domain. + // STRING_ATTRIBUTE_LIMIT_EXCEEDED - The number of string attributes in the bulk request exceeded the maximum limit (700) of string attributes that could be activated in the APM Domain. + // INSUFFICIENT_STRING_SPACE - There are not enough free slots available in the APM Domain to activate the string attributes present in the bulk request. + // INSUFFICIENT_NUMERIC_SPACE - There are not enough free slots available in the APM Domain to activate the numeric attributes present in the bulk request. + // INVALID_BULK_REQUEST - The bulk request contains invalid attribute(s), or attribute(s) that resulted in a validation error, or an attribute that resulted + // in a processing error. + OperationStatus BulkActivationMetadataOperationStatusEnum `mandatory:"true" json:"operationStatus"` + + // Type of operation. + OperationType BulkActivationMetadataOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Total number of string attributes in TRACES namespace that were activated. + StringAttributesActivated *int `mandatory:"false" json:"stringAttributesActivated"` + + // Total number of numeric attributes in TRACES namespace that were activated. + NumericAttributesActivated *int `mandatory:"false" json:"numericAttributesActivated"` + + // Total number of string attributes in SYNTHETIC namespace that were activated. + SyntheticStringAttributesActivated *int `mandatory:"false" json:"syntheticStringAttributesActivated"` + + // Total number of numeric attributes in SYNTHETIC namespace that were activated. + SyntheticNumericAttributesActivated *int `mandatory:"false" json:"syntheticNumericAttributesActivated"` + + // Total number of free slots available to activate string attributes in the TRACES namespace in the APM Domain. Note that if a bulk request has succeeded, this + // number reflects the total number of free slots available for activation of additional string attributes in the TRACES namespace in the APM Domain. + AvailableStringAttributes *int `mandatory:"false" json:"availableStringAttributes"` + + // Total number of free slots available to activate numeric attributes in the TRACES namespace in the APM Domain. Note that if a bulk request has succeeded, this + // number reflects the total number of free slots available for activation of additional numeric attributes in the TRACES namespace in the APM Domain. + AvailableNumericAttributes *int `mandatory:"false" json:"availableNumericAttributes"` + + // Total number of free slots available to activate string attributes in the SYNTHETIC namespace in the APM Domain. Note that if a bulk request has succeeded, this + // number reflects the total number of free synthetic slots available for activation of additional string attributes in the SYNTHETIC namespace in the APM Domain. + AvailableSyntheticStringAttributes *int `mandatory:"false" json:"availableSyntheticStringAttributes"` + + // Total number of free slots available to activate numeric attributes in the SYNTHETIC namespace in the APM Domain. Note that if a bulk request has succeeded, this + // number reflects the total number of free synthetic slots available for activation of additional numeric attributes in the SYNTHETIC namespace in the APM Domain. + AvailableSyntheticNumericAttributes *int `mandatory:"false" json:"availableSyntheticNumericAttributes"` +} + +func (m BulkActivationMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkActivationMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingBulkActivationMetadataOperationStatusEnum(string(m.OperationStatus)); !ok && m.OperationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationStatus: %s. Supported values are: %s.", m.OperationStatus, strings.Join(GetBulkActivationMetadataOperationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkActivationMetadataOperationTypeEnum(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(GetBulkActivationMetadataOperationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkActivationMetadataOperationStatusEnum Enum with underlying type: string +type BulkActivationMetadataOperationStatusEnum string + +// Set of constants representing the allowable values for BulkActivationMetadataOperationStatusEnum +const ( + BulkActivationMetadataOperationStatusSuccess BulkActivationMetadataOperationStatusEnum = "SUCCESS" + BulkActivationMetadataOperationStatusEmptyAttributeList BulkActivationMetadataOperationStatusEnum = "EMPTY_ATTRIBUTE_LIST" + BulkActivationMetadataOperationStatusNumericAttributeLimitExceeded BulkActivationMetadataOperationStatusEnum = "NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED" + BulkActivationMetadataOperationStatusStringAttributeLimitExceeded BulkActivationMetadataOperationStatusEnum = "STRING_ATTRIBUTE_LIMIT_EXCEEDED" + BulkActivationMetadataOperationStatusInsufficientStringSpace BulkActivationMetadataOperationStatusEnum = "INSUFFICIENT_STRING_SPACE" + BulkActivationMetadataOperationStatusInsufficientNumericSpace BulkActivationMetadataOperationStatusEnum = "INSUFFICIENT_NUMERIC_SPACE" + BulkActivationMetadataOperationStatusInvalidBulkRequest BulkActivationMetadataOperationStatusEnum = "INVALID_BULK_REQUEST" +) + +var mappingBulkActivationMetadataOperationStatusEnum = map[string]BulkActivationMetadataOperationStatusEnum{ + "SUCCESS": BulkActivationMetadataOperationStatusSuccess, + "EMPTY_ATTRIBUTE_LIST": BulkActivationMetadataOperationStatusEmptyAttributeList, + "NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED": BulkActivationMetadataOperationStatusNumericAttributeLimitExceeded, + "STRING_ATTRIBUTE_LIMIT_EXCEEDED": BulkActivationMetadataOperationStatusStringAttributeLimitExceeded, + "INSUFFICIENT_STRING_SPACE": BulkActivationMetadataOperationStatusInsufficientStringSpace, + "INSUFFICIENT_NUMERIC_SPACE": BulkActivationMetadataOperationStatusInsufficientNumericSpace, + "INVALID_BULK_REQUEST": BulkActivationMetadataOperationStatusInvalidBulkRequest, +} + +var mappingBulkActivationMetadataOperationStatusEnumLowerCase = map[string]BulkActivationMetadataOperationStatusEnum{ + "success": BulkActivationMetadataOperationStatusSuccess, + "empty_attribute_list": BulkActivationMetadataOperationStatusEmptyAttributeList, + "numeric_attribute_limit_exceeded": BulkActivationMetadataOperationStatusNumericAttributeLimitExceeded, + "string_attribute_limit_exceeded": BulkActivationMetadataOperationStatusStringAttributeLimitExceeded, + "insufficient_string_space": BulkActivationMetadataOperationStatusInsufficientStringSpace, + "insufficient_numeric_space": BulkActivationMetadataOperationStatusInsufficientNumericSpace, + "invalid_bulk_request": BulkActivationMetadataOperationStatusInvalidBulkRequest, +} + +// GetBulkActivationMetadataOperationStatusEnumValues Enumerates the set of values for BulkActivationMetadataOperationStatusEnum +func GetBulkActivationMetadataOperationStatusEnumValues() []BulkActivationMetadataOperationStatusEnum { + values := make([]BulkActivationMetadataOperationStatusEnum, 0) + for _, v := range mappingBulkActivationMetadataOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetBulkActivationMetadataOperationStatusEnumStringValues Enumerates the set of values in String for BulkActivationMetadataOperationStatusEnum +func GetBulkActivationMetadataOperationStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + "EMPTY_ATTRIBUTE_LIST", + "NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED", + "STRING_ATTRIBUTE_LIMIT_EXCEEDED", + "INSUFFICIENT_STRING_SPACE", + "INSUFFICIENT_NUMERIC_SPACE", + "INVALID_BULK_REQUEST", + } +} + +// GetMappingBulkActivationMetadataOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkActivationMetadataOperationStatusEnum(val string) (BulkActivationMetadataOperationStatusEnum, bool) { + enum, ok := mappingBulkActivationMetadataOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkActivationMetadataOperationTypeEnum Enum with underlying type: string +type BulkActivationMetadataOperationTypeEnum string + +// Set of constants representing the allowable values for BulkActivationMetadataOperationTypeEnum +const ( + BulkActivationMetadataOperationTypeActivate BulkActivationMetadataOperationTypeEnum = "ACTIVATE" +) + +var mappingBulkActivationMetadataOperationTypeEnum = map[string]BulkActivationMetadataOperationTypeEnum{ + "ACTIVATE": BulkActivationMetadataOperationTypeActivate, +} + +var mappingBulkActivationMetadataOperationTypeEnumLowerCase = map[string]BulkActivationMetadataOperationTypeEnum{ + "activate": BulkActivationMetadataOperationTypeActivate, +} + +// GetBulkActivationMetadataOperationTypeEnumValues Enumerates the set of values for BulkActivationMetadataOperationTypeEnum +func GetBulkActivationMetadataOperationTypeEnumValues() []BulkActivationMetadataOperationTypeEnum { + values := make([]BulkActivationMetadataOperationTypeEnum, 0) + for _, v := range mappingBulkActivationMetadataOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetBulkActivationMetadataOperationTypeEnumStringValues Enumerates the set of values in String for BulkActivationMetadataOperationTypeEnum +func GetBulkActivationMetadataOperationTypeEnumStringValues() []string { + return []string{ + "ACTIVATE", + } +} + +// GetMappingBulkActivationMetadataOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkActivationMetadataOperationTypeEnum(val string) (BulkActivationMetadataOperationTypeEnum, bool) { + enum, ok := mappingBulkActivationMetadataOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_activation_status.go b/apmtraces/bulk_activation_status.go new file mode 100644 index 0000000000..bfefba0d4a --- /dev/null +++ b/apmtraces/bulk_activation_status.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkActivationStatus Response of a bulk attribute activation operation. +type BulkActivationStatus struct { + + // We preserve the order of the attribute items from the bulk activation request in this collection. The ith object in this collection represents the + // bulk activation operation status of the ith object in the BulkActivateAttributeDetails object from the Bulk Activation request. If the + // bulk activation operation results in a processing error or a validation error, the operationStatus property in the BulkActivationMetadata object will + // contain the appropriate bulk error status for the bulk operation. + AttributeStatuses []AttributeResponse `mandatory:"true" json:"attributeStatuses"` + + BulkActivationMetadata *BulkActivationMetadata `mandatory:"true" json:"bulkActivationMetadata"` +} + +func (m BulkActivationStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkActivationStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_de_activate_attribute_detail.go b/apmtraces/bulk_de_activate_attribute_detail.go new file mode 100644 index 0000000000..1be44329f2 --- /dev/null +++ b/apmtraces/bulk_de_activate_attribute_detail.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkDeActivateAttributeDetail Object that contains the details about a single attribute to be deactivated. +type BulkDeActivateAttributeDetail struct { + + // Name of the attribute to be deactivated. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Namespace of the attribute to be deactivated. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace BulkDeActivateAttributeDetailAttributeNameSpaceEnum `mandatory:"false" json:"attributeNameSpace,omitempty"` +} + +func (m BulkDeActivateAttributeDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkDeActivateAttributeDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingBulkDeActivateAttributeDetailAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetBulkDeActivateAttributeDetailAttributeNameSpaceEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkDeActivateAttributeDetailAttributeNameSpaceEnum Enum with underlying type: string +type BulkDeActivateAttributeDetailAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for BulkDeActivateAttributeDetailAttributeNameSpaceEnum +const ( + BulkDeActivateAttributeDetailAttributeNameSpaceTraces BulkDeActivateAttributeDetailAttributeNameSpaceEnum = "TRACES" + BulkDeActivateAttributeDetailAttributeNameSpaceSynthetic BulkDeActivateAttributeDetailAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingBulkDeActivateAttributeDetailAttributeNameSpaceEnum = map[string]BulkDeActivateAttributeDetailAttributeNameSpaceEnum{ + "TRACES": BulkDeActivateAttributeDetailAttributeNameSpaceTraces, + "SYNTHETIC": BulkDeActivateAttributeDetailAttributeNameSpaceSynthetic, +} + +var mappingBulkDeActivateAttributeDetailAttributeNameSpaceEnumLowerCase = map[string]BulkDeActivateAttributeDetailAttributeNameSpaceEnum{ + "traces": BulkDeActivateAttributeDetailAttributeNameSpaceTraces, + "synthetic": BulkDeActivateAttributeDetailAttributeNameSpaceSynthetic, +} + +// GetBulkDeActivateAttributeDetailAttributeNameSpaceEnumValues Enumerates the set of values for BulkDeActivateAttributeDetailAttributeNameSpaceEnum +func GetBulkDeActivateAttributeDetailAttributeNameSpaceEnumValues() []BulkDeActivateAttributeDetailAttributeNameSpaceEnum { + values := make([]BulkDeActivateAttributeDetailAttributeNameSpaceEnum, 0) + for _, v := range mappingBulkDeActivateAttributeDetailAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetBulkDeActivateAttributeDetailAttributeNameSpaceEnumStringValues Enumerates the set of values in String for BulkDeActivateAttributeDetailAttributeNameSpaceEnum +func GetBulkDeActivateAttributeDetailAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingBulkDeActivateAttributeDetailAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkDeActivateAttributeDetailAttributeNameSpaceEnum(val string) (BulkDeActivateAttributeDetailAttributeNameSpaceEnum, bool) { + enum, ok := mappingBulkDeActivateAttributeDetailAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_de_activate_attribute_details.go b/apmtraces/bulk_de_activate_attribute_details.go new file mode 100644 index 0000000000..41c809ea63 --- /dev/null +++ b/apmtraces/bulk_de_activate_attribute_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkDeActivateAttributeDetails Bulk request object containing the details of the attributes to be deactivated. +type BulkDeActivateAttributeDetails struct { + + // Collection of objects containing the details about individual attribute to be deactivated. + AttributeDetails []BulkDeActivateAttributeDetail `mandatory:"false" json:"attributeDetails"` +} + +func (m BulkDeActivateAttributeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkDeActivateAttributeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_de_activate_attribute_request_response.go b/apmtraces/bulk_de_activate_attribute_request_response.go new file mode 100644 index 0000000000..f6eed67bc8 --- /dev/null +++ b/apmtraces/bulk_de_activate_attribute_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// BulkDeActivateAttributeRequest wrapper for the BulkDeActivateAttribute operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkDeActivateAttribute.go.html to see an example of how to use BulkDeActivateAttributeRequest. +type BulkDeActivateAttributeRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Request body containing the details about the set of attributes to be deactivated. + BulkDeActivateAttributeDetails `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"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkDeActivateAttributeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkDeActivateAttributeRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkDeActivateAttributeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkDeActivateAttributeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request BulkDeActivateAttributeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkDeActivateAttributeResponse wrapper for the BulkDeActivateAttribute operation +type BulkDeActivateAttributeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BulkDeActivationStatus instance + BulkDeActivationStatus `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 BulkDeActivateAttributeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkDeActivateAttributeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/apmtraces/bulk_de_activation_metadata.go b/apmtraces/bulk_de_activation_metadata.go new file mode 100644 index 0000000000..fdf10f44cb --- /dev/null +++ b/apmtraces/bulk_de_activation_metadata.go @@ -0,0 +1,170 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkDeActivationMetadata Metadata about the bulk deactivation operation. The bulk deactivation operation is atomic and binary. If the processing of any of the attributes +// in the bulk deactivation request results in a processing or validation error, then none of the attributes in the request are deactivated. +// The bulk deactivation request succeeds only when all the attributes in the bulk deactivation request are processed and they get a successful +// attributeStatus back. +type BulkDeActivationMetadata struct { + + // Operation status of the bulk deactivation operation. The bulk deactivation operation could have either a success or an error status as defined below. Note that + // if a bulk operation has not succeeded, we do not deactivate any tags in the request set. + // SUCCESS - The bulk deactivation operation has succeeded and all the attributes in the bulk deactivation request have been deactivated by this operation or deactivated earlier. + // The following are error statuses for the bulk deactivation operation. Note that none of the attributes (string or numeric) in the bulk request have been deactivated by this bulk + // deactivation operation if any of the below statuses are returned. + // EMPTY_ATTRIBUTE_LIST - The bulk deactivation request object was empty and did not contain any attributes to be deactivated. + // NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED - The number of numeric attributes in the bulk request exceeded the maximum limit (100) of numeric attributes that could be present in the APM Domain. + // STRING_ATTRIBUTE_LIMIT_EXCEEDED - The number of string attributes in the bulk request exceeded the maximum limit (700) of string attributes that could be present in the APM Domain. + // INVALID_BULK_REQUEST - The bulk request contains invalid attribute(s), or attribute(s) that resulted in a validation error, or an attribute that resulted + // in a processing error. + OperationStatus BulkDeActivationMetadataOperationStatusEnum `mandatory:"true" json:"operationStatus"` + + // Type of operation. + OperationType BulkDeActivationMetadataOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Total number attributes (both string and numeric) in TRACES namespace that were deactivated. + AttributesDeActivated *int `mandatory:"false" json:"attributesDeActivated"` + + // Total number attributes (both string and numeric) in SYNTHETIC namespace that were deactivated. + SyntheticAttributesDeActivated *int `mandatory:"false" json:"syntheticAttributesDeActivated"` + + // Total number of free slots available for activation of additional string attributes in TRACES namespace in the APM Domain. + AvailableStringAttributes *int `mandatory:"false" json:"availableStringAttributes"` + + // Total number of free slots available for activation of additional numeric attributes in TRACES namespace in the APM Domain. + AvailableNumericAttributes *int `mandatory:"false" json:"availableNumericAttributes"` + + // Total number of free slots available for activation of additional string attributes in SYNTHETIC namespace in the APM Domain. + AvailableSyntheticStringAttributes *int `mandatory:"false" json:"availableSyntheticStringAttributes"` + + // Total number of free slots available for activation of additional numeric attributes in SYNTHETIC namespace in the APM Domain. + AvailableSyntheticNumericAttributes *int `mandatory:"false" json:"availableSyntheticNumericAttributes"` +} + +func (m BulkDeActivationMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkDeActivationMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingBulkDeActivationMetadataOperationStatusEnum(string(m.OperationStatus)); !ok && m.OperationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationStatus: %s. Supported values are: %s.", m.OperationStatus, strings.Join(GetBulkDeActivationMetadataOperationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkDeActivationMetadataOperationTypeEnum(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(GetBulkDeActivationMetadataOperationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkDeActivationMetadataOperationStatusEnum Enum with underlying type: string +type BulkDeActivationMetadataOperationStatusEnum string + +// Set of constants representing the allowable values for BulkDeActivationMetadataOperationStatusEnum +const ( + BulkDeActivationMetadataOperationStatusSuccess BulkDeActivationMetadataOperationStatusEnum = "SUCCESS" + BulkDeActivationMetadataOperationStatusEmptyAttributeList BulkDeActivationMetadataOperationStatusEnum = "EMPTY_ATTRIBUTE_LIST" + BulkDeActivationMetadataOperationStatusNumericAttributeLimitExceeded BulkDeActivationMetadataOperationStatusEnum = "NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED" + BulkDeActivationMetadataOperationStatusStringAttributeLimitExceeded BulkDeActivationMetadataOperationStatusEnum = "STRING_ATTRIBUTE_LIMIT_EXCEEDED" + BulkDeActivationMetadataOperationStatusInvalidBulkRequest BulkDeActivationMetadataOperationStatusEnum = "INVALID_BULK_REQUEST" +) + +var mappingBulkDeActivationMetadataOperationStatusEnum = map[string]BulkDeActivationMetadataOperationStatusEnum{ + "SUCCESS": BulkDeActivationMetadataOperationStatusSuccess, + "EMPTY_ATTRIBUTE_LIST": BulkDeActivationMetadataOperationStatusEmptyAttributeList, + "NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED": BulkDeActivationMetadataOperationStatusNumericAttributeLimitExceeded, + "STRING_ATTRIBUTE_LIMIT_EXCEEDED": BulkDeActivationMetadataOperationStatusStringAttributeLimitExceeded, + "INVALID_BULK_REQUEST": BulkDeActivationMetadataOperationStatusInvalidBulkRequest, +} + +var mappingBulkDeActivationMetadataOperationStatusEnumLowerCase = map[string]BulkDeActivationMetadataOperationStatusEnum{ + "success": BulkDeActivationMetadataOperationStatusSuccess, + "empty_attribute_list": BulkDeActivationMetadataOperationStatusEmptyAttributeList, + "numeric_attribute_limit_exceeded": BulkDeActivationMetadataOperationStatusNumericAttributeLimitExceeded, + "string_attribute_limit_exceeded": BulkDeActivationMetadataOperationStatusStringAttributeLimitExceeded, + "invalid_bulk_request": BulkDeActivationMetadataOperationStatusInvalidBulkRequest, +} + +// GetBulkDeActivationMetadataOperationStatusEnumValues Enumerates the set of values for BulkDeActivationMetadataOperationStatusEnum +func GetBulkDeActivationMetadataOperationStatusEnumValues() []BulkDeActivationMetadataOperationStatusEnum { + values := make([]BulkDeActivationMetadataOperationStatusEnum, 0) + for _, v := range mappingBulkDeActivationMetadataOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetBulkDeActivationMetadataOperationStatusEnumStringValues Enumerates the set of values in String for BulkDeActivationMetadataOperationStatusEnum +func GetBulkDeActivationMetadataOperationStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + "EMPTY_ATTRIBUTE_LIST", + "NUMERIC_ATTRIBUTE_LIMIT_EXCEEDED", + "STRING_ATTRIBUTE_LIMIT_EXCEEDED", + "INVALID_BULK_REQUEST", + } +} + +// GetMappingBulkDeActivationMetadataOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkDeActivationMetadataOperationStatusEnum(val string) (BulkDeActivationMetadataOperationStatusEnum, bool) { + enum, ok := mappingBulkDeActivationMetadataOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkDeActivationMetadataOperationTypeEnum Enum with underlying type: string +type BulkDeActivationMetadataOperationTypeEnum string + +// Set of constants representing the allowable values for BulkDeActivationMetadataOperationTypeEnum +const ( + BulkDeActivationMetadataOperationTypeDeactivate BulkDeActivationMetadataOperationTypeEnum = "DEACTIVATE" +) + +var mappingBulkDeActivationMetadataOperationTypeEnum = map[string]BulkDeActivationMetadataOperationTypeEnum{ + "DEACTIVATE": BulkDeActivationMetadataOperationTypeDeactivate, +} + +var mappingBulkDeActivationMetadataOperationTypeEnumLowerCase = map[string]BulkDeActivationMetadataOperationTypeEnum{ + "deactivate": BulkDeActivationMetadataOperationTypeDeactivate, +} + +// GetBulkDeActivationMetadataOperationTypeEnumValues Enumerates the set of values for BulkDeActivationMetadataOperationTypeEnum +func GetBulkDeActivationMetadataOperationTypeEnumValues() []BulkDeActivationMetadataOperationTypeEnum { + values := make([]BulkDeActivationMetadataOperationTypeEnum, 0) + for _, v := range mappingBulkDeActivationMetadataOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetBulkDeActivationMetadataOperationTypeEnumStringValues Enumerates the set of values in String for BulkDeActivationMetadataOperationTypeEnum +func GetBulkDeActivationMetadataOperationTypeEnumStringValues() []string { + return []string{ + "DEACTIVATE", + } +} + +// GetMappingBulkDeActivationMetadataOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkDeActivationMetadataOperationTypeEnum(val string) (BulkDeActivationMetadataOperationTypeEnum, bool) { + enum, ok := mappingBulkDeActivationMetadataOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_de_activation_status.go b/apmtraces/bulk_de_activation_status.go new file mode 100644 index 0000000000..baa75e8a85 --- /dev/null +++ b/apmtraces/bulk_de_activation_status.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkDeActivationStatus Response of a bulk attribute deactivation operation. +type BulkDeActivationStatus struct { + + // We preserve the order of the attribute items from the bulk activation request in this collection. The ith object in this collection represents the + // bulk activation operation status of the ith object in the BulkActivateAttributeDetails object from the Bulk Activation request. If the + // bulk activation operation results in a processing error or a validation error, the operationStatus property in the BulkActivationMetadata object will + // contain the appropriate bulk error status for the bulk operation. + AttributeStatuses []AttributeResponse `mandatory:"true" json:"attributeStatuses"` + + BulkDeActivationMetadata *BulkDeActivationMetadata `mandatory:"true" json:"bulkDeActivationMetadata"` +} + +func (m BulkDeActivationStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkDeActivationStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_pin_attribute_detail.go b/apmtraces/bulk_pin_attribute_detail.go new file mode 100644 index 0000000000..47304ccba1 --- /dev/null +++ b/apmtraces/bulk_pin_attribute_detail.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkPinAttributeDetail Object that contains the details about a single attribute in the bulk request to be pinned. +type BulkPinAttributeDetail struct { + + // Name of the attribute to be pinned. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Namespace of the attribute to be pinned. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace BulkPinAttributeDetailAttributeNameSpaceEnum `mandatory:"false" json:"attributeNameSpace,omitempty"` +} + +func (m BulkPinAttributeDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkPinAttributeDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingBulkPinAttributeDetailAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetBulkPinAttributeDetailAttributeNameSpaceEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkPinAttributeDetailAttributeNameSpaceEnum Enum with underlying type: string +type BulkPinAttributeDetailAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for BulkPinAttributeDetailAttributeNameSpaceEnum +const ( + BulkPinAttributeDetailAttributeNameSpaceTraces BulkPinAttributeDetailAttributeNameSpaceEnum = "TRACES" + BulkPinAttributeDetailAttributeNameSpaceSynthetic BulkPinAttributeDetailAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingBulkPinAttributeDetailAttributeNameSpaceEnum = map[string]BulkPinAttributeDetailAttributeNameSpaceEnum{ + "TRACES": BulkPinAttributeDetailAttributeNameSpaceTraces, + "SYNTHETIC": BulkPinAttributeDetailAttributeNameSpaceSynthetic, +} + +var mappingBulkPinAttributeDetailAttributeNameSpaceEnumLowerCase = map[string]BulkPinAttributeDetailAttributeNameSpaceEnum{ + "traces": BulkPinAttributeDetailAttributeNameSpaceTraces, + "synthetic": BulkPinAttributeDetailAttributeNameSpaceSynthetic, +} + +// GetBulkPinAttributeDetailAttributeNameSpaceEnumValues Enumerates the set of values for BulkPinAttributeDetailAttributeNameSpaceEnum +func GetBulkPinAttributeDetailAttributeNameSpaceEnumValues() []BulkPinAttributeDetailAttributeNameSpaceEnum { + values := make([]BulkPinAttributeDetailAttributeNameSpaceEnum, 0) + for _, v := range mappingBulkPinAttributeDetailAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetBulkPinAttributeDetailAttributeNameSpaceEnumStringValues Enumerates the set of values in String for BulkPinAttributeDetailAttributeNameSpaceEnum +func GetBulkPinAttributeDetailAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingBulkPinAttributeDetailAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkPinAttributeDetailAttributeNameSpaceEnum(val string) (BulkPinAttributeDetailAttributeNameSpaceEnum, bool) { + enum, ok := mappingBulkPinAttributeDetailAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_pin_attribute_details.go b/apmtraces/bulk_pin_attribute_details.go new file mode 100644 index 0000000000..a08003fff7 --- /dev/null +++ b/apmtraces/bulk_pin_attribute_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkPinAttributeDetails Bulk request object containing the details of the attributes to be pinned. +type BulkPinAttributeDetails struct { + + // Collection of objects containing the details about individual attribute to be pinned. + AttributeDetails []BulkPinAttributeDetail `mandatory:"false" json:"attributeDetails"` +} + +func (m BulkPinAttributeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkPinAttributeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_pin_attribute_request_response.go b/apmtraces/bulk_pin_attribute_request_response.go new file mode 100644 index 0000000000..e0d6e9feef --- /dev/null +++ b/apmtraces/bulk_pin_attribute_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// BulkPinAttributeRequest wrapper for the BulkPinAttribute operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkPinAttribute.go.html to see an example of how to use BulkPinAttributeRequest. +type BulkPinAttributeRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Request body containing the details about the set of attributes to be pinned. + BulkPinAttributeDetails `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"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkPinAttributeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkPinAttributeRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkPinAttributeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkPinAttributeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request BulkPinAttributeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkPinAttributeResponse wrapper for the BulkPinAttribute operation +type BulkPinAttributeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BulkPinStatus instance + BulkPinStatus `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 BulkPinAttributeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkPinAttributeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/apmtraces/bulk_pin_metadata.go b/apmtraces/bulk_pin_metadata.go new file mode 100644 index 0000000000..4d478edece --- /dev/null +++ b/apmtraces/bulk_pin_metadata.go @@ -0,0 +1,144 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkPinMetadata Metadata about the bulk pin operation. The bulk pin operation is atomic and binary. If the processing of any of the attributes +// in the bulk pin request results in a processing or validation error, then none of the attributes in the request are pinned. +type BulkPinMetadata struct { + + // Operation status of the bulk pin operation. + // SUCCESS - The bulk pin operation has succeeded and all the attributes in the bulk pin request have been pinned by this operation or pinned earlier. + // The following are error statuses for the bulk pin operation. + // EMPTY_ATTRIBUTE_LIST - The bulk pin request object was empty and did not contain any attributes to be pinned. + // INVALID_BULK_REQUEST - The bulk request contains invalid attribute(s), or attribute(s) that resulted in a validation error, or an attribute that resulted + // in a processing error. + OperationStatus BulkPinMetadataOperationStatusEnum `mandatory:"true" json:"operationStatus"` + + // Type of operation. + OperationType BulkPinMetadataOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Total number attributes (both string and numeric) in TRACES namespace that were pinned. + AttributesPinned *int `mandatory:"true" json:"attributesPinned"` + + // Total number attributes (both string and numeric) in SYNTHETIC namespace that were pinned. + SyntheticAttributesPinned *int `mandatory:"false" json:"syntheticAttributesPinned"` +} + +func (m BulkPinMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkPinMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingBulkPinMetadataOperationStatusEnum(string(m.OperationStatus)); !ok && m.OperationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationStatus: %s. Supported values are: %s.", m.OperationStatus, strings.Join(GetBulkPinMetadataOperationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkPinMetadataOperationTypeEnum(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(GetBulkPinMetadataOperationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkPinMetadataOperationStatusEnum Enum with underlying type: string +type BulkPinMetadataOperationStatusEnum string + +// Set of constants representing the allowable values for BulkPinMetadataOperationStatusEnum +const ( + BulkPinMetadataOperationStatusSuccess BulkPinMetadataOperationStatusEnum = "SUCCESS" + BulkPinMetadataOperationStatusEmptyAttributeList BulkPinMetadataOperationStatusEnum = "EMPTY_ATTRIBUTE_LIST" + BulkPinMetadataOperationStatusInvalidBulkRequest BulkPinMetadataOperationStatusEnum = "INVALID_BULK_REQUEST" +) + +var mappingBulkPinMetadataOperationStatusEnum = map[string]BulkPinMetadataOperationStatusEnum{ + "SUCCESS": BulkPinMetadataOperationStatusSuccess, + "EMPTY_ATTRIBUTE_LIST": BulkPinMetadataOperationStatusEmptyAttributeList, + "INVALID_BULK_REQUEST": BulkPinMetadataOperationStatusInvalidBulkRequest, +} + +var mappingBulkPinMetadataOperationStatusEnumLowerCase = map[string]BulkPinMetadataOperationStatusEnum{ + "success": BulkPinMetadataOperationStatusSuccess, + "empty_attribute_list": BulkPinMetadataOperationStatusEmptyAttributeList, + "invalid_bulk_request": BulkPinMetadataOperationStatusInvalidBulkRequest, +} + +// GetBulkPinMetadataOperationStatusEnumValues Enumerates the set of values for BulkPinMetadataOperationStatusEnum +func GetBulkPinMetadataOperationStatusEnumValues() []BulkPinMetadataOperationStatusEnum { + values := make([]BulkPinMetadataOperationStatusEnum, 0) + for _, v := range mappingBulkPinMetadataOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetBulkPinMetadataOperationStatusEnumStringValues Enumerates the set of values in String for BulkPinMetadataOperationStatusEnum +func GetBulkPinMetadataOperationStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + "EMPTY_ATTRIBUTE_LIST", + "INVALID_BULK_REQUEST", + } +} + +// GetMappingBulkPinMetadataOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkPinMetadataOperationStatusEnum(val string) (BulkPinMetadataOperationStatusEnum, bool) { + enum, ok := mappingBulkPinMetadataOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkPinMetadataOperationTypeEnum Enum with underlying type: string +type BulkPinMetadataOperationTypeEnum string + +// Set of constants representing the allowable values for BulkPinMetadataOperationTypeEnum +const ( + BulkPinMetadataOperationTypePin BulkPinMetadataOperationTypeEnum = "PIN" +) + +var mappingBulkPinMetadataOperationTypeEnum = map[string]BulkPinMetadataOperationTypeEnum{ + "PIN": BulkPinMetadataOperationTypePin, +} + +var mappingBulkPinMetadataOperationTypeEnumLowerCase = map[string]BulkPinMetadataOperationTypeEnum{ + "pin": BulkPinMetadataOperationTypePin, +} + +// GetBulkPinMetadataOperationTypeEnumValues Enumerates the set of values for BulkPinMetadataOperationTypeEnum +func GetBulkPinMetadataOperationTypeEnumValues() []BulkPinMetadataOperationTypeEnum { + values := make([]BulkPinMetadataOperationTypeEnum, 0) + for _, v := range mappingBulkPinMetadataOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetBulkPinMetadataOperationTypeEnumStringValues Enumerates the set of values in String for BulkPinMetadataOperationTypeEnum +func GetBulkPinMetadataOperationTypeEnumStringValues() []string { + return []string{ + "PIN", + } +} + +// GetMappingBulkPinMetadataOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkPinMetadataOperationTypeEnum(val string) (BulkPinMetadataOperationTypeEnum, bool) { + enum, ok := mappingBulkPinMetadataOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_pin_status.go b/apmtraces/bulk_pin_status.go new file mode 100644 index 0000000000..a05195cec8 --- /dev/null +++ b/apmtraces/bulk_pin_status.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkPinStatus Response of a bulk attribute pin operation. +type BulkPinStatus struct { + + // We preserve the order of the attribute items from the bulk pin request in this collection. The ith object in this collection represents the + // bulk pin operation status of the ith object in the BulkPinAttributeDetails object in the Bulk pin request. If the + // bulk pin operation results in a processing error or a validation error, the operationStatus property in the BulkPinMetadata object will + // contain the appropriate bulk error status for the bulk operation. + AttributeStatuses []AttributePinResponse `mandatory:"true" json:"attributeStatuses"` + + BulkPinMetadata *BulkPinMetadata `mandatory:"true" json:"bulkPinMetadata"` +} + +func (m BulkPinStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkPinStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_unpin_attribute_detail.go b/apmtraces/bulk_unpin_attribute_detail.go new file mode 100644 index 0000000000..7826bc77eb --- /dev/null +++ b/apmtraces/bulk_unpin_attribute_detail.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUnpinAttributeDetail Object that contains the details about a single attribute in the bulk request to be unpinned. +type BulkUnpinAttributeDetail struct { + + // Name of the attribute to be unpinned. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Namespace of the attribute to be unpinned. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace BulkUnpinAttributeDetailAttributeNameSpaceEnum `mandatory:"false" json:"attributeNameSpace,omitempty"` +} + +func (m BulkUnpinAttributeDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUnpinAttributeDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingBulkUnpinAttributeDetailAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetBulkUnpinAttributeDetailAttributeNameSpaceEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUnpinAttributeDetailAttributeNameSpaceEnum Enum with underlying type: string +type BulkUnpinAttributeDetailAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for BulkUnpinAttributeDetailAttributeNameSpaceEnum +const ( + BulkUnpinAttributeDetailAttributeNameSpaceTraces BulkUnpinAttributeDetailAttributeNameSpaceEnum = "TRACES" + BulkUnpinAttributeDetailAttributeNameSpaceSynthetic BulkUnpinAttributeDetailAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingBulkUnpinAttributeDetailAttributeNameSpaceEnum = map[string]BulkUnpinAttributeDetailAttributeNameSpaceEnum{ + "TRACES": BulkUnpinAttributeDetailAttributeNameSpaceTraces, + "SYNTHETIC": BulkUnpinAttributeDetailAttributeNameSpaceSynthetic, +} + +var mappingBulkUnpinAttributeDetailAttributeNameSpaceEnumLowerCase = map[string]BulkUnpinAttributeDetailAttributeNameSpaceEnum{ + "traces": BulkUnpinAttributeDetailAttributeNameSpaceTraces, + "synthetic": BulkUnpinAttributeDetailAttributeNameSpaceSynthetic, +} + +// GetBulkUnpinAttributeDetailAttributeNameSpaceEnumValues Enumerates the set of values for BulkUnpinAttributeDetailAttributeNameSpaceEnum +func GetBulkUnpinAttributeDetailAttributeNameSpaceEnumValues() []BulkUnpinAttributeDetailAttributeNameSpaceEnum { + values := make([]BulkUnpinAttributeDetailAttributeNameSpaceEnum, 0) + for _, v := range mappingBulkUnpinAttributeDetailAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetBulkUnpinAttributeDetailAttributeNameSpaceEnumStringValues Enumerates the set of values in String for BulkUnpinAttributeDetailAttributeNameSpaceEnum +func GetBulkUnpinAttributeDetailAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingBulkUnpinAttributeDetailAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUnpinAttributeDetailAttributeNameSpaceEnum(val string) (BulkUnpinAttributeDetailAttributeNameSpaceEnum, bool) { + enum, ok := mappingBulkUnpinAttributeDetailAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_unpin_attribute_details.go b/apmtraces/bulk_unpin_attribute_details.go new file mode 100644 index 0000000000..aaf4ece822 --- /dev/null +++ b/apmtraces/bulk_unpin_attribute_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUnpinAttributeDetails Bulk request object containing the details of the attributes to be unpinned. +type BulkUnpinAttributeDetails struct { + + // Collection of objects containing the details about individual attribute to be unpinned. + AttributeDetails []BulkUnpinAttributeDetail `mandatory:"false" json:"attributeDetails"` +} + +func (m BulkUnpinAttributeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUnpinAttributeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_unpin_attribute_request_response.go b/apmtraces/bulk_unpin_attribute_request_response.go new file mode 100644 index 0000000000..bdc2ea171a --- /dev/null +++ b/apmtraces/bulk_unpin_attribute_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// BulkUnpinAttributeRequest wrapper for the BulkUnpinAttribute operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkUnpinAttribute.go.html to see an example of how to use BulkUnpinAttributeRequest. +type BulkUnpinAttributeRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Request body containing the details about the set of attributes to be unpinned. + BulkUnpinAttributeDetails `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"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUnpinAttributeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUnpinAttributeRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUnpinAttributeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUnpinAttributeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request BulkUnpinAttributeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUnpinAttributeResponse wrapper for the BulkUnpinAttribute operation +type BulkUnpinAttributeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BulkUnpinStatus instance + BulkUnpinStatus `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 BulkUnpinAttributeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUnpinAttributeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/apmtraces/bulk_unpin_metadata.go b/apmtraces/bulk_unpin_metadata.go new file mode 100644 index 0000000000..fc93eb2fb1 --- /dev/null +++ b/apmtraces/bulk_unpin_metadata.go @@ -0,0 +1,144 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUnpinMetadata Metadata about the bulk unpin operation. The bulk unpin operation is atomic and binary. If the processing of any of the attributes +// in the bulk unpin request results in a processing or validation error, then none of the attributes in the request are unpinned. +type BulkUnpinMetadata struct { + + // Operation status of the bulk unpin operation. + // SUCCESS - The bulk unpin operation has succeeded and all the attributes in the bulk unpin request have been unpinned by this operation. + // The following are error statuses for the bulk unpin operation. + // EMPTY_ATTRIBUTE_LIST - The bulk unpin request object was empty and did not contain any attributes to be unpinned. + // INVALID_BULK_REQUEST - The bulk request contains invalid attribute(s), or attribute(s) that resulted in a validation error, or an attribute that resulted + // in a processing error. + OperationStatus BulkUnpinMetadataOperationStatusEnum `mandatory:"true" json:"operationStatus"` + + // Type of operation. + OperationType BulkUnpinMetadataOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Total number attributes (both string and numeric) in TRACES namespace that were unpinned. + AttributesUnpinned *int `mandatory:"true" json:"attributesUnpinned"` + + // Total number attributes (both string and numeric) in SYNTHETIC namespace that were unpinned. + SyntheticAttributesUnpinned *int `mandatory:"false" json:"syntheticAttributesUnpinned"` +} + +func (m BulkUnpinMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUnpinMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingBulkUnpinMetadataOperationStatusEnum(string(m.OperationStatus)); !ok && m.OperationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationStatus: %s. Supported values are: %s.", m.OperationStatus, strings.Join(GetBulkUnpinMetadataOperationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkUnpinMetadataOperationTypeEnum(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(GetBulkUnpinMetadataOperationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUnpinMetadataOperationStatusEnum Enum with underlying type: string +type BulkUnpinMetadataOperationStatusEnum string + +// Set of constants representing the allowable values for BulkUnpinMetadataOperationStatusEnum +const ( + BulkUnpinMetadataOperationStatusSuccess BulkUnpinMetadataOperationStatusEnum = "SUCCESS" + BulkUnpinMetadataOperationStatusEmptyAttributeList BulkUnpinMetadataOperationStatusEnum = "EMPTY_ATTRIBUTE_LIST" + BulkUnpinMetadataOperationStatusInvalidBulkRequest BulkUnpinMetadataOperationStatusEnum = "INVALID_BULK_REQUEST" +) + +var mappingBulkUnpinMetadataOperationStatusEnum = map[string]BulkUnpinMetadataOperationStatusEnum{ + "SUCCESS": BulkUnpinMetadataOperationStatusSuccess, + "EMPTY_ATTRIBUTE_LIST": BulkUnpinMetadataOperationStatusEmptyAttributeList, + "INVALID_BULK_REQUEST": BulkUnpinMetadataOperationStatusInvalidBulkRequest, +} + +var mappingBulkUnpinMetadataOperationStatusEnumLowerCase = map[string]BulkUnpinMetadataOperationStatusEnum{ + "success": BulkUnpinMetadataOperationStatusSuccess, + "empty_attribute_list": BulkUnpinMetadataOperationStatusEmptyAttributeList, + "invalid_bulk_request": BulkUnpinMetadataOperationStatusInvalidBulkRequest, +} + +// GetBulkUnpinMetadataOperationStatusEnumValues Enumerates the set of values for BulkUnpinMetadataOperationStatusEnum +func GetBulkUnpinMetadataOperationStatusEnumValues() []BulkUnpinMetadataOperationStatusEnum { + values := make([]BulkUnpinMetadataOperationStatusEnum, 0) + for _, v := range mappingBulkUnpinMetadataOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetBulkUnpinMetadataOperationStatusEnumStringValues Enumerates the set of values in String for BulkUnpinMetadataOperationStatusEnum +func GetBulkUnpinMetadataOperationStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + "EMPTY_ATTRIBUTE_LIST", + "INVALID_BULK_REQUEST", + } +} + +// GetMappingBulkUnpinMetadataOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUnpinMetadataOperationStatusEnum(val string) (BulkUnpinMetadataOperationStatusEnum, bool) { + enum, ok := mappingBulkUnpinMetadataOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkUnpinMetadataOperationTypeEnum Enum with underlying type: string +type BulkUnpinMetadataOperationTypeEnum string + +// Set of constants representing the allowable values for BulkUnpinMetadataOperationTypeEnum +const ( + BulkUnpinMetadataOperationTypeUnpin BulkUnpinMetadataOperationTypeEnum = "UNPIN" +) + +var mappingBulkUnpinMetadataOperationTypeEnum = map[string]BulkUnpinMetadataOperationTypeEnum{ + "UNPIN": BulkUnpinMetadataOperationTypeUnpin, +} + +var mappingBulkUnpinMetadataOperationTypeEnumLowerCase = map[string]BulkUnpinMetadataOperationTypeEnum{ + "unpin": BulkUnpinMetadataOperationTypeUnpin, +} + +// GetBulkUnpinMetadataOperationTypeEnumValues Enumerates the set of values for BulkUnpinMetadataOperationTypeEnum +func GetBulkUnpinMetadataOperationTypeEnumValues() []BulkUnpinMetadataOperationTypeEnum { + values := make([]BulkUnpinMetadataOperationTypeEnum, 0) + for _, v := range mappingBulkUnpinMetadataOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetBulkUnpinMetadataOperationTypeEnumStringValues Enumerates the set of values in String for BulkUnpinMetadataOperationTypeEnum +func GetBulkUnpinMetadataOperationTypeEnumStringValues() []string { + return []string{ + "UNPIN", + } +} + +// GetMappingBulkUnpinMetadataOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUnpinMetadataOperationTypeEnum(val string) (BulkUnpinMetadataOperationTypeEnum, bool) { + enum, ok := mappingBulkUnpinMetadataOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_unpin_status.go b/apmtraces/bulk_unpin_status.go new file mode 100644 index 0000000000..f24546452f --- /dev/null +++ b/apmtraces/bulk_unpin_status.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUnpinStatus Response of a bulk attribute unpin operation. +type BulkUnpinStatus struct { + + // We preserve the order of the attribute items from the bulk unpin request in this collection. The ith object in this collection represents the + // bulk unpin operation status of the ith object in the BulkUnpinAttributeDetails object in the Bulk unpin request. If the + // bulk unpin operation results in a processing error or a validation error, the operationStatus property in the BulkUnpinMetadata object will + // contain the appropriate bulk error status for the bulk operation. + AttributeStatuses []AttributeUnpinResponse `mandatory:"true" json:"attributeStatuses"` + + BulkUnpinMetadata *BulkUnpinMetadata `mandatory:"true" json:"bulkUnpinMetadata"` +} + +func (m BulkUnpinStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUnpinStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_update_attribute_detail.go b/apmtraces/bulk_update_attribute_detail.go new file mode 100644 index 0000000000..b8d5b0a4a1 --- /dev/null +++ b/apmtraces/bulk_update_attribute_detail.go @@ -0,0 +1,155 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateAttributeDetail Object that contains the details about a single attribute in the bulk request for which properties are to be updated. +type BulkUpdateAttributeDetail struct { + + // Name of the attribute for which notes are to be updated. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Unit of the attribute to be updated. + Unit BulkUpdateAttributeDetailUnitEnum `mandatory:"false" json:"unit,omitempty"` + + // Namespace of the attribute for which the properties are to be updated. + AttributeNameSpace BulkUpdateAttributeDetailAttributeNameSpaceEnum `mandatory:"false" json:"attributeNameSpace,omitempty"` +} + +func (m BulkUpdateAttributeDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateAttributeDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingBulkUpdateAttributeDetailUnitEnum(string(m.Unit)); !ok && m.Unit != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Unit: %s. Supported values are: %s.", m.Unit, strings.Join(GetBulkUpdateAttributeDetailUnitEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkUpdateAttributeDetailAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetBulkUpdateAttributeDetailAttributeNameSpaceEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUpdateAttributeDetailUnitEnum Enum with underlying type: string +type BulkUpdateAttributeDetailUnitEnum string + +// Set of constants representing the allowable values for BulkUpdateAttributeDetailUnitEnum +const ( + BulkUpdateAttributeDetailUnitNone BulkUpdateAttributeDetailUnitEnum = "NONE" + BulkUpdateAttributeDetailUnitEpochTimeMs BulkUpdateAttributeDetailUnitEnum = "EPOCH_TIME_MS" + BulkUpdateAttributeDetailUnitBytes BulkUpdateAttributeDetailUnitEnum = "BYTES" + BulkUpdateAttributeDetailUnitCount BulkUpdateAttributeDetailUnitEnum = "COUNT" + BulkUpdateAttributeDetailUnitDurationMs BulkUpdateAttributeDetailUnitEnum = "DURATION_MS" + BulkUpdateAttributeDetailUnitTraceStatus BulkUpdateAttributeDetailUnitEnum = "TRACE_STATUS" + BulkUpdateAttributeDetailUnitPercentage BulkUpdateAttributeDetailUnitEnum = "PERCENTAGE" +) + +var mappingBulkUpdateAttributeDetailUnitEnum = map[string]BulkUpdateAttributeDetailUnitEnum{ + "NONE": BulkUpdateAttributeDetailUnitNone, + "EPOCH_TIME_MS": BulkUpdateAttributeDetailUnitEpochTimeMs, + "BYTES": BulkUpdateAttributeDetailUnitBytes, + "COUNT": BulkUpdateAttributeDetailUnitCount, + "DURATION_MS": BulkUpdateAttributeDetailUnitDurationMs, + "TRACE_STATUS": BulkUpdateAttributeDetailUnitTraceStatus, + "PERCENTAGE": BulkUpdateAttributeDetailUnitPercentage, +} + +var mappingBulkUpdateAttributeDetailUnitEnumLowerCase = map[string]BulkUpdateAttributeDetailUnitEnum{ + "none": BulkUpdateAttributeDetailUnitNone, + "epoch_time_ms": BulkUpdateAttributeDetailUnitEpochTimeMs, + "bytes": BulkUpdateAttributeDetailUnitBytes, + "count": BulkUpdateAttributeDetailUnitCount, + "duration_ms": BulkUpdateAttributeDetailUnitDurationMs, + "trace_status": BulkUpdateAttributeDetailUnitTraceStatus, + "percentage": BulkUpdateAttributeDetailUnitPercentage, +} + +// GetBulkUpdateAttributeDetailUnitEnumValues Enumerates the set of values for BulkUpdateAttributeDetailUnitEnum +func GetBulkUpdateAttributeDetailUnitEnumValues() []BulkUpdateAttributeDetailUnitEnum { + values := make([]BulkUpdateAttributeDetailUnitEnum, 0) + for _, v := range mappingBulkUpdateAttributeDetailUnitEnum { + values = append(values, v) + } + return values +} + +// GetBulkUpdateAttributeDetailUnitEnumStringValues Enumerates the set of values in String for BulkUpdateAttributeDetailUnitEnum +func GetBulkUpdateAttributeDetailUnitEnumStringValues() []string { + return []string{ + "NONE", + "EPOCH_TIME_MS", + "BYTES", + "COUNT", + "DURATION_MS", + "TRACE_STATUS", + "PERCENTAGE", + } +} + +// GetMappingBulkUpdateAttributeDetailUnitEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUpdateAttributeDetailUnitEnum(val string) (BulkUpdateAttributeDetailUnitEnum, bool) { + enum, ok := mappingBulkUpdateAttributeDetailUnitEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkUpdateAttributeDetailAttributeNameSpaceEnum Enum with underlying type: string +type BulkUpdateAttributeDetailAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for BulkUpdateAttributeDetailAttributeNameSpaceEnum +const ( + BulkUpdateAttributeDetailAttributeNameSpaceTraces BulkUpdateAttributeDetailAttributeNameSpaceEnum = "TRACES" + BulkUpdateAttributeDetailAttributeNameSpaceSynthetic BulkUpdateAttributeDetailAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingBulkUpdateAttributeDetailAttributeNameSpaceEnum = map[string]BulkUpdateAttributeDetailAttributeNameSpaceEnum{ + "TRACES": BulkUpdateAttributeDetailAttributeNameSpaceTraces, + "SYNTHETIC": BulkUpdateAttributeDetailAttributeNameSpaceSynthetic, +} + +var mappingBulkUpdateAttributeDetailAttributeNameSpaceEnumLowerCase = map[string]BulkUpdateAttributeDetailAttributeNameSpaceEnum{ + "traces": BulkUpdateAttributeDetailAttributeNameSpaceTraces, + "synthetic": BulkUpdateAttributeDetailAttributeNameSpaceSynthetic, +} + +// GetBulkUpdateAttributeDetailAttributeNameSpaceEnumValues Enumerates the set of values for BulkUpdateAttributeDetailAttributeNameSpaceEnum +func GetBulkUpdateAttributeDetailAttributeNameSpaceEnumValues() []BulkUpdateAttributeDetailAttributeNameSpaceEnum { + values := make([]BulkUpdateAttributeDetailAttributeNameSpaceEnum, 0) + for _, v := range mappingBulkUpdateAttributeDetailAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetBulkUpdateAttributeDetailAttributeNameSpaceEnumStringValues Enumerates the set of values in String for BulkUpdateAttributeDetailAttributeNameSpaceEnum +func GetBulkUpdateAttributeDetailAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingBulkUpdateAttributeDetailAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUpdateAttributeDetailAttributeNameSpaceEnum(val string) (BulkUpdateAttributeDetailAttributeNameSpaceEnum, bool) { + enum, ok := mappingBulkUpdateAttributeDetailAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_update_attribute_details.go b/apmtraces/bulk_update_attribute_details.go new file mode 100644 index 0000000000..5b48823d4d --- /dev/null +++ b/apmtraces/bulk_update_attribute_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateAttributeDetails Bulk request object containing the details of the attributes for which properties are to be updated. +type BulkUpdateAttributeDetails struct { + + // Collection of objects containing the details about individual attribute for which properties are to be updated. + AttributeDetails []BulkUpdateAttributeDetail `mandatory:"false" json:"attributeDetails"` +} + +func (m BulkUpdateAttributeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateAttributeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_update_attribute_metadata.go b/apmtraces/bulk_update_attribute_metadata.go new file mode 100644 index 0000000000..cb1e145af3 --- /dev/null +++ b/apmtraces/bulk_update_attribute_metadata.go @@ -0,0 +1,144 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateAttributeMetadata Metadata about the bulk attribute update operation. The bulk attribute update operation is atomic and binary. If the processing of any of the attributes +// in the bulk attribute update request results in a processing or validation error, then none of the attributes updated. +type BulkUpdateAttributeMetadata struct { + + // Operation status of the bulk update attribute operation. + // SUCCESS - The bulk attribute update request has succeeded and all the attributes in the request have been updated. + // The following are error statuses for the bulk update attributes operation. + // EMPTY_ATTRIBUTE_LIST - The bulk update attributes request object was empty and did not contain any attributes for which properties had to be updated. + // INVALID_BULK_REQUEST - The bulk request contains invalid attribute(s), or attribute(s) that resulted in a validation error, or an attribute that resulted + // in a processing error. + OperationStatus BulkUpdateAttributeMetadataOperationStatusEnum `mandatory:"true" json:"operationStatus"` + + // Type of operation. + OperationType BulkUpdateAttributeMetadataOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Total number attributes (both string and numeric) in TRACES namespace for which properties were updated. + AttributesUpdated *int `mandatory:"true" json:"attributesUpdated"` + + // Total number attributes (both string and numeric) in SYNTHETIC namespace for which properties were updated. + SyntheticAttributesUpdated *int `mandatory:"false" json:"syntheticAttributesUpdated"` +} + +func (m BulkUpdateAttributeMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateAttributeMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingBulkUpdateAttributeMetadataOperationStatusEnum(string(m.OperationStatus)); !ok && m.OperationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationStatus: %s. Supported values are: %s.", m.OperationStatus, strings.Join(GetBulkUpdateAttributeMetadataOperationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkUpdateAttributeMetadataOperationTypeEnum(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(GetBulkUpdateAttributeMetadataOperationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUpdateAttributeMetadataOperationStatusEnum Enum with underlying type: string +type BulkUpdateAttributeMetadataOperationStatusEnum string + +// Set of constants representing the allowable values for BulkUpdateAttributeMetadataOperationStatusEnum +const ( + BulkUpdateAttributeMetadataOperationStatusSuccess BulkUpdateAttributeMetadataOperationStatusEnum = "SUCCESS" + BulkUpdateAttributeMetadataOperationStatusEmptyAttributeList BulkUpdateAttributeMetadataOperationStatusEnum = "EMPTY_ATTRIBUTE_LIST" + BulkUpdateAttributeMetadataOperationStatusInvalidBulkRequest BulkUpdateAttributeMetadataOperationStatusEnum = "INVALID_BULK_REQUEST" +) + +var mappingBulkUpdateAttributeMetadataOperationStatusEnum = map[string]BulkUpdateAttributeMetadataOperationStatusEnum{ + "SUCCESS": BulkUpdateAttributeMetadataOperationStatusSuccess, + "EMPTY_ATTRIBUTE_LIST": BulkUpdateAttributeMetadataOperationStatusEmptyAttributeList, + "INVALID_BULK_REQUEST": BulkUpdateAttributeMetadataOperationStatusInvalidBulkRequest, +} + +var mappingBulkUpdateAttributeMetadataOperationStatusEnumLowerCase = map[string]BulkUpdateAttributeMetadataOperationStatusEnum{ + "success": BulkUpdateAttributeMetadataOperationStatusSuccess, + "empty_attribute_list": BulkUpdateAttributeMetadataOperationStatusEmptyAttributeList, + "invalid_bulk_request": BulkUpdateAttributeMetadataOperationStatusInvalidBulkRequest, +} + +// GetBulkUpdateAttributeMetadataOperationStatusEnumValues Enumerates the set of values for BulkUpdateAttributeMetadataOperationStatusEnum +func GetBulkUpdateAttributeMetadataOperationStatusEnumValues() []BulkUpdateAttributeMetadataOperationStatusEnum { + values := make([]BulkUpdateAttributeMetadataOperationStatusEnum, 0) + for _, v := range mappingBulkUpdateAttributeMetadataOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetBulkUpdateAttributeMetadataOperationStatusEnumStringValues Enumerates the set of values in String for BulkUpdateAttributeMetadataOperationStatusEnum +func GetBulkUpdateAttributeMetadataOperationStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + "EMPTY_ATTRIBUTE_LIST", + "INVALID_BULK_REQUEST", + } +} + +// GetMappingBulkUpdateAttributeMetadataOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUpdateAttributeMetadataOperationStatusEnum(val string) (BulkUpdateAttributeMetadataOperationStatusEnum, bool) { + enum, ok := mappingBulkUpdateAttributeMetadataOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkUpdateAttributeMetadataOperationTypeEnum Enum with underlying type: string +type BulkUpdateAttributeMetadataOperationTypeEnum string + +// Set of constants representing the allowable values for BulkUpdateAttributeMetadataOperationTypeEnum +const ( + BulkUpdateAttributeMetadataOperationTypeUpdateAttributeProperties BulkUpdateAttributeMetadataOperationTypeEnum = "UPDATE_ATTRIBUTE_PROPERTIES" +) + +var mappingBulkUpdateAttributeMetadataOperationTypeEnum = map[string]BulkUpdateAttributeMetadataOperationTypeEnum{ + "UPDATE_ATTRIBUTE_PROPERTIES": BulkUpdateAttributeMetadataOperationTypeUpdateAttributeProperties, +} + +var mappingBulkUpdateAttributeMetadataOperationTypeEnumLowerCase = map[string]BulkUpdateAttributeMetadataOperationTypeEnum{ + "update_attribute_properties": BulkUpdateAttributeMetadataOperationTypeUpdateAttributeProperties, +} + +// GetBulkUpdateAttributeMetadataOperationTypeEnumValues Enumerates the set of values for BulkUpdateAttributeMetadataOperationTypeEnum +func GetBulkUpdateAttributeMetadataOperationTypeEnumValues() []BulkUpdateAttributeMetadataOperationTypeEnum { + values := make([]BulkUpdateAttributeMetadataOperationTypeEnum, 0) + for _, v := range mappingBulkUpdateAttributeMetadataOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetBulkUpdateAttributeMetadataOperationTypeEnumStringValues Enumerates the set of values in String for BulkUpdateAttributeMetadataOperationTypeEnum +func GetBulkUpdateAttributeMetadataOperationTypeEnumStringValues() []string { + return []string{ + "UPDATE_ATTRIBUTE_PROPERTIES", + } +} + +// GetMappingBulkUpdateAttributeMetadataOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUpdateAttributeMetadataOperationTypeEnum(val string) (BulkUpdateAttributeMetadataOperationTypeEnum, bool) { + enum, ok := mappingBulkUpdateAttributeMetadataOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_update_attribute_notes_detail.go b/apmtraces/bulk_update_attribute_notes_detail.go new file mode 100644 index 0000000000..799f715c6f --- /dev/null +++ b/apmtraces/bulk_update_attribute_notes_detail.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateAttributeNotesDetail Object that contains the details about a single attribute in the bulk request for which notes are to be updated. +type BulkUpdateAttributeNotesDetail struct { + + // Name of the attribute for which notes are to be updated. + AttributeName *string `mandatory:"true" json:"attributeName"` + + // Notes to be updated. The size of notes cannot exceed 1000 chars. + Notes *string `mandatory:"true" json:"notes"` + + // Namespace of the attribute for which the notes are to be updated. The attributeNameSpace will default to TRACES if it is + // not passed in. + AttributeNameSpace BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum `mandatory:"false" json:"attributeNameSpace,omitempty"` +} + +func (m BulkUpdateAttributeNotesDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateAttributeNotesDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingBulkUpdateAttributeNotesDetailAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetBulkUpdateAttributeNotesDetailAttributeNameSpaceEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum Enum with underlying type: string +type BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum string + +// Set of constants representing the allowable values for BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum +const ( + BulkUpdateAttributeNotesDetailAttributeNameSpaceTraces BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum = "TRACES" + BulkUpdateAttributeNotesDetailAttributeNameSpaceSynthetic BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum = "SYNTHETIC" +) + +var mappingBulkUpdateAttributeNotesDetailAttributeNameSpaceEnum = map[string]BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum{ + "TRACES": BulkUpdateAttributeNotesDetailAttributeNameSpaceTraces, + "SYNTHETIC": BulkUpdateAttributeNotesDetailAttributeNameSpaceSynthetic, +} + +var mappingBulkUpdateAttributeNotesDetailAttributeNameSpaceEnumLowerCase = map[string]BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum{ + "traces": BulkUpdateAttributeNotesDetailAttributeNameSpaceTraces, + "synthetic": BulkUpdateAttributeNotesDetailAttributeNameSpaceSynthetic, +} + +// GetBulkUpdateAttributeNotesDetailAttributeNameSpaceEnumValues Enumerates the set of values for BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum +func GetBulkUpdateAttributeNotesDetailAttributeNameSpaceEnumValues() []BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum { + values := make([]BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum, 0) + for _, v := range mappingBulkUpdateAttributeNotesDetailAttributeNameSpaceEnum { + values = append(values, v) + } + return values +} + +// GetBulkUpdateAttributeNotesDetailAttributeNameSpaceEnumStringValues Enumerates the set of values in String for BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum +func GetBulkUpdateAttributeNotesDetailAttributeNameSpaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingBulkUpdateAttributeNotesDetailAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUpdateAttributeNotesDetailAttributeNameSpaceEnum(val string) (BulkUpdateAttributeNotesDetailAttributeNameSpaceEnum, bool) { + enum, ok := mappingBulkUpdateAttributeNotesDetailAttributeNameSpaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_update_attribute_notes_details.go b/apmtraces/bulk_update_attribute_notes_details.go new file mode 100644 index 0000000000..1fac4d0da3 --- /dev/null +++ b/apmtraces/bulk_update_attribute_notes_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateAttributeNotesDetails Bulk request object containing the details of the attributes for which notes are to be updated. +type BulkUpdateAttributeNotesDetails struct { + + // Collection of objects containing the details about individual attribute for which notes are to be updated. + AttributeDetails []BulkUpdateAttributeNotesDetail `mandatory:"false" json:"attributeDetails"` +} + +func (m BulkUpdateAttributeNotesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateAttributeNotesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_update_attribute_notes_request_response.go b/apmtraces/bulk_update_attribute_notes_request_response.go new file mode 100644 index 0000000000..32ca1214b4 --- /dev/null +++ b/apmtraces/bulk_update_attribute_notes_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// BulkUpdateAttributeNotesRequest wrapper for the BulkUpdateAttributeNotes operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkUpdateAttributeNotes.go.html to see an example of how to use BulkUpdateAttributeNotesRequest. +type BulkUpdateAttributeNotesRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Request body containing the details about the set of attributes for which notes are to be updated. + BulkUpdateAttributeNotesDetails `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"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUpdateAttributeNotesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUpdateAttributeNotesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUpdateAttributeNotesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUpdateAttributeNotesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request BulkUpdateAttributeNotesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUpdateAttributeNotesResponse wrapper for the BulkUpdateAttributeNotes operation +type BulkUpdateAttributeNotesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BulkUpdateNotesStatus instance + BulkUpdateNotesStatus `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 BulkUpdateAttributeNotesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUpdateAttributeNotesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/apmtraces/bulk_update_attribute_request_response.go b/apmtraces/bulk_update_attribute_request_response.go new file mode 100644 index 0000000000..ab54be5065 --- /dev/null +++ b/apmtraces/bulk_update_attribute_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// BulkUpdateAttributeRequest wrapper for the BulkUpdateAttribute operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/BulkUpdateAttribute.go.html to see an example of how to use BulkUpdateAttributeRequest. +type BulkUpdateAttributeRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Request body containing the details about the set of attributes for which properties are to be updated. + BulkUpdateAttributeDetails `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"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUpdateAttributeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUpdateAttributeRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUpdateAttributeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUpdateAttributeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request BulkUpdateAttributeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUpdateAttributeResponse wrapper for the BulkUpdateAttribute operation +type BulkUpdateAttributeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BulkUpdateAttributeStatus instance + BulkUpdateAttributeStatus `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 BulkUpdateAttributeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUpdateAttributeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/apmtraces/bulk_update_attribute_status.go b/apmtraces/bulk_update_attribute_status.go new file mode 100644 index 0000000000..6fd154643f --- /dev/null +++ b/apmtraces/bulk_update_attribute_status.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateAttributeStatus Response of a bulk update attribute operation. +type BulkUpdateAttributeStatus struct { + + // We preserve the order of the attribute items from the bulk update attribute request in this collection. The ith object in this collection represents the + // bulk update attribute operation status of the ith object in the BulkUpdateAttributeDetails object in the Bulk update attribute request. If the + // bulk update attribute operation results in a processing error or a validation error, the operationStatus property in the BulkUpdateAttributeMetadata object will + // contain the appropriate bulk error status for the bulk operation. + AttributeStatuses []AttributeUpdateResponse `mandatory:"true" json:"attributeStatuses"` + + BulkUpdateAttributeMetadata *BulkUpdateAttributeMetadata `mandatory:"true" json:"bulkUpdateAttributeMetadata"` +} + +func (m BulkUpdateAttributeStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateAttributeStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/bulk_update_notes_metadata.go b/apmtraces/bulk_update_notes_metadata.go new file mode 100644 index 0000000000..f23280b39e --- /dev/null +++ b/apmtraces/bulk_update_notes_metadata.go @@ -0,0 +1,144 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateNotesMetadata Metadata about the bulk update notes operation. The bulk update notes operation is atomic and binary. If the processing of any of the attributes +// in the bulk update notes request results in a processing or validation error, then none of the notes in the update notes request are updated. +type BulkUpdateNotesMetadata struct { + + // Operation status of the bulk update notes operation. + // SUCCESS - The bulk updates notes request has succeeded and all the attributes in the bulk update notes request have been updated with the provided notes. + // The following are error statuses for the bulk update notes operation. + // EMPTY_ATTRIBUTE_LIST - The bulk update notes request object was empty and did not contain any attributes for which notes had to be updated. + // INVALID_BULK_REQUEST - The bulk request contains invalid attribute(s), or attribute(s) that resulted in a validation error, or an attribute that resulted + // in a processing error. + OperationStatus BulkUpdateNotesMetadataOperationStatusEnum `mandatory:"true" json:"operationStatus"` + + // Type of operation. + OperationType BulkUpdateNotesMetadataOperationTypeEnum `mandatory:"true" json:"operationType"` + + // Total number attributes (both string and numeric) in TRACES namespace for which notes were updated. + AttributesNotesUpdated *int `mandatory:"true" json:"attributesNotesUpdated"` + + // Total number attributes (both string and numeric) in SYNTHETIC namespace that were pinned. + SyntheticAttributesPinned *int `mandatory:"false" json:"syntheticAttributesPinned"` +} + +func (m BulkUpdateNotesMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateNotesMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingBulkUpdateNotesMetadataOperationStatusEnum(string(m.OperationStatus)); !ok && m.OperationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationStatus: %s. Supported values are: %s.", m.OperationStatus, strings.Join(GetBulkUpdateNotesMetadataOperationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingBulkUpdateNotesMetadataOperationTypeEnum(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(GetBulkUpdateNotesMetadataOperationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUpdateNotesMetadataOperationStatusEnum Enum with underlying type: string +type BulkUpdateNotesMetadataOperationStatusEnum string + +// Set of constants representing the allowable values for BulkUpdateNotesMetadataOperationStatusEnum +const ( + BulkUpdateNotesMetadataOperationStatusSuccess BulkUpdateNotesMetadataOperationStatusEnum = "SUCCESS" + BulkUpdateNotesMetadataOperationStatusEmptyAttributeList BulkUpdateNotesMetadataOperationStatusEnum = "EMPTY_ATTRIBUTE_LIST" + BulkUpdateNotesMetadataOperationStatusInvalidBulkRequest BulkUpdateNotesMetadataOperationStatusEnum = "INVALID_BULK_REQUEST" +) + +var mappingBulkUpdateNotesMetadataOperationStatusEnum = map[string]BulkUpdateNotesMetadataOperationStatusEnum{ + "SUCCESS": BulkUpdateNotesMetadataOperationStatusSuccess, + "EMPTY_ATTRIBUTE_LIST": BulkUpdateNotesMetadataOperationStatusEmptyAttributeList, + "INVALID_BULK_REQUEST": BulkUpdateNotesMetadataOperationStatusInvalidBulkRequest, +} + +var mappingBulkUpdateNotesMetadataOperationStatusEnumLowerCase = map[string]BulkUpdateNotesMetadataOperationStatusEnum{ + "success": BulkUpdateNotesMetadataOperationStatusSuccess, + "empty_attribute_list": BulkUpdateNotesMetadataOperationStatusEmptyAttributeList, + "invalid_bulk_request": BulkUpdateNotesMetadataOperationStatusInvalidBulkRequest, +} + +// GetBulkUpdateNotesMetadataOperationStatusEnumValues Enumerates the set of values for BulkUpdateNotesMetadataOperationStatusEnum +func GetBulkUpdateNotesMetadataOperationStatusEnumValues() []BulkUpdateNotesMetadataOperationStatusEnum { + values := make([]BulkUpdateNotesMetadataOperationStatusEnum, 0) + for _, v := range mappingBulkUpdateNotesMetadataOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetBulkUpdateNotesMetadataOperationStatusEnumStringValues Enumerates the set of values in String for BulkUpdateNotesMetadataOperationStatusEnum +func GetBulkUpdateNotesMetadataOperationStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + "EMPTY_ATTRIBUTE_LIST", + "INVALID_BULK_REQUEST", + } +} + +// GetMappingBulkUpdateNotesMetadataOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUpdateNotesMetadataOperationStatusEnum(val string) (BulkUpdateNotesMetadataOperationStatusEnum, bool) { + enum, ok := mappingBulkUpdateNotesMetadataOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// BulkUpdateNotesMetadataOperationTypeEnum Enum with underlying type: string +type BulkUpdateNotesMetadataOperationTypeEnum string + +// Set of constants representing the allowable values for BulkUpdateNotesMetadataOperationTypeEnum +const ( + BulkUpdateNotesMetadataOperationTypeUpdateNotes BulkUpdateNotesMetadataOperationTypeEnum = "UPDATE_NOTES" +) + +var mappingBulkUpdateNotesMetadataOperationTypeEnum = map[string]BulkUpdateNotesMetadataOperationTypeEnum{ + "UPDATE_NOTES": BulkUpdateNotesMetadataOperationTypeUpdateNotes, +} + +var mappingBulkUpdateNotesMetadataOperationTypeEnumLowerCase = map[string]BulkUpdateNotesMetadataOperationTypeEnum{ + "update_notes": BulkUpdateNotesMetadataOperationTypeUpdateNotes, +} + +// GetBulkUpdateNotesMetadataOperationTypeEnumValues Enumerates the set of values for BulkUpdateNotesMetadataOperationTypeEnum +func GetBulkUpdateNotesMetadataOperationTypeEnumValues() []BulkUpdateNotesMetadataOperationTypeEnum { + values := make([]BulkUpdateNotesMetadataOperationTypeEnum, 0) + for _, v := range mappingBulkUpdateNotesMetadataOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetBulkUpdateNotesMetadataOperationTypeEnumStringValues Enumerates the set of values in String for BulkUpdateNotesMetadataOperationTypeEnum +func GetBulkUpdateNotesMetadataOperationTypeEnumStringValues() []string { + return []string{ + "UPDATE_NOTES", + } +} + +// GetMappingBulkUpdateNotesMetadataOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBulkUpdateNotesMetadataOperationTypeEnum(val string) (BulkUpdateNotesMetadataOperationTypeEnum, bool) { + enum, ok := mappingBulkUpdateNotesMetadataOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/bulk_update_notes_status.go b/apmtraces/bulk_update_notes_status.go new file mode 100644 index 0000000000..3b6eeaa578 --- /dev/null +++ b/apmtraces/bulk_update_notes_status.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BulkUpdateNotesStatus Response of a bulk update notes operation. +type BulkUpdateNotesStatus struct { + + // We preserve the order of the attribute items from the bulk update notes request in this collection. The ith object in this collection represents the + // bulk update notes operation status of the ith object in the BulkUpdateAttributeNotesDetails object in the Bulk update notes request. If the + // bulk update notes operation results in a processing error or a validation error, the operationStatus property in the BulkUpdateNotesMetadata object will + // contain the appropriate bulk error status for the bulk operation. + AttributeStatuses []AttributeUpdateNotesResponse `mandatory:"true" json:"attributeStatuses"` + + BulkUpdateNotesMetadata *BulkUpdateNotesMetadata `mandatory:"true" json:"bulkUpdateNotesMetadata"` +} + +func (m BulkUpdateNotesStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BulkUpdateNotesStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/get_aggregated_snapshot_request_response.go b/apmtraces/get_aggregated_snapshot_request_response.go index 377d7317e0..d11d656b31 100644 --- a/apmtraces/get_aggregated_snapshot_request_response.go +++ b/apmtraces/get_aggregated_snapshot_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/GetAggregatedSnapshot.go.html to see an example of how to use GetAggregatedSnapshotRequest. type GetAggregatedSnapshotRequest struct { - // The APM Domain ID the request is intended for. + // The APM Domain ID for the intended request. ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` // Unique Application Performance Monitoring trace identifier (traceId). @@ -28,6 +28,18 @@ type GetAggregatedSnapshotRequest struct { // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Name associated with the service. + ServiceName *string `mandatory:"false" contributesTo:"query" name:"serviceName"` + + // Name of the server. + ServerName *string `mandatory:"false" contributesTo:"query" name:"serverName"` + + // Unique Application Performance Monitoring span identifier (spanId). + SpanKey *string `mandatory:"false" contributesTo:"query" name:"spanKey"` + + // Name of the span associated with the trace. + SpanName *string `mandatory:"false" contributesTo:"query" name:"spanName"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/apmtraces/get_span_request_response.go b/apmtraces/get_span_request_response.go index fdd6144b5e..13240f059f 100644 --- a/apmtraces/get_span_request_response.go +++ b/apmtraces/get_span_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/GetSpan.go.html to see an example of how to use GetSpanRequest. type GetSpanRequest struct { - // The APM Domain ID the request is intended for. + // The APM Domain ID for the intended request. ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` // Unique Application Performance Monitoring span identifier (spanId). @@ -31,6 +31,15 @@ type GetSpanRequest struct { // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Include spans that have a `spanStartTime` equal to or greater than this value. + TimeSpanStartedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeSpanStartedGreaterThanOrEqualTo"` + + // Include spans that have a `spanStartTime`less than this value. + TimeSpanStartedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeSpanStartedLessThan"` + + // Name space from which the span details need to be retrieved. + SpanNamespace GetSpanSpanNamespaceEnum `mandatory:"false" contributesTo:"query" name:"spanNamespace" 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 @@ -67,6 +76,9 @@ func (request GetSpanRequest) RetryPolicy() *common.RetryPolicy { // Not recommended for calling this function directly func (request GetSpanRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingGetSpanSpanNamespaceEnum(string(request.SpanNamespace)); !ok && request.SpanNamespace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SpanNamespace: %s. Supported values are: %s.", request.SpanNamespace, strings.Join(GetGetSpanSpanNamespaceEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -95,3 +107,45 @@ func (response GetSpanResponse) String() string { func (response GetSpanResponse) HTTPResponse() *http.Response { return response.RawResponse } + +// GetSpanSpanNamespaceEnum Enum with underlying type: string +type GetSpanSpanNamespaceEnum string + +// Set of constants representing the allowable values for GetSpanSpanNamespaceEnum +const ( + GetSpanSpanNamespaceTraces GetSpanSpanNamespaceEnum = "TRACES" + GetSpanSpanNamespaceSynthetic GetSpanSpanNamespaceEnum = "SYNTHETIC" +) + +var mappingGetSpanSpanNamespaceEnum = map[string]GetSpanSpanNamespaceEnum{ + "TRACES": GetSpanSpanNamespaceTraces, + "SYNTHETIC": GetSpanSpanNamespaceSynthetic, +} + +var mappingGetSpanSpanNamespaceEnumLowerCase = map[string]GetSpanSpanNamespaceEnum{ + "traces": GetSpanSpanNamespaceTraces, + "synthetic": GetSpanSpanNamespaceSynthetic, +} + +// GetGetSpanSpanNamespaceEnumValues Enumerates the set of values for GetSpanSpanNamespaceEnum +func GetGetSpanSpanNamespaceEnumValues() []GetSpanSpanNamespaceEnum { + values := make([]GetSpanSpanNamespaceEnum, 0) + for _, v := range mappingGetSpanSpanNamespaceEnum { + values = append(values, v) + } + return values +} + +// GetGetSpanSpanNamespaceEnumStringValues Enumerates the set of values in String for GetSpanSpanNamespaceEnum +func GetGetSpanSpanNamespaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingGetSpanSpanNamespaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetSpanSpanNamespaceEnum(val string) (GetSpanSpanNamespaceEnum, bool) { + enum, ok := mappingGetSpanSpanNamespaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/get_status_auto_activate_request_response.go b/apmtraces/get_status_auto_activate_request_response.go new file mode 100644 index 0000000000..5a69958f15 --- /dev/null +++ b/apmtraces/get_status_auto_activate_request_response.go @@ -0,0 +1,139 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetStatusAutoActivateRequest wrapper for the GetStatusAutoActivate operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/GetStatusAutoActivate.go.html to see an example of how to use GetStatusAutoActivateRequest. +type GetStatusAutoActivateRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Data key type for which auto-activate needs to be turned on or off. + DataKeyType GetStatusAutoActivateDataKeyTypeEnum `mandatory:"true" contributesTo:"query" name:"dataKeyType" 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 GetStatusAutoActivateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetStatusAutoActivateRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetStatusAutoActivateRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetStatusAutoActivateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetStatusAutoActivateRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGetStatusAutoActivateDataKeyTypeEnum(string(request.DataKeyType)); !ok && request.DataKeyType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataKeyType: %s. Supported values are: %s.", request.DataKeyType, strings.Join(GetGetStatusAutoActivateDataKeyTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetStatusAutoActivateResponse wrapper for the GetStatusAutoActivate operation +type GetStatusAutoActivateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoActivateStatus instance + AutoActivateStatus `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 GetStatusAutoActivateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetStatusAutoActivateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetStatusAutoActivateDataKeyTypeEnum Enum with underlying type: string +type GetStatusAutoActivateDataKeyTypeEnum string + +// Set of constants representing the allowable values for GetStatusAutoActivateDataKeyTypeEnum +const ( + GetStatusAutoActivateDataKeyTypePrivateDataKey GetStatusAutoActivateDataKeyTypeEnum = "PRIVATE_DATA_KEY" + GetStatusAutoActivateDataKeyTypePublicDataKey GetStatusAutoActivateDataKeyTypeEnum = "PUBLIC_DATA_KEY" +) + +var mappingGetStatusAutoActivateDataKeyTypeEnum = map[string]GetStatusAutoActivateDataKeyTypeEnum{ + "PRIVATE_DATA_KEY": GetStatusAutoActivateDataKeyTypePrivateDataKey, + "PUBLIC_DATA_KEY": GetStatusAutoActivateDataKeyTypePublicDataKey, +} + +var mappingGetStatusAutoActivateDataKeyTypeEnumLowerCase = map[string]GetStatusAutoActivateDataKeyTypeEnum{ + "private_data_key": GetStatusAutoActivateDataKeyTypePrivateDataKey, + "public_data_key": GetStatusAutoActivateDataKeyTypePublicDataKey, +} + +// GetGetStatusAutoActivateDataKeyTypeEnumValues Enumerates the set of values for GetStatusAutoActivateDataKeyTypeEnum +func GetGetStatusAutoActivateDataKeyTypeEnumValues() []GetStatusAutoActivateDataKeyTypeEnum { + values := make([]GetStatusAutoActivateDataKeyTypeEnum, 0) + for _, v := range mappingGetStatusAutoActivateDataKeyTypeEnum { + values = append(values, v) + } + return values +} + +// GetGetStatusAutoActivateDataKeyTypeEnumStringValues Enumerates the set of values in String for GetStatusAutoActivateDataKeyTypeEnum +func GetGetStatusAutoActivateDataKeyTypeEnumStringValues() []string { + return []string{ + "PRIVATE_DATA_KEY", + "PUBLIC_DATA_KEY", + } +} + +// GetMappingGetStatusAutoActivateDataKeyTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetStatusAutoActivateDataKeyTypeEnum(val string) (GetStatusAutoActivateDataKeyTypeEnum, bool) { + enum, ok := mappingGetStatusAutoActivateDataKeyTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/get_trace_request_response.go b/apmtraces/get_trace_request_response.go index 7b79a09d43..1c36dea6ac 100644 --- a/apmtraces/get_trace_request_response.go +++ b/apmtraces/get_trace_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/GetTrace.go.html to see an example of how to use GetTraceRequest. type GetTraceRequest struct { - // The APM Domain ID the request is intended for. + // The APM Domain ID for the intended request. ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` // Unique Application Performance Monitoring trace identifier (traceId). @@ -28,6 +28,15 @@ type GetTraceRequest struct { // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Include traces that have a `minTraceStartTime` equal to or greater than this value. + TimeTraceStartedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeTraceStartedGreaterThanOrEqualTo"` + + // Include traces that have a `minTraceStartTime` less than this value. + TimeTraceStartedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeTraceStartedLessThan"` + + // Name space from which the trace details need to be retrieved. + TraceNamespace GetTraceTraceNamespaceEnum `mandatory:"false" contributesTo:"query" name:"traceNamespace" 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 @@ -64,6 +73,9 @@ func (request GetTraceRequest) RetryPolicy() *common.RetryPolicy { // Not recommended for calling this function directly func (request GetTraceRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingGetTraceTraceNamespaceEnum(string(request.TraceNamespace)); !ok && request.TraceNamespace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TraceNamespace: %s. Supported values are: %s.", request.TraceNamespace, strings.Join(GetGetTraceTraceNamespaceEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -92,3 +104,45 @@ func (response GetTraceResponse) String() string { func (response GetTraceResponse) HTTPResponse() *http.Response { return response.RawResponse } + +// GetTraceTraceNamespaceEnum Enum with underlying type: string +type GetTraceTraceNamespaceEnum string + +// Set of constants representing the allowable values for GetTraceTraceNamespaceEnum +const ( + GetTraceTraceNamespaceTraces GetTraceTraceNamespaceEnum = "TRACES" + GetTraceTraceNamespaceSynthetic GetTraceTraceNamespaceEnum = "SYNTHETIC" +) + +var mappingGetTraceTraceNamespaceEnum = map[string]GetTraceTraceNamespaceEnum{ + "TRACES": GetTraceTraceNamespaceTraces, + "SYNTHETIC": GetTraceTraceNamespaceSynthetic, +} + +var mappingGetTraceTraceNamespaceEnumLowerCase = map[string]GetTraceTraceNamespaceEnum{ + "traces": GetTraceTraceNamespaceTraces, + "synthetic": GetTraceTraceNamespaceSynthetic, +} + +// GetGetTraceTraceNamespaceEnumValues Enumerates the set of values for GetTraceTraceNamespaceEnum +func GetGetTraceTraceNamespaceEnumValues() []GetTraceTraceNamespaceEnum { + values := make([]GetTraceTraceNamespaceEnum, 0) + for _, v := range mappingGetTraceTraceNamespaceEnum { + values = append(values, v) + } + return values +} + +// GetGetTraceTraceNamespaceEnumStringValues Enumerates the set of values in String for GetTraceTraceNamespaceEnum +func GetGetTraceTraceNamespaceEnumStringValues() []string { + return []string{ + "TRACES", + "SYNTHETIC", + } +} + +// GetMappingGetTraceTraceNamespaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetTraceTraceNamespaceEnum(val string) (GetTraceTraceNamespaceEnum, bool) { + enum, ok := mappingGetTraceTraceNamespaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/get_trace_snapshot_request_response.go b/apmtraces/get_trace_snapshot_request_response.go index b4c2e3a71d..c6e90a2c90 100644 --- a/apmtraces/get_trace_snapshot_request_response.go +++ b/apmtraces/get_trace_snapshot_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/GetTraceSnapshot.go.html to see an example of how to use GetTraceSnapshotRequest. type GetTraceSnapshotRequest struct { - // The APM Domain ID the request is intended for. + // The APM Domain ID for the intended request. ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` // Unique Application Performance Monitoring trace identifier (traceId). @@ -28,10 +28,10 @@ type GetTraceSnapshotRequest struct { // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // If enabled, then only span level details will be sent. + // If enabled, only span level details are sent. IsSummarized *bool `mandatory:"false" contributesTo:"query" name:"isSummarized"` - // Thread id for which snapshots needs to be retrieved. This is an identifier of a thread, and is a positive long number generated when when a thread is created. + // Thread ID for which snapshots need to be retrieved. This identifier of a thread is a long positive number generated when a thread is created. ThreadId *string `mandatory:"false" contributesTo:"query" name:"threadId"` // Epoch time of snapshot. diff --git a/apmtraces/list_quick_picks_request_response.go b/apmtraces/list_quick_picks_request_response.go index 6d7804e1a6..5f447c0d73 100644 --- a/apmtraces/list_quick_picks_request_response.go +++ b/apmtraces/list_quick_picks_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/ListQuickPicks.go.html to see an example of how to use ListQuickPicksRequest. type ListQuickPicksRequest struct { - // The APM Domain ID the request is intended for. + // The APM Domain ID for the intended request. ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -28,7 +28,7 @@ type ListQuickPicksRequest struct { // The maximum number of items to return. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The page token representing the page at which to start retrieving results. + // The page token representing the page where to start retrieving results. // This is usually retrieved from a previous response. Page *string `mandatory:"false" contributesTo:"query" name:"page"` diff --git a/apmtraces/put_toggle_auto_activate_request_response.go b/apmtraces/put_toggle_auto_activate_request_response.go new file mode 100644 index 0000000000..b8531a9584 --- /dev/null +++ b/apmtraces/put_toggle_auto_activate_request_response.go @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PutToggleAutoActivateRequest wrapper for the PutToggleAutoActivate operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/PutToggleAutoActivate.go.html to see an example of how to use PutToggleAutoActivateRequest. +type PutToggleAutoActivateRequest struct { + + // The APM Domain ID for the intended request. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Autoactivate toggle switch. Set to true to turn on auto-activate. Set to false to turn off auto-activate. + IsAutoActivateOn *bool `mandatory:"true" contributesTo:"query" name:"isAutoActivateOn"` + + // Data key type for which auto-activate needs to be turned on or off. + DataKeyType PutToggleAutoActivateDataKeyTypeEnum `mandatory:"true" contributesTo:"query" name:"dataKeyType" 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 PutToggleAutoActivateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PutToggleAutoActivateRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request PutToggleAutoActivateRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PutToggleAutoActivateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request PutToggleAutoActivateRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPutToggleAutoActivateDataKeyTypeEnum(string(request.DataKeyType)); !ok && request.DataKeyType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataKeyType: %s. Supported values are: %s.", request.DataKeyType, strings.Join(GetPutToggleAutoActivateDataKeyTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PutToggleAutoActivateResponse wrapper for the PutToggleAutoActivate operation +type PutToggleAutoActivateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoActivateToggleStatus instance + AutoActivateToggleStatus `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 PutToggleAutoActivateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PutToggleAutoActivateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// PutToggleAutoActivateDataKeyTypeEnum Enum with underlying type: string +type PutToggleAutoActivateDataKeyTypeEnum string + +// Set of constants representing the allowable values for PutToggleAutoActivateDataKeyTypeEnum +const ( + PutToggleAutoActivateDataKeyTypePrivateDataKey PutToggleAutoActivateDataKeyTypeEnum = "PRIVATE_DATA_KEY" + PutToggleAutoActivateDataKeyTypePublicDataKey PutToggleAutoActivateDataKeyTypeEnum = "PUBLIC_DATA_KEY" +) + +var mappingPutToggleAutoActivateDataKeyTypeEnum = map[string]PutToggleAutoActivateDataKeyTypeEnum{ + "PRIVATE_DATA_KEY": PutToggleAutoActivateDataKeyTypePrivateDataKey, + "PUBLIC_DATA_KEY": PutToggleAutoActivateDataKeyTypePublicDataKey, +} + +var mappingPutToggleAutoActivateDataKeyTypeEnumLowerCase = map[string]PutToggleAutoActivateDataKeyTypeEnum{ + "private_data_key": PutToggleAutoActivateDataKeyTypePrivateDataKey, + "public_data_key": PutToggleAutoActivateDataKeyTypePublicDataKey, +} + +// GetPutToggleAutoActivateDataKeyTypeEnumValues Enumerates the set of values for PutToggleAutoActivateDataKeyTypeEnum +func GetPutToggleAutoActivateDataKeyTypeEnumValues() []PutToggleAutoActivateDataKeyTypeEnum { + values := make([]PutToggleAutoActivateDataKeyTypeEnum, 0) + for _, v := range mappingPutToggleAutoActivateDataKeyTypeEnum { + values = append(values, v) + } + return values +} + +// GetPutToggleAutoActivateDataKeyTypeEnumStringValues Enumerates the set of values in String for PutToggleAutoActivateDataKeyTypeEnum +func GetPutToggleAutoActivateDataKeyTypeEnumStringValues() []string { + return []string{ + "PRIVATE_DATA_KEY", + "PUBLIC_DATA_KEY", + } +} + +// GetMappingPutToggleAutoActivateDataKeyTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPutToggleAutoActivateDataKeyTypeEnum(val string) (PutToggleAutoActivateDataKeyTypeEnum, bool) { + enum, ok := mappingPutToggleAutoActivateDataKeyTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/query_request_response.go b/apmtraces/query_request_response.go index 04f055bdf2..d2e5133ca8 100644 --- a/apmtraces/query_request_response.go +++ b/apmtraces/query_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmtraces/Query.go.html to see an example of how to use QueryRequest. type QueryRequest struct { - // The APM Domain ID the request is intended for. + // The APM Domain ID for the intended request. ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` // Include spans that have a `spanStartTime` equal to or greater than this value. @@ -38,7 +38,7 @@ type QueryRequest struct { // The maximum number of items to return. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The page token representing the page at which to start retrieving results. + // The page token representing the page where to start retrieving results. // This is usually retrieved from a previous response. Page *string `mandatory:"false" contributesTo:"query" name:"page"` diff --git a/apmtraces/query_result_metadata_summary.go b/apmtraces/query_result_metadata_summary.go index 4024a5db71..8ce611d9ee 100644 --- a/apmtraces/query_result_metadata_summary.go +++ b/apmtraces/query_result_metadata_summary.go @@ -33,6 +33,8 @@ type QueryResultMetadataSummary struct { // will contain more than one OrderedBy summary object, if the sort was multidimensional. QueryResultsOrderedBy []QueryResultsOrderedBySummary `mandatory:"false" json:"queryResultsOrderedBy"` + QueryResultsTopologyInfo *QueryResultsTopologyInfo `mandatory:"false" json:"queryResultsTopologyInfo"` + // Interval for the time series function in minutes. TimeSeriesIntervalInMins *int `mandatory:"false" json:"timeSeriesIntervalInMins"` } diff --git a/apmtraces/query_result_response.go b/apmtraces/query_result_response.go index def9dfb752..5077bfa572 100644 --- a/apmtraces/query_result_response.go +++ b/apmtraces/query_result_response.go @@ -25,6 +25,12 @@ type QueryResultResponse struct { // returned in this collection correspond to the total number of rows returned by the actual query that is run against // the queried entity. QueryResultRows []QueryResultRow `mandatory:"true" json:"queryResultRows"` + + // A map containing metadata or additional information. + QueryResultMetadata map[string]interface{} `mandatory:"false" json:"queryResultMetadata"` + + // A structure that provides warnings, if any, along with the query results. + QueryResultWarnings []QueryResultWarning `mandatory:"false" json:"queryResultWarnings"` } func (m QueryResultResponse) String() string { diff --git a/apmtraces/query_result_warning.go b/apmtraces/query_result_warning.go new file mode 100644 index 0000000000..f9c49fb221 --- /dev/null +++ b/apmtraces/query_result_warning.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueryResultWarning A warning message that can be included with a query result that provides information to the user. +type QueryResultWarning struct { + + // The text of the warning message. + Message *string `mandatory:"false" json:"message"` +} + +func (m QueryResultWarning) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m QueryResultWarning) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/query_results_topology_info.go b/apmtraces/query_results_topology_info.go new file mode 100644 index 0000000000..8891a46cf1 --- /dev/null +++ b/apmtraces/query_results_topology_info.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueryResultsTopologyInfo The structure that provides the metadata of a topology query. +type QueryResultsTopologyInfo struct { + + // The information about the attributes of the topology nodes. + Nodes []QueryResultsTopologyNodeInfo `mandatory:"false" json:"nodes"` +} + +func (m QueryResultsTopologyInfo) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m QueryResultsTopologyInfo) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/query_results_topology_node_info.go b/apmtraces/query_results_topology_node_info.go new file mode 100644 index 0000000000..04232d6cbb --- /dev/null +++ b/apmtraces/query_results_topology_node_info.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueryResultsTopologyNodeInfo The information about a node attribute. +type QueryResultsTopologyNodeInfo struct { + + // The name of the node attribute. + NodeName *string `mandatory:"false" json:"nodeName"` +} + +func (m QueryResultsTopologyNodeInfo) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m QueryResultsTopologyNodeInfo) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apmtraces/span.go b/apmtraces/span.go index 78692f1385..ca04dd5fa3 100644 --- a/apmtraces/span.go +++ b/apmtraces/span.go @@ -53,8 +53,14 @@ type Span struct { // List of tags associated with the span. Tags []Tag `mandatory:"false" json:"tags"` + // Metadata about the tags in the span. + TagsMetadata map[string]TagMetadata `mandatory:"false" json:"tagsMetadata"` + // List of logs associated with the span. Logs []SpanLogCollection `mandatory:"false" json:"logs"` + + // Source of span (spans, syn_spans). + SourceName SpanSourceNameEnum `mandatory:"false" json:"sourceName,omitempty"` } func (m Span) String() string { @@ -67,8 +73,53 @@ func (m Span) String() string { func (m Span) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingSpanSourceNameEnum(string(m.SourceName)); !ok && m.SourceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceName: %s. Supported values are: %s.", m.SourceName, strings.Join(GetSpanSourceNameEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } + +// SpanSourceNameEnum Enum with underlying type: string +type SpanSourceNameEnum string + +// Set of constants representing the allowable values for SpanSourceNameEnum +const ( + SpanSourceNameSpans SpanSourceNameEnum = "SPANS" + SpanSourceNameSynSpans SpanSourceNameEnum = "SYN_SPANS" +) + +var mappingSpanSourceNameEnum = map[string]SpanSourceNameEnum{ + "SPANS": SpanSourceNameSpans, + "SYN_SPANS": SpanSourceNameSynSpans, +} + +var mappingSpanSourceNameEnumLowerCase = map[string]SpanSourceNameEnum{ + "spans": SpanSourceNameSpans, + "syn_spans": SpanSourceNameSynSpans, +} + +// GetSpanSourceNameEnumValues Enumerates the set of values for SpanSourceNameEnum +func GetSpanSourceNameEnumValues() []SpanSourceNameEnum { + values := make([]SpanSourceNameEnum, 0) + for _, v := range mappingSpanSourceNameEnum { + values = append(values, v) + } + return values +} + +// GetSpanSourceNameEnumStringValues Enumerates the set of values in String for SpanSourceNameEnum +func GetSpanSourceNameEnumStringValues() []string { + return []string{ + "SPANS", + "SYN_SPANS", + } +} + +// GetMappingSpanSourceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSpanSourceNameEnum(val string) (SpanSourceNameEnum, bool) { + enum, ok := mappingSpanSourceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/span_log_collection.go b/apmtraces/span_log_collection.go index 0ec072f76c..a0147ad7e7 100644 --- a/apmtraces/span_log_collection.go +++ b/apmtraces/span_log_collection.go @@ -21,6 +21,9 @@ type SpanLogCollection struct { // Timestamp at which the log is created. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + // Name of the event for which the log is created. + EventName *string `mandatory:"false" json:"eventName"` + // List of logs associated with the span at the given timestamp. SpanLogs []SpanLog `mandatory:"false" json:"spanLogs"` } diff --git a/apmtraces/tag_metadata.go b/apmtraces/tag_metadata.go new file mode 100644 index 0000000000..69d45938c4 --- /dev/null +++ b/apmtraces/tag_metadata.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Trace Explorer API +// +// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmtraces + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TagMetadata Definition of the tag metadata. +type TagMetadata struct { + + // Type associated with the tag key. + TagType TagMetadataTagTypeEnum `mandatory:"false" json:"tagType,omitempty"` + + // Unit associated with the tag key. + TagUnit TagMetadataTagUnitEnum `mandatory:"false" json:"tagUnit,omitempty"` +} + +func (m TagMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TagMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingTagMetadataTagTypeEnum(string(m.TagType)); !ok && m.TagType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TagType: %s. Supported values are: %s.", m.TagType, strings.Join(GetTagMetadataTagTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingTagMetadataTagUnitEnum(string(m.TagUnit)); !ok && m.TagUnit != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TagUnit: %s. Supported values are: %s.", m.TagUnit, strings.Join(GetTagMetadataTagUnitEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// TagMetadataTagTypeEnum Enum with underlying type: string +type TagMetadataTagTypeEnum string + +// Set of constants representing the allowable values for TagMetadataTagTypeEnum +const ( + TagMetadataTagTypeString TagMetadataTagTypeEnum = "STRING" + TagMetadataTagTypeNumeric TagMetadataTagTypeEnum = "NUMERIC" +) + +var mappingTagMetadataTagTypeEnum = map[string]TagMetadataTagTypeEnum{ + "STRING": TagMetadataTagTypeString, + "NUMERIC": TagMetadataTagTypeNumeric, +} + +var mappingTagMetadataTagTypeEnumLowerCase = map[string]TagMetadataTagTypeEnum{ + "string": TagMetadataTagTypeString, + "numeric": TagMetadataTagTypeNumeric, +} + +// GetTagMetadataTagTypeEnumValues Enumerates the set of values for TagMetadataTagTypeEnum +func GetTagMetadataTagTypeEnumValues() []TagMetadataTagTypeEnum { + values := make([]TagMetadataTagTypeEnum, 0) + for _, v := range mappingTagMetadataTagTypeEnum { + values = append(values, v) + } + return values +} + +// GetTagMetadataTagTypeEnumStringValues Enumerates the set of values in String for TagMetadataTagTypeEnum +func GetTagMetadataTagTypeEnumStringValues() []string { + return []string{ + "STRING", + "NUMERIC", + } +} + +// GetMappingTagMetadataTagTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTagMetadataTagTypeEnum(val string) (TagMetadataTagTypeEnum, bool) { + enum, ok := mappingTagMetadataTagTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// TagMetadataTagUnitEnum Enum with underlying type: string +type TagMetadataTagUnitEnum string + +// Set of constants representing the allowable values for TagMetadataTagUnitEnum +const ( + TagMetadataTagUnitEpochTimeMs TagMetadataTagUnitEnum = "EPOCH_TIME_MS" + TagMetadataTagUnitBytes TagMetadataTagUnitEnum = "BYTES" + TagMetadataTagUnitCount TagMetadataTagUnitEnum = "COUNT" + TagMetadataTagUnitDurationMs TagMetadataTagUnitEnum = "DURATION_MS" + TagMetadataTagUnitTraceStatus TagMetadataTagUnitEnum = "TRACE_STATUS" + TagMetadataTagUnitPercentage TagMetadataTagUnitEnum = "PERCENTAGE" + TagMetadataTagUnitNone TagMetadataTagUnitEnum = "NONE" +) + +var mappingTagMetadataTagUnitEnum = map[string]TagMetadataTagUnitEnum{ + "EPOCH_TIME_MS": TagMetadataTagUnitEpochTimeMs, + "BYTES": TagMetadataTagUnitBytes, + "COUNT": TagMetadataTagUnitCount, + "DURATION_MS": TagMetadataTagUnitDurationMs, + "TRACE_STATUS": TagMetadataTagUnitTraceStatus, + "PERCENTAGE": TagMetadataTagUnitPercentage, + "NONE": TagMetadataTagUnitNone, +} + +var mappingTagMetadataTagUnitEnumLowerCase = map[string]TagMetadataTagUnitEnum{ + "epoch_time_ms": TagMetadataTagUnitEpochTimeMs, + "bytes": TagMetadataTagUnitBytes, + "count": TagMetadataTagUnitCount, + "duration_ms": TagMetadataTagUnitDurationMs, + "trace_status": TagMetadataTagUnitTraceStatus, + "percentage": TagMetadataTagUnitPercentage, + "none": TagMetadataTagUnitNone, +} + +// GetTagMetadataTagUnitEnumValues Enumerates the set of values for TagMetadataTagUnitEnum +func GetTagMetadataTagUnitEnumValues() []TagMetadataTagUnitEnum { + values := make([]TagMetadataTagUnitEnum, 0) + for _, v := range mappingTagMetadataTagUnitEnum { + values = append(values, v) + } + return values +} + +// GetTagMetadataTagUnitEnumStringValues Enumerates the set of values in String for TagMetadataTagUnitEnum +func GetTagMetadataTagUnitEnumStringValues() []string { + return []string{ + "EPOCH_TIME_MS", + "BYTES", + "COUNT", + "DURATION_MS", + "TRACE_STATUS", + "PERCENTAGE", + "NONE", + } +} + +// GetMappingTagMetadataTagUnitEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTagMetadataTagUnitEnum(val string) (TagMetadataTagUnitEnum, bool) { + enum, ok := mappingTagMetadataTagUnitEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apmtraces/trace.go b/apmtraces/trace.go index 6b58492ab8..69722a4876 100644 --- a/apmtraces/trace.go +++ b/apmtraces/trace.go @@ -80,6 +80,9 @@ type Trace struct { // A summary of the spans by service. ServiceSummaries []TraceServiceSummary `mandatory:"false" json:"serviceSummaries"` + // Source of trace (traces, syn_traces). + SourceName TraceSourceNameEnum `mandatory:"false" json:"sourceName,omitempty"` + SpanSummary *TraceSpanSummary `mandatory:"false" json:"spanSummary"` } @@ -93,8 +96,53 @@ func (m Trace) String() string { func (m Trace) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingTraceSourceNameEnum(string(m.SourceName)); !ok && m.SourceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceName: %s. Supported values are: %s.", m.SourceName, strings.Join(GetTraceSourceNameEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } + +// TraceSourceNameEnum Enum with underlying type: string +type TraceSourceNameEnum string + +// Set of constants representing the allowable values for TraceSourceNameEnum +const ( + TraceSourceNameTraces TraceSourceNameEnum = "TRACES" + TraceSourceNameSynTraces TraceSourceNameEnum = "SYN_TRACES" +) + +var mappingTraceSourceNameEnum = map[string]TraceSourceNameEnum{ + "TRACES": TraceSourceNameTraces, + "SYN_TRACES": TraceSourceNameSynTraces, +} + +var mappingTraceSourceNameEnumLowerCase = map[string]TraceSourceNameEnum{ + "traces": TraceSourceNameTraces, + "syn_traces": TraceSourceNameSynTraces, +} + +// GetTraceSourceNameEnumValues Enumerates the set of values for TraceSourceNameEnum +func GetTraceSourceNameEnumValues() []TraceSourceNameEnum { + values := make([]TraceSourceNameEnum, 0) + for _, v := range mappingTraceSourceNameEnum { + values = append(values, v) + } + return values +} + +// GetTraceSourceNameEnumStringValues Enumerates the set of values in String for TraceSourceNameEnum +func GetTraceSourceNameEnumStringValues() []string { + return []string{ + "TRACES", + "SYN_TRACES", + } +} + +// GetMappingTraceSourceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTraceSourceNameEnum(val string) (TraceSourceNameEnum, bool) { + enum, ok := mappingTraceSourceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/common/regions.go b/common/regions.go index a123335c1c..9e507f4c5c 100644 --- a/common/regions.go +++ b/common/regions.go @@ -124,6 +124,8 @@ const ( RegionMEDccDoha1 Region = "me-dcc-doha-1" //RegionEUDccZurich1 region Zurich RegionEUDccZurich1 Region = "eu-dcc-zurich-1" + //RegionMEAbudhabi3 region Abudhabi + RegionMEAbudhabi3 Region = "me-abudhabi-3" ) var shortNameRegion = map[string]Region{ @@ -187,6 +189,7 @@ var shortNameRegion = map[string]Region{ "beg": RegionEUJovanovac1, "doh": RegionMEDccDoha1, "avz": RegionEUDccZurich1, + "ahu": RegionMEAbudhabi3, } var realm = map[string]string{ @@ -202,6 +205,7 @@ var realm = map[string]string{ "oc20": "oraclecloud20.com", "oc21": "oraclecloud21.com", "oc24": "oraclecloud24.com", + "oc26": "oraclecloud26.com", } var regionRealm = map[Region]string{ @@ -276,4 +280,6 @@ var regionRealm = map[Region]string{ RegionMEDccDoha1: "oc21", RegionEUDccZurich1: "oc24", + + RegionMEAbudhabi3: "oc26", } diff --git a/common/regions.json b/common/regions.json index 6351a1d955..1fd384971f 100644 --- a/common/regions.json +++ b/common/regions.json @@ -358,5 +358,11 @@ "realmKey": "oc21", "regionIdentifier": "me-dcc-doha-1", "realmDomainComponent": "oraclecloud21.com" + }, + { + "regionKey": "ahu", + "realmKey": "oc26", + "regionIdentifier": "me-abudhabi-3", + "realmDomainComponent": "oraclecloud26.com" } ] \ No newline at end of file diff --git a/common/version.go b/common/version.go index e3447ddef4..a9f4df693a 100644 --- a/common/version.go +++ b/common/version.go @@ -13,7 +13,7 @@ import ( const ( major = "65" minor = "61" - patch = "1" + patch = "2" tag = "" ) diff --git a/stackmonitoring/discovery_details.go b/stackmonitoring/discovery_details.go index b6556bd5ab..9e0c4ca5ec 100644 --- a/stackmonitoring/discovery_details.go +++ b/stackmonitoring/discovery_details.go @@ -78,6 +78,7 @@ const ( DiscoveryDetailsResourceTypeApacheHttpServer DiscoveryDetailsResourceTypeEnum = "APACHE_HTTP_SERVER" DiscoveryDetailsResourceTypeOracleGoldengate DiscoveryDetailsResourceTypeEnum = "ORACLE_GOLDENGATE" DiscoveryDetailsResourceTypeCustomResource DiscoveryDetailsResourceTypeEnum = "CUSTOM_RESOURCE" + DiscoveryDetailsResourceTypeOracleHttpServer DiscoveryDetailsResourceTypeEnum = "ORACLE_HTTP_SERVER" ) var mappingDiscoveryDetailsResourceTypeEnum = map[string]DiscoveryDetailsResourceTypeEnum{ @@ -95,6 +96,7 @@ var mappingDiscoveryDetailsResourceTypeEnum = map[string]DiscoveryDetailsResourc "APACHE_HTTP_SERVER": DiscoveryDetailsResourceTypeApacheHttpServer, "ORACLE_GOLDENGATE": DiscoveryDetailsResourceTypeOracleGoldengate, "CUSTOM_RESOURCE": DiscoveryDetailsResourceTypeCustomResource, + "ORACLE_HTTP_SERVER": DiscoveryDetailsResourceTypeOracleHttpServer, } var mappingDiscoveryDetailsResourceTypeEnumLowerCase = map[string]DiscoveryDetailsResourceTypeEnum{ @@ -112,6 +114,7 @@ var mappingDiscoveryDetailsResourceTypeEnumLowerCase = map[string]DiscoveryDetai "apache_http_server": DiscoveryDetailsResourceTypeApacheHttpServer, "oracle_goldengate": DiscoveryDetailsResourceTypeOracleGoldengate, "custom_resource": DiscoveryDetailsResourceTypeCustomResource, + "oracle_http_server": DiscoveryDetailsResourceTypeOracleHttpServer, } // GetDiscoveryDetailsResourceTypeEnumValues Enumerates the set of values for DiscoveryDetailsResourceTypeEnum @@ -140,6 +143,7 @@ func GetDiscoveryDetailsResourceTypeEnumStringValues() []string { "APACHE_HTTP_SERVER", "ORACLE_GOLDENGATE", "CUSTOM_RESOURCE", + "ORACLE_HTTP_SERVER", } } diff --git a/stackmonitoring/discovery_job_summary.go b/stackmonitoring/discovery_job_summary.go index 08e627243a..182dbd2c64 100644 --- a/stackmonitoring/discovery_job_summary.go +++ b/stackmonitoring/discovery_job_summary.go @@ -117,6 +117,7 @@ const ( DiscoveryJobSummaryResourceTypeApacheHttpServer DiscoveryJobSummaryResourceTypeEnum = "APACHE_HTTP_SERVER" DiscoveryJobSummaryResourceTypeOracleGoldengate DiscoveryJobSummaryResourceTypeEnum = "ORACLE_GOLDENGATE" DiscoveryJobSummaryResourceTypeCustomResource DiscoveryJobSummaryResourceTypeEnum = "CUSTOM_RESOURCE" + DiscoveryJobSummaryResourceTypeOracleHttpServer DiscoveryJobSummaryResourceTypeEnum = "ORACLE_HTTP_SERVER" ) var mappingDiscoveryJobSummaryResourceTypeEnum = map[string]DiscoveryJobSummaryResourceTypeEnum{ @@ -134,6 +135,7 @@ var mappingDiscoveryJobSummaryResourceTypeEnum = map[string]DiscoveryJobSummaryR "APACHE_HTTP_SERVER": DiscoveryJobSummaryResourceTypeApacheHttpServer, "ORACLE_GOLDENGATE": DiscoveryJobSummaryResourceTypeOracleGoldengate, "CUSTOM_RESOURCE": DiscoveryJobSummaryResourceTypeCustomResource, + "ORACLE_HTTP_SERVER": DiscoveryJobSummaryResourceTypeOracleHttpServer, } var mappingDiscoveryJobSummaryResourceTypeEnumLowerCase = map[string]DiscoveryJobSummaryResourceTypeEnum{ @@ -151,6 +153,7 @@ var mappingDiscoveryJobSummaryResourceTypeEnumLowerCase = map[string]DiscoveryJo "apache_http_server": DiscoveryJobSummaryResourceTypeApacheHttpServer, "oracle_goldengate": DiscoveryJobSummaryResourceTypeOracleGoldengate, "custom_resource": DiscoveryJobSummaryResourceTypeCustomResource, + "oracle_http_server": DiscoveryJobSummaryResourceTypeOracleHttpServer, } // GetDiscoveryJobSummaryResourceTypeEnumValues Enumerates the set of values for DiscoveryJobSummaryResourceTypeEnum @@ -179,6 +182,7 @@ func GetDiscoveryJobSummaryResourceTypeEnumStringValues() []string { "APACHE_HTTP_SERVER", "ORACLE_GOLDENGATE", "CUSTOM_RESOURCE", + "ORACLE_HTTP_SERVER", } } diff --git a/stackmonitoring/stackmonitoring_client.go b/stackmonitoring/stackmonitoring_client.go index 988eafc514..e0d12b5ecc 100644 --- a/stackmonitoring/stackmonitoring_client.go +++ b/stackmonitoring/stackmonitoring_client.go @@ -531,7 +531,7 @@ func (client StackMonitoringClient) createBaselineableMetric(ctx context.Context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/CreateBaselineableMetricDetails/CreateBaselineableMetric" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/BaselineableMetric/CreateBaselineableMetric" err = common.PostProcessServiceError(err, "StackMonitoring", "CreateBaselineableMetric", apiReferenceLink) return response, err } @@ -1694,7 +1694,7 @@ func (client StackMonitoringClient) evaluateBaselineableMetric(ctx context.Conte defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/EvaluateBaselineableMetricResult/EvaluateBaselineableMetric" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/BaselineableMetric/EvaluateBaselineableMetric" err = common.PostProcessServiceError(err, "StackMonitoring", "EvaluateBaselineableMetric", apiReferenceLink) return response, err } @@ -2337,7 +2337,7 @@ func (client StackMonitoringClient) listBaselineableMetrics(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/BaselineableMetricSummary/ListBaselineableMetrics" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/BaselineableMetric/ListBaselineableMetrics" err = common.PostProcessServiceError(err, "StackMonitoring", "ListBaselineableMetrics", apiReferenceLink) return response, err } @@ -3606,7 +3606,7 @@ func (client StackMonitoringClient) updateBaselineableMetric(ctx context.Context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/UpdateBaselineableMetricDetails/UpdateBaselineableMetric" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/BaselineableMetric/UpdateBaselineableMetric" err = common.PostProcessServiceError(err, "StackMonitoring", "UpdateBaselineableMetric", apiReferenceLink) return response, err }