diff --git a/CHANGELOG.md b/CHANGELOG.md index 41bc4dfd83..7733715ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.78.0 - 2024-11-05 +### Added +- Support for calling Oracle Cloud Infrastructure services in the `ap-seoul-2` region +- Support for calling Oracle Cloud Infrastructure services in the `ap-suwon-1` region +- Support for calling Oracle Cloud Infrastructure services in the `ap-chuncheon-2` region +- Support for MFA Enablement v2 in the Identity Domains service +- Support for starting, stopping and updating min/max executor count for SQL Endpoints in the Data Flow service +- Support for customer message in the Customer Incident Management Service +- Support for REJECTED limitStatus in the Customer Incident Management Service + +### Breaking Changes +- The retry strategy for getting the X509 token from Identity service was modified and is now protected via circuit breaker +- The operations `GetCsiNumber` and `GetStatus` were removed from the `IncidentClient` in the Customer Incident Management Service +- The property `ServiceCategories` was removed from the model `IncidentResourceType` in the Customer Incident Management Service +- The properties `ServiceCategory` and `IssueType` were removed from the model `ServiceCategories` in the Customer Incident Management Service +- The property `ItemKey` was made mandatory in the model `AccountItem` in the Customer Incident Management Service + ## 65.77.1 - 2024-10-29 ### Added - Support for L3IP (Layer 3 IP) listeners in the Network Load Balancing service diff --git a/cims/account_item.go b/cims/account_item.go index 19c037ac2b..5115ed9548 100644 --- a/cims/account_item.go +++ b/cims/account_item.go @@ -24,7 +24,7 @@ import ( type AccountItem struct { // Unique identifier for the item. - ItemKey *string `mandatory:"true" json:"itemKey"` + ItemKey *string `mandatory:"false" json:"itemKey"` // The display name of the item. Avoid entering confidential information. Name *string `mandatory:"false" json:"name"` diff --git a/cims/activity_item.go b/cims/activity_item.go index eb6adf8981..f0e1eea4bc 100644 --- a/cims/activity_item.go +++ b/cims/activity_item.go @@ -23,18 +23,18 @@ import ( // ActivityItem Details about the ActivityItem object. type ActivityItem struct { - // Unique identifier for the item. - ItemKey *string `mandatory:"true" json:"itemKey"` - // Comments added with the activity on the support ticket. Comments *string `mandatory:"true" json:"comments"` - // The time when the activity was created, in milliseconds since epoch time. + // The time when the activity was created, in seconds since epoch time. TimeCreated *int `mandatory:"true" json:"timeCreated"` - // The time when the activity was updated, in milliseconds since epoch time. + // The time when the activity was updated, in seconds since epoch time. TimeUpdated *int `mandatory:"true" json:"timeUpdated"` + // Unique identifier for the item. + ItemKey *string `mandatory:"false" json:"itemKey"` + // The display name of the item. Avoid entering confidential information. Name *string `mandatory:"false" json:"name"` @@ -44,6 +44,9 @@ type ActivityItem struct { IssueType *IssueType `mandatory:"false" json:"issueType"` + // attachmentID for the ItemType Attachments only for Alloy realm. + AttachmentID *string `mandatory:"false" json:"attachmentID"` + // The type of activity occuring on the support ticket. ActivityType ActivityItemActivityTypeEnum `mandatory:"true" json:"activityType"` diff --git a/cims/cims_incident_client.go b/cims/cims_incident_client.go index 8ff63d022d..0bfda94870 100644 --- a/cims/cims_incident_client.go +++ b/cims/cims_incident_client.go @@ -95,7 +95,8 @@ func (client *IncidentClient) ConfigurationProvider() *common.ConfigurationProvi return client.config } -// CreateIncident Operation to create a support ticket. +// CreateIncident Creates a support ticket in the specified tenancy. +// For more information, see Creating Support Requests (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident.htm). // // # See also // @@ -152,64 +153,8 @@ func (client IncidentClient) createIncident(ctx context.Context, request common. return response, err } -// GetCsiNumber Fetches csi number of the user. -// -// # See also -// -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/cims/GetCsiNumber.go.html to see an example of how to use GetCsiNumber API. -func (client IncidentClient) GetCsiNumber(ctx context.Context, request GetCsiNumberRequest) (response GetCsiNumberResponse, 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.getCsiNumber, policy) - if err != nil { - if ociResponse != nil { - if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { - opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetCsiNumberResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} - } else { - response = GetCsiNumberResponse{} - } - } - return - } - if convertedResponse, ok := ociResponse.(GetCsiNumberResponse); ok { - response = convertedResponse - } else { - err = fmt.Errorf("failed to convert OCIResponse into GetCsiNumberResponse") - } - return -} - -// getCsiNumber implements the OCIOperation interface (enables retrying operations) -func (client IncidentClient) getCsiNumber(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - - httpRequest, err := request.HTTPRequest(http.MethodGet, "/v2/incidents/getCsiNumber", binaryReqBody, extraHeaders) - if err != nil { - return nil, err - } - - var response GetCsiNumberResponse - var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse - if err != nil { - apiReferenceLink := "" - err = common.PostProcessServiceError(err, "Incident", "GetCsiNumber", apiReferenceLink) - return response, err - } - - err = common.UnmarshalResponse(httpResponse, &response) - return response, err -} - -// GetIncident Gets details about the specified support ticket. +// GetIncident Gets the specified support ticket. +// For more information, see Getting Details for a Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/get-incident.htm). // // # See also // @@ -266,64 +211,14 @@ func (client IncidentClient) getIncident(ctx context.Context, request common.OCI return response, err } -// GetStatus Gets the status of the service. -// -// # See also -// -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/cims/GetStatus.go.html to see an example of how to use GetStatus API. -func (client IncidentClient) GetStatus(ctx context.Context, request GetStatusRequest) (response GetStatusResponse, 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.getStatus, policy) - if err != nil { - if ociResponse != nil { - if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { - opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetStatusResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} - } else { - response = GetStatusResponse{} - } - } - return - } - if convertedResponse, ok := ociResponse.(GetStatusResponse); ok { - response = convertedResponse - } else { - err = fmt.Errorf("failed to convert OCIResponse into GetStatusResponse") - } - return -} - -// getStatus implements the OCIOperation interface (enables retrying operations) -func (client IncidentClient) getStatus(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - - httpRequest, err := request.HTTPRequest(http.MethodGet, "/v2/incidents/status", binaryReqBody, extraHeaders) - if err != nil { - return nil, err - } - - var response GetStatusResponse - 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/incidentmanagement/20181231/Status/GetStatus" - err = common.PostProcessServiceError(err, "Incident", "GetStatus", apiReferenceLink) - return response, err - } - - err = common.UnmarshalResponse(httpResponse, &response) - return response, err -} - -// ListIncidentResourceTypes During support ticket creation, returns the list of all possible products that Oracle Cloud Infrastructure supports. +// ListIncidentResourceTypes Depending on the selected `productType`, either +// lists available products (service groups, services, service categories, and subcategories) for technical support tickets or +// lists limits and current usage for limit increase tickets. +// This operation is called during creation of technical support and limit increase tickets. +// For more information about listing products, see +// Listing Products for Support Requests (https://docs.cloud.oracle.com/iaas/Content/GSG/support/list-incident-resource-types-taxonomy.htm). +// For more information about listing limits, see +// Listing Limits for Service Limit Increase Requests (https://docs.cloud.oracle.com/iaas/Content/GSG/support/list-incident-resource-types-limit.htm). // // # See also // @@ -380,7 +275,8 @@ func (client IncidentClient) listIncidentResourceTypes(ctx context.Context, requ return response, err } -// ListIncidents Returns the list of support tickets raised by the tenancy. +// ListIncidents Lists support tickets for the specified tenancy. +// For more information, see Listing Support Requests (https://docs.cloud.oracle.com/iaas/Content/GSG/support/list-incidents.htm). // // # See also // @@ -437,7 +333,8 @@ func (client IncidentClient) listIncidents(ctx context.Context, request common.O return response, err } -// UpdateIncident Updates the specified support ticket's information. +// UpdateIncident Updates the specified support ticket. +// For more information, see Updating Support Requests (https://docs.cloud.oracle.com/iaas/Content/GSG/support/update-incident.htm). // // # See also // @@ -495,6 +392,7 @@ func (client IncidentClient) updateIncident(ctx context.Context, request common. } // ValidateUser Checks whether the requested user is valid. +// For more information, see Validating a User (https://docs.cloud.oracle.com/iaas/Content/GSG/support/validate-user.htm). // // # See also // diff --git a/cims/create_account_item_details.go b/cims/create_account_item_details.go index ac895bd0d9..0e880bfd8c 100644 --- a/cims/create_account_item_details.go +++ b/cims/create_account_item_details.go @@ -21,6 +21,7 @@ import ( ) // CreateAccountItemDetails Details about the issue that the account support ticket relates to. Avoid entering confidential information. +// For information about `ACCOUNT` support tickets, see Creating a Billing Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-billing.htm). type CreateAccountItemDetails struct { Category *CreateCategoryDetails `mandatory:"false" json:"category"` diff --git a/cims/create_incident.go b/cims/create_incident.go index 72bc4f16d6..3b83cbd283 100644 --- a/cims/create_incident.go +++ b/cims/create_incident.go @@ -27,7 +27,13 @@ type CreateIncident struct { Ticket *CreateTicketDetails `mandatory:"true" json:"ticket"` - // The kind of support ticket, such as a technical support request or a limit increase request. + // The kind of support ticket (type of support request). + // For information about `ACCOUNT` support tickets, see + // Creating a Billing Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-billing.htm). + // For information about `LIMIT` support tickets, see + // Creating a Service Limit Increase Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-limit.htm). + // For information about `TECH` support tickets, see + // Creating a Technical Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-technical.htm). ProblemType ProblemTypeEnum `mandatory:"true" json:"problemType"` // The Customer Support Identifier (CSI) number associated with the support account. diff --git a/cims/create_incident_request_response.go b/cims/create_incident_request_response.go index f5014a3a02..0ae392a89c 100644 --- a/cims/create_incident_request_response.go +++ b/cims/create_incident_request_response.go @@ -25,6 +25,7 @@ type CreateIncidentRequest struct { OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account. + // User OCID is mandatory for OCI Users and optional for Multicloud users. Ocid *string `mandatory:"false" contributesTo:"header" name:"ocid"` // The region of the tenancy. @@ -40,6 +41,7 @@ type CreateIncidentRequest struct { Idtoken *string `mandatory:"false" contributesTo:"header" name:"idtoken"` // The OCID of identity domain. + // DomainID is mandatory if the user is part of Non Default Identity domain. Domainid *string `mandatory:"false" contributesTo:"header" name:"domainid"` // Metadata about the request. This information will not be transmitted to the service, but diff --git a/cims/create_limit_item_details.go b/cims/create_limit_item_details.go index 32b5f6a14c..cac94c8ec1 100644 --- a/cims/create_limit_item_details.go +++ b/cims/create_limit_item_details.go @@ -21,6 +21,7 @@ import ( ) // CreateLimitItemDetails Details about the service limit increase request. Avoid entering confidential information. +// For information about `LIMIT` support tickets, see Creating a Service Limit Increase Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-limit.htm). type CreateLimitItemDetails struct { Category *CreateCategoryDetails `mandatory:"false" json:"category"` @@ -105,18 +106,21 @@ const ( CreateLimitItemDetailsLimitStatusApproved CreateLimitItemDetailsLimitStatusEnum = "APPROVED" CreateLimitItemDetailsLimitStatusPartiallyApproved CreateLimitItemDetailsLimitStatusEnum = "PARTIALLY_APPROVED" CreateLimitItemDetailsLimitStatusNotApproved CreateLimitItemDetailsLimitStatusEnum = "NOT_APPROVED" + CreateLimitItemDetailsLimitStatusRejected CreateLimitItemDetailsLimitStatusEnum = "REJECTED" ) var mappingCreateLimitItemDetailsLimitStatusEnum = map[string]CreateLimitItemDetailsLimitStatusEnum{ "APPROVED": CreateLimitItemDetailsLimitStatusApproved, "PARTIALLY_APPROVED": CreateLimitItemDetailsLimitStatusPartiallyApproved, "NOT_APPROVED": CreateLimitItemDetailsLimitStatusNotApproved, + "REJECTED": CreateLimitItemDetailsLimitStatusRejected, } var mappingCreateLimitItemDetailsLimitStatusEnumLowerCase = map[string]CreateLimitItemDetailsLimitStatusEnum{ "approved": CreateLimitItemDetailsLimitStatusApproved, "partially_approved": CreateLimitItemDetailsLimitStatusPartiallyApproved, "not_approved": CreateLimitItemDetailsLimitStatusNotApproved, + "rejected": CreateLimitItemDetailsLimitStatusRejected, } // GetCreateLimitItemDetailsLimitStatusEnumValues Enumerates the set of values for CreateLimitItemDetailsLimitStatusEnum @@ -134,6 +138,7 @@ func GetCreateLimitItemDetailsLimitStatusEnumStringValues() []string { "APPROVED", "PARTIALLY_APPROVED", "NOT_APPROVED", + "REJECTED", } } diff --git a/cims/create_tech_support_item_details.go b/cims/create_tech_support_item_details.go index 9f863f35de..3129bbccd0 100644 --- a/cims/create_tech_support_item_details.go +++ b/cims/create_tech_support_item_details.go @@ -21,6 +21,7 @@ import ( ) // CreateTechSupportItemDetails Details about the issue that the technical support ticket relates to. Avoid entering confidential information. +// For information about `TECH` support tickets, see Creating a Technical Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-technical.htm). type CreateTechSupportItemDetails struct { Category *CreateCategoryDetails `mandatory:"false" json:"category"` diff --git a/cims/create_user_details.go b/cims/create_user_details.go index 3a07afa865..5358fa15e7 100644 --- a/cims/create_user_details.go +++ b/cims/create_user_details.go @@ -43,7 +43,13 @@ type CreateUserDetails struct { // Organization of the user. OrganizationName *string `mandatory:"true" json:"organizationName"` - // The kind of support ticket, such as a technical support request or a limit increase request. + // The kind of support ticket (type of support request). + // For information about `ACCOUNT` support tickets, see + // Creating a Billing Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-billing.htm). + // For information about `LIMIT` support tickets, see + // Creating a Service Limit Increase Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-limit.htm). + // For information about `TECH` support tickets, see + // Creating a Technical Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-technical.htm). ProblemType ProblemTypeEnum `mandatory:"true" json:"problemType"` } diff --git a/cims/get_incident_request_response.go b/cims/get_incident_request_response.go index aae820da33..f2d04cdc4f 100644 --- a/cims/get_incident_request_response.go +++ b/cims/get_incident_request_response.go @@ -21,21 +21,23 @@ type GetIncidentRequest struct { // Unique identifier for the support ticket. IncidentKey *string `mandatory:"true" contributesTo:"path" name:"incidentKey"` + // The OCID of the tenancy. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The Customer Support Identifier (CSI) associated with the support account. + // The Customer Support Identifier (CSI) number associated with the support account. + // The CSI is required for technical support tickets and optional for limits and billing tickets. Csi *string `mandatory:"false" contributesTo:"header" name:"csi"` // User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account. + // User OCID is mandatory for OCI Users and optional for Multicloud users. Ocid *string `mandatory:"false" contributesTo:"header" name:"ocid"` // The region of the tenancy. Homeregion *string `mandatory:"false" contributesTo:"header" name:"homeregion"` - // The OCID of the tenancy. - CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` - // The kind of support request. Problemtype *string `mandatory:"false" contributesTo:"header" name:"problemtype"` @@ -49,6 +51,7 @@ type GetIncidentRequest struct { Idtoken *string `mandatory:"false" contributesTo:"header" name:"idtoken"` // The OCID of identity domain. + // DomainID is mandatory if the user is part of Non Default Identity domain. Domainid *string `mandatory:"false" contributesTo:"header" name:"domainid"` // Metadata about the request. This information will not be transmitted to the service, but diff --git a/cims/incident.go b/cims/incident.go index 39ecd92fde..d291cccb26 100644 --- a/cims/incident.go +++ b/cims/incident.go @@ -36,7 +36,13 @@ type Incident struct { IncidentType *IncidentType `mandatory:"false" json:"incidentType"` - // The kind of support ticket, such as a technical support request or a limit increase request. + // The kind of support ticket (type of support request). + // For information about `ACCOUNT` support tickets, see + // Creating a Billing Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-billing.htm). + // For information about `LIMIT` support tickets, see + // Creating a Service Limit Increase Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-limit.htm). + // For information about `TECH` support tickets, see + // Creating a Technical Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-technical.htm). ProblemType ProblemTypeEnum `mandatory:"false" json:"problemType,omitempty"` // The incident referrer. This value is often the URL that the customer used when creating the support ticket. diff --git a/cims/incident_resource_type.go b/cims/incident_resource_type.go index 2dfde534e3..4996d7e531 100644 --- a/cims/incident_resource_type.go +++ b/cims/incident_resource_type.go @@ -34,6 +34,9 @@ type IncidentResourceType struct { // The description of the resource. Description *string `mandatory:"false" json:"description"` + // Indicates whether multi-subscription is supported + IsSubscriptionsSupported *bool `mandatory:"false" json:"isSubscriptionsSupported"` + // The service category list. ServiceCategoryList []ServiceCategory `mandatory:"false" json:"serviceCategoryList"` @@ -41,7 +44,7 @@ type IncidentResourceType struct { Service map[string]string `mandatory:"false" json:"service"` // The service categories list for MOS Taxonomy. - ServiceCategories []ServiceCategories `mandatory:"false" json:"serviceCategories"` + Services []ServiceCategories `mandatory:"false" json:"services"` } func (m IncidentResourceType) String() string { diff --git a/cims/incident_summary.go b/cims/incident_summary.go index 646ddc6888..0532580dd9 100644 --- a/cims/incident_summary.go +++ b/cims/incident_summary.go @@ -25,7 +25,13 @@ type IncidentSummary struct { // Unique identifier of the incident. Key *string `mandatory:"true" json:"key"` - // The kind of support ticket, such as a technical support request or a limit increase request. + // The kind of support ticket (type of support request). + // For information about `ACCOUNT` support tickets, see + // Creating a Billing Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-billing.htm). + // For information about `LIMIT` support tickets, see + // Creating a Service Limit Increase Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-limit.htm). + // For information about `TECH` support tickets, see + // Creating a Technical Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-technical.htm). ProblemType ProblemTypeEnum `mandatory:"true" json:"problemType"` // The OCID of the tenancy. diff --git a/cims/item.go b/cims/item.go index 0e97a1a7bb..3d850d5ac0 100644 --- a/cims/item.go +++ b/cims/item.go @@ -38,11 +38,11 @@ type Item interface { type item struct { JsonData []byte + ItemKey *string `mandatory:"false" json:"itemKey"` Name *string `mandatory:"false" json:"name"` Category *Category `mandatory:"false" json:"category"` SubCategory *SubCategory `mandatory:"false" json:"subCategory"` IssueType *IssueType `mandatory:"false" json:"issueType"` - ItemKey *string `mandatory:"true" json:"itemKey"` Type string `json:"type"` } @@ -98,6 +98,11 @@ func (m *item) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { } } +// GetItemKey returns ItemKey +func (m item) GetItemKey() *string { + return m.ItemKey +} + // GetName returns Name func (m item) GetName() *string { return m.Name @@ -118,11 +123,6 @@ func (m item) GetIssueType() *IssueType { return m.IssueType } -// GetItemKey returns ItemKey -func (m item) GetItemKey() *string { - return m.ItemKey -} - func (m item) String() string { return common.PointerString(m) } diff --git a/cims/limit_item.go b/cims/limit_item.go index 3b0cd3a0ab..752e789a3b 100644 --- a/cims/limit_item.go +++ b/cims/limit_item.go @@ -24,7 +24,7 @@ import ( type LimitItem struct { // Unique identifier for the item. - ItemKey *string `mandatory:"true" json:"itemKey"` + ItemKey *string `mandatory:"false" json:"itemKey"` // The display name of the item. Avoid entering confidential information. Name *string `mandatory:"false" json:"name"` @@ -44,6 +44,9 @@ type LimitItem struct { // The new service limit being requested for the resource. RequestedLimit *int `mandatory:"false" json:"requestedLimit"` + // Message to customer for partial approval and rejected limit requests + CustomerMessage *string `mandatory:"false" json:"customerMessage"` + // The status of the request. LimitStatus LimitItemLimitStatusEnum `mandatory:"false" json:"limitStatus,omitempty"` } @@ -114,18 +117,21 @@ const ( LimitItemLimitStatusApproved LimitItemLimitStatusEnum = "APPROVED" LimitItemLimitStatusPartiallyApproved LimitItemLimitStatusEnum = "PARTIALLY_APPROVED" LimitItemLimitStatusNotApproved LimitItemLimitStatusEnum = "NOT_APPROVED" + LimitItemLimitStatusRejected LimitItemLimitStatusEnum = "REJECTED" ) var mappingLimitItemLimitStatusEnum = map[string]LimitItemLimitStatusEnum{ "APPROVED": LimitItemLimitStatusApproved, "PARTIALLY_APPROVED": LimitItemLimitStatusPartiallyApproved, "NOT_APPROVED": LimitItemLimitStatusNotApproved, + "REJECTED": LimitItemLimitStatusRejected, } var mappingLimitItemLimitStatusEnumLowerCase = map[string]LimitItemLimitStatusEnum{ "approved": LimitItemLimitStatusApproved, "partially_approved": LimitItemLimitStatusPartiallyApproved, "not_approved": LimitItemLimitStatusNotApproved, + "rejected": LimitItemLimitStatusRejected, } // GetLimitItemLimitStatusEnumValues Enumerates the set of values for LimitItemLimitStatusEnum @@ -143,6 +149,7 @@ func GetLimitItemLimitStatusEnumStringValues() []string { "APPROVED", "PARTIALLY_APPROVED", "NOT_APPROVED", + "REJECTED", } } diff --git a/cims/list_incident_resource_types_request_response.go b/cims/list_incident_resource_types_request_response.go index 031a475438..d6a562d66c 100644 --- a/cims/list_incident_resource_types_request_response.go +++ b/cims/list_incident_resource_types_request_response.go @@ -42,16 +42,19 @@ type ListIncidentResourceTypesRequest struct { // The user-friendly name of the support ticket type. Name *string `mandatory:"false" contributesTo:"query" name:"name"` - // The Customer Support Identifier (CSI) associated with the support account. + // The Customer Support Identifier (CSI) number associated with the support account. + // The CSI is required for technical support tickets and optional for limits and billing tickets. Csi *string `mandatory:"false" contributesTo:"header" name:"csi"` // User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account. + // User OCID is mandatory for OCI Users and optional for Multicloud users. Ocid *string `mandatory:"false" contributesTo:"header" name:"ocid"` // The region of the tenancy. Homeregion *string `mandatory:"false" contributesTo:"header" name:"homeregion"` // The OCID of identity domain. + // DomainID is mandatory if the user is part of Non Default Identity domain. Domainid *string `mandatory:"false" contributesTo:"header" name:"domainid"` // Metadata about the request. This information will not be transmitted to the service, but diff --git a/cims/list_incidents_request_response.go b/cims/list_incidents_request_response.go index 936f9423b0..39873521ff 100644 --- a/cims/list_incidents_request_response.go +++ b/cims/list_incidents_request_response.go @@ -21,7 +21,8 @@ type ListIncidentsRequest struct { // The OCID of the tenancy. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The Customer Support Identifier (CSI) associated with the support account. + // The Customer Support Identifier (CSI) number associated with the support account. + // The CSI is required for technical support tickets and optional for limits and billing tickets. Csi *string `mandatory:"false" contributesTo:"header" name:"csi"` // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). @@ -43,6 +44,7 @@ type ListIncidentsRequest struct { OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account. + // User OCID is mandatory for OCI Users and optional for Multicloud users. Ocid *string `mandatory:"false" contributesTo:"header" name:"ocid"` // The region of the tenancy. @@ -61,6 +63,7 @@ type ListIncidentsRequest struct { Idtoken *string `mandatory:"false" contributesTo:"header" name:"idtoken"` // The OCID of identity domain. + // DomainID is mandatory if the user is part of Non Default Identity domain. Domainid *string `mandatory:"false" contributesTo:"header" name:"domainid"` // Metadata about the request. This information will not be transmitted to the service, but diff --git a/cims/service_categories.go b/cims/service_categories.go index ae2c391e1e..67e0547114 100644 --- a/cims/service_categories.go +++ b/cims/service_categories.go @@ -23,13 +23,13 @@ import ( type ServiceCategories struct { // Service Category list. - ServiceCategory map[string]string `mandatory:"false" json:"serviceCategory"` + Service map[string]string `mandatory:"false" json:"service"` // Schema of a Service Category. Schema *string `mandatory:"false" json:"schema"` - // Issue type list. - IssueType map[string]string `mandatory:"false" json:"issueType"` + // The service categories list for MOS Taxonomy. + SubCategories []SubCategories `mandatory:"false" json:"subCategories"` } func (m ServiceCategories) String() string { diff --git a/cims/service_category.go b/cims/service_category.go index 0c269de897..22a7522af2 100644 --- a/cims/service_category.go +++ b/cims/service_category.go @@ -37,6 +37,9 @@ type ServiceCategory struct { // The list of issues. IssueTypeList []IssueType `mandatory:"false" json:"issueTypeList"` + // List of supported subscriptions + SupportedSubscriptions []string `mandatory:"false" json:"supportedSubscriptions"` + // The scope of the incident. Scope ScopeEnum `mandatory:"false" json:"scope,omitempty"` diff --git a/cims/sub_categories.go b/cims/sub_categories.go new file mode 100644 index 0000000000..d752af2ea1 --- /dev/null +++ b/cims/sub_categories.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Support Management API +// +// Use the Support Management API to manage support requests. +// For more information, see Getting Help and Contacting Support (https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/contactingsupport.htm). +// **Note**: Before you can create service requests with this API, +// you need to have an Oracle Single Sign On (SSO) account, +// and you need to register your Customer Support Identifier (CSI) with My Oracle Support. +// + +package cims + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SubCategories List of subcategories under a service. +type SubCategories struct { + + // Subcategory list. + ServiceCategory map[string]string `mandatory:"false" json:"serviceCategory"` + + // Schema of a subcategory. + Schema *string `mandatory:"false" json:"schema"` + + // Flag to identify if subComponent is present + HasSubCategory *string `mandatory:"false" json:"hasSubCategory"` + + // The sub component list for MOS Taxonomy. + SubComponents []SubComponents `mandatory:"false" json:"subComponents"` +} + +func (m SubCategories) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SubCategories) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/cims/sub_components.go b/cims/sub_components.go new file mode 100644 index 0000000000..cfc46f5328 --- /dev/null +++ b/cims/sub_components.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Support Management API +// +// Use the Support Management API to manage support requests. +// For more information, see Getting Help and Contacting Support (https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/contactingsupport.htm). +// **Note**: Before you can create service requests with this API, +// you need to have an Oracle Single Sign On (SSO) account, +// and you need to register your Customer Support Identifier (CSI) with My Oracle Support. +// + +package cims + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SubComponents List of subcomponents under a subcategory. +type SubComponents struct { + + // Subcategory list. + SubCategory map[string]string `mandatory:"false" json:"subCategory"` + + // Schema of a subcategory. + Schema *string `mandatory:"false" json:"schema"` +} + +func (m SubComponents) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SubComponents) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/cims/subscription_info.go b/cims/subscription_info.go new file mode 100644 index 0000000000..538f679883 --- /dev/null +++ b/cims/subscription_info.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Support Management API +// +// Use the Support Management API to manage support requests. +// For more information, see Getting Help and Contacting Support (https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/contactingsupport.htm). +// **Note**: Before you can create service requests with this API, +// you need to have an Oracle Single Sign On (SSO) account, +// and you need to register your Customer Support Identifier (CSI) with My Oracle Support. +// + +package cims + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SubscriptionInfo The representation of SubscriptionInfo +type SubscriptionInfo struct { + + // customer support identifier issued for a subscription + Csi *string `mandatory:"false" json:"csi"` + + // subscription type of customer which determines payment profile + SubscriptionType *string `mandatory:"false" json:"subscriptionType"` +} + +func (m SubscriptionInfo) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SubscriptionInfo) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/cims/tech_support_item.go b/cims/tech_support_item.go index cb4c1aa441..e48ea12a7a 100644 --- a/cims/tech_support_item.go +++ b/cims/tech_support_item.go @@ -24,7 +24,7 @@ import ( type TechSupportItem struct { // Unique identifier for the item. - ItemKey *string `mandatory:"true" json:"itemKey"` + ItemKey *string `mandatory:"false" json:"itemKey"` // The display name of the item. Avoid entering confidential information. Name *string `mandatory:"false" json:"name"` diff --git a/cims/ticket.go b/cims/ticket.go index e549b4b13b..28925ab819 100644 --- a/cims/ticket.go +++ b/cims/ticket.go @@ -37,10 +37,10 @@ type Ticket struct { // The list of resources associated with the ticket. ResourceList []Resource `mandatory:"false" json:"resourceList"` - // The time when the ticket was created, in milliseconds since epoch time. + // The time when the ticket was created, in seconds since epoch time. TimeCreated *int `mandatory:"false" json:"timeCreated"` - // The time when the ticket was updated, in milliseconds since epoch time. + // The time when the ticket was updated, in seconds since epoch time. TimeUpdated *int `mandatory:"false" json:"timeUpdated"` // The current state of the ticket. diff --git a/cims/update_incident.go b/cims/update_incident.go index b6cd74bbca..9a5c24e549 100644 --- a/cims/update_incident.go +++ b/cims/update_incident.go @@ -23,7 +23,13 @@ import ( type UpdateIncident struct { Ticket *UpdateTicketDetails `mandatory:"true" json:"ticket"` - // The kind of support ticket, such as a technical support request or a limit increase request. + // The kind of support ticket (type of support request). + // For information about `ACCOUNT` support tickets, see + // Creating a Billing Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-billing.htm). + // For information about `LIMIT` support tickets, see + // Creating a Service Limit Increase Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-limit.htm). + // For information about `TECH` support tickets, see + // Creating a Technical Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-technical.htm). ProblemType ProblemTypeEnum `mandatory:"false" json:"problemType,omitempty"` } diff --git a/cims/update_incident_request_response.go b/cims/update_incident_request_response.go index 255c211faf..df030fef5f 100644 --- a/cims/update_incident_request_response.go +++ b/cims/update_incident_request_response.go @@ -24,19 +24,21 @@ type UpdateIncidentRequest struct { // Details about the support ticket being updated. UpdateIncidentDetails UpdateIncident `contributesTo:"body"` - // The Customer Support Identifier (CSI) associated with the support account. + // The OCID of the tenancy. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The Customer Support Identifier (CSI) number associated with the support account. + // The CSI is required for technical support tickets and optional for limits and billing tickets. Csi *string `mandatory:"false" contributesTo:"header" name:"csi"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The OCID of the tenancy. - CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` - // 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"` // User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account. + // User OCID is mandatory for OCI Users and optional for Multicloud users. Ocid *string `mandatory:"false" contributesTo:"header" name:"ocid"` // The region of the tenancy. @@ -52,6 +54,7 @@ type UpdateIncidentRequest struct { Idtoken *string `mandatory:"false" contributesTo:"header" name:"idtoken"` // The OCID of identity domain. + // DomainID is mandatory if the user is part of Non Default Identity domain. Domainid *string `mandatory:"false" contributesTo:"header" name:"domainid"` // Metadata about the request. This information will not be transmitted to the service, but diff --git a/cims/user.go b/cims/user.go index 394ed2e9dd..2c08601f8e 100644 --- a/cims/user.go +++ b/cims/user.go @@ -52,7 +52,13 @@ type User struct { // The email of the contact person. ContactEmail *string `mandatory:"false" json:"contactEmail"` - // The kind of support ticket, such as a technical support request or a limit increase request. + // The kind of support ticket (type of support request). + // For information about `ACCOUNT` support tickets, see + // Creating a Billing Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-billing.htm). + // For information about `LIMIT` support tickets, see + // Creating a Service Limit Increase Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-limit.htm). + // For information about `TECH` support tickets, see + // Creating a Technical Support Request (https://docs.cloud.oracle.com/iaas/Content/GSG/support/create-incident-technical.htm). ProblemType ProblemTypeEnum `mandatory:"false" json:"problemType,omitempty"` } diff --git a/cims/validate_user_request_response.go b/cims/validate_user_request_response.go index 15fae2445b..d0d539aa89 100644 --- a/cims/validate_user_request_response.go +++ b/cims/validate_user_request_response.go @@ -18,7 +18,8 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/cims/ValidateUser.go.html to see an example of how to use ValidateUserRequest. type ValidateUserRequest struct { - // The Customer Support Identifier (CSI) associated with the support account. + // The Customer Support Identifier (CSI) number associated with the support account. + // The CSI is required for technical support tickets and optional for limits and billing tickets. Csi *string `mandatory:"false" contributesTo:"header" name:"csi"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. @@ -28,6 +29,7 @@ type ValidateUserRequest struct { ProblemType ValidateUserProblemTypeEnum `mandatory:"false" contributesTo:"query" name:"problemType" omitEmpty:"true"` // User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account. + // User OCID is mandatory for OCI Users and optional for Multicloud users. Ocid *string `mandatory:"false" contributesTo:"header" name:"ocid"` // The region of the tenancy. @@ -43,6 +45,7 @@ type ValidateUserRequest struct { Idtoken *string `mandatory:"false" contributesTo:"header" name:"idtoken"` // The OCID of identity domain. + // DomainID is mandatory if the user is part of Non Default Identity domain. Domainid *string `mandatory:"false" contributesTo:"header" name:"domainid"` // Metadata about the request. This information will not be transmitted to the service, but diff --git a/common/auth/federation_client.go b/common/auth/federation_client.go index dbb74c6c00..e3805e3931 100644 --- a/common/auth/federation_client.go +++ b/common/auth/federation_client.go @@ -203,6 +203,13 @@ func newAuthClient(region common.Region, provider common.KeyProvider) *common.Ba client.Host = region.Endpoint("auth") } client.BasePath = "v1/x509" + + if common.GlobalAuthClientCircuitBreakerSetting != nil { + client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.GlobalAuthClientCircuitBreakerSetting) + } else if !common.IsEnvVarFalse("OCI_SDK_AUTH_CLIENT_CIRCUIT_BREAKER_ENABLED") { + common.Logf("Configuring DefaultAuthClientCircuitBreakerSetting for federation client") + client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultAuthClientCircuitBreakerSetting()) + } return &client } @@ -288,7 +295,7 @@ func (c *x509FederationClient) getSecurityToken() (securityToken, error) { var httpResponse *http.Response defer common.CloseBodyIfValid(httpResponse) - for retry := 0; retry < 5; retry++ { + for retry := 0; retry < 3; retry++ { request := c.makeX509FederationRequest() if httpRequest, err = common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "", request); err != nil { @@ -298,7 +305,10 @@ func (c *x509FederationClient) getSecurityToken() (securityToken, error) { if httpResponse, err = c.authClient.Call(context.Background(), &httpRequest); err == nil { break } - + // Don't retry on 4xx errors + if httpResponse != nil && httpResponse.StatusCode >= 400 && httpResponse.StatusCode <= 499 { + return nil, fmt.Errorf("error %s returned by auth service: %s", httpResponse.Status, err.Error()) + } nextDuration := time.Duration(1000.0*(math.Pow(2.0, float64(retry)))) * time.Millisecond time.Sleep(nextDuration) } diff --git a/common/auth/federation_client_test.go b/common/auth/federation_client_test.go index aedc082c39..f02444f049 100644 --- a/common/auth/federation_client_test.go +++ b/common/auth/federation_client_test.go @@ -130,7 +130,7 @@ func TestX509FederationClient_RenewSecurityTokenFailedOnFirstTimeAndRetry(t *tes responses := []func(w http.ResponseWriter, r *http.Request){ func(w http.ResponseWriter, r *http.Request) { // Return response - w.WriteHeader(http.StatusNotFound) + w.WriteHeader(http.StatusBadGateway) }, func(w http.ResponseWriter, r *http.Request) { // Verify request @@ -189,6 +189,61 @@ func TestX509FederationClient_RenewSecurityTokenFailedOnFirstTimeAndRetry(t *tes mockIntermediateCertificateRetriever.AssertExpectations(t) } +func TestX509FederationClient_RenewSecurityTokenFailedSecondTimeOn4XX(t *testing.T) { + responseCounter := 0 + responses := []func(w http.ResponseWriter, r *http.Request){ + func(w http.ResponseWriter, r *http.Request) { + // Return response + w.WriteHeader(http.StatusBadGateway) + }, + func(w http.ResponseWriter, r *http.Request) { + // Return response + w.WriteHeader(http.StatusUnauthorized) + }, + } + authServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + responses[responseCounter](w, r) + responseCounter++ + })) + defer authServer.Close() + + mockSessionKeySupplier := new(mockSessionKeySupplier) + mockSessionKeySupplier.On("Refresh").Return(nil).Once() + mockSessionKeySupplier.On("PublicKeyPemRaw").Return([]byte(sessionPublicKeyPem)) + + mockLeafCertificateRetriever := new(mockCertificateRetriever) + mockLeafCertificateRetriever.On("Refresh").Return(nil).Once() + mockLeafCertificateRetriever.On("CertificatePemRaw").Return([]byte(leafCertPem)) + mockLeafCertificateRetriever.On("Certificate").Return(parseCertificate(leafCertPem)) + mockLeafCertificateRetriever.On("PrivateKey").Return(parsePrivateKey(leafCertPrivateKeyPem)) + + mockIntermediateCertificateRetriever := new(mockCertificateRetriever) + mockIntermediateCertificateRetriever.On("Refresh").Return(nil).Once() + mockIntermediateCertificateRetriever.On("CertificatePemRaw").Return([]byte(intermediateCertPem)) + + mockSecurityToken := new(mockSecurityToken) + mockSecurityToken.On("Valid").Return(false) + + federationClient := &x509FederationClient{ + tenancyID: tenancyID, + sessionKeySupplier: mockSessionKeySupplier, + leafCertificateRetriever: mockLeafCertificateRetriever, + intermediateCertificateRetrievers: []x509CertificateRetriever{mockIntermediateCertificateRetriever}, + } + federationClient.authClient = newAuthClient(whateverRegion, federationClient) + // Overwrite with the authServer's URL + federationClient.authClient.Host = authServer.URL + federationClient.authClient.BasePath = "" + federationClient.securityToken = mockSecurityToken + + _, err := federationClient.SecurityToken() + + assert.Error(t, err) + mockSessionKeySupplier.AssertExpectations(t) + mockLeafCertificateRetriever.AssertExpectations(t) + mockIntermediateCertificateRetriever.AssertExpectations(t) +} + func TestX509FederationClient_GetCachedSecurityToken(t *testing.T) { mockSessionKeySupplier := new(mockSessionKeySupplier) mockLeafCertificateRetriever := new(mockCertificateRetriever) @@ -395,6 +450,21 @@ func TestX509FederationClient_ClientHost(t *testing.T) { } } +func TestFederationAuthClientCircuitBreaker(t *testing.T) { + t.Setenv("OCI_SDK_AUTH_CLIENT_CIRCUIT_BREAKER_ENABLED", "True") + federationClient := &x509FederationClient{} + federationClient.authClient = newAuthClient(whateverRegion, federationClient) + authCB := federationClient.authClient.Configuration.CircuitBreaker + assert.Equal(t, authCB.Cb.Name(), common.AuthClientCircuitBreakerName) +} + +func TestFederationAuthClientCircuitBreakerDisabled(t *testing.T) { + t.Setenv("OCI_SDK_AUTH_CLIENT_CIRCUIT_BREAKER_ENABLED", "False") + federationClient := &x509FederationClient{} + federationClient.authClient = newAuthClient(whateverRegion, federationClient) + assert.Nil(t, federationClient.authClient.Configuration.CircuitBreaker) +} + func parseCertificate(certPem string) *x509.Certificate { var block *pem.Block block, _ = pem.Decode([]byte(certPem)) diff --git a/common/circuit_breaker.go b/common/circuit_breaker.go index 96e9323147..b6635f0d48 100644 --- a/common/circuit_breaker.go +++ b/common/circuit_breaker.go @@ -5,6 +5,7 @@ package common import ( "fmt" + "math/rand" "net/http" "os" "strconv" @@ -29,6 +30,16 @@ const ( DefaultCircuitBreakerServiceName string = "" // DefaultCircuitBreakerHistoryCount is the default count of failed response history in circuit breaker DefaultCircuitBreakerHistoryCount int = 5 + // MinAuthClientCircuitBreakerResetTimeout is the min value of openStateWindow, which is the wait time before setting the breaker to halfOpen state from open state + MinAuthClientCircuitBreakerResetTimeout = 30 + // MaxAuthClientCircuitBreakerResetTimeout is the max value of openStateWindow, which is the wait time before setting the breaker to halfOpen state from open state + MaxAuthClientCircuitBreakerResetTimeout = 49 + // AuthClientCircuitBreakerName is the default circuit breaker name for the DefaultAuthClientCircuitBreakerSetting + AuthClientCircuitBreakerName = "FederationClientCircuitBreaker" + // AuthClientCircuitBreakerDefaultFailureThreshold is the default requests failure rate for the DefaultAuthClientCircuitBreakerSetting + AuthClientCircuitBreakerDefaultFailureThreshold float64 = 0.65 + // AuthClientCircuitBreakerDefaultMinimumRequests is the default value of minimumRequests in closed status + AuthClientCircuitBreakerDefaultMinimumRequests uint32 = 3 ) // CircuitBreakerSetting wraps all exposed configurable params of circuit breaker @@ -213,7 +224,7 @@ func NewCircuitBreakerSettingWithOptions(opts ...CircuitBreakerOption) *CircuitB for _, opt := range opts { opt(cbst) } - if defaultLogger.LogLevel() == verboseLogging { + if defaultLogger != nil && defaultLogger.LogLevel() == verboseLogging { Debugf("Circuit Breaker setting: %s\n", cbst.String()) } @@ -383,3 +394,17 @@ func ConfigCircuitBreakerFromGlobalVar(baseClient *BaseClient) { baseClient.Configuration.CircuitBreaker = NewCircuitBreaker(GlobalCircuitBreakerSetting) } } + +// DefaultAuthClientCircuitBreakerSetting returns the default circuit breaker setting for the Auth Client +func DefaultAuthClientCircuitBreakerSetting() *CircuitBreakerSetting { + return NewCircuitBreakerSettingWithOptions( + WithOpenStateWindow(time.Duration(rand.Intn(MaxAuthClientCircuitBreakerResetTimeout+1-MinAuthClientCircuitBreakerResetTimeout)+MinAuthClientCircuitBreakerResetTimeout)*time.Second), + WithName(AuthClientCircuitBreakerName), + WithFailureRateThreshold(AuthClientCircuitBreakerDefaultFailureThreshold), + WithMinimumRequests(AuthClientCircuitBreakerDefaultMinimumRequests), + ) +} + +// GlobalAuthClientCircuitBreakerSetting is global level circuit breaker setting for the Auth Client +// than client level circuit breaker +var GlobalAuthClientCircuitBreakerSetting *CircuitBreakerSetting = nil diff --git a/common/circuit_breaker_test.go b/common/circuit_breaker_test.go index 7d94435d25..edb92daf2b 100644 --- a/common/circuit_breaker_test.go +++ b/common/circuit_breaker_test.go @@ -5,6 +5,7 @@ package common import ( "testing" + "time" "github.com/sony/gobreaker" "github.com/stretchr/testify/assert" @@ -168,3 +169,77 @@ func TestCircuitBreaker_CustomizeGoBreakerSetting(t *testing.T) { assert.Equal(t, testData.expected, st.IsSuccessful(testData.err)) } } + +func TestAuthClient_CircuitBreaker_ReadyToTrip(t *testing.T) { + cbSetting := DefaultAuthClientCircuitBreakerSetting() + assert.True(t, cbSetting.isEnabled) + st := gobreaker.Settings{} + + customizeGoBreakerSetting(&st, cbSetting) + assert.Equal(t, st.Name, AuthClientCircuitBreakerName) + assert.True(t, st.Timeout >= time.Duration(MinAuthClientCircuitBreakerResetTimeout)*time.Second && st.Timeout <= time.Duration(MaxAuthClientCircuitBreakerResetTimeout)*time.Second) + assert.Equal(t, st.Interval, CircuitBreakerDefaultClosedWindow) + assert.Equal(t, cbSetting.failureRateThreshold, AuthClientCircuitBreakerDefaultFailureThreshold) + + counts := gobreaker.Counts{ + Requests: 1, + TotalSuccesses: 0, + TotalFailures: 1, + ConsecutiveSuccesses: 0, + ConsecutiveFailures: 1, + } + assert.False(t, st.ReadyToTrip(counts)) + + counts = gobreaker.Counts{ + Requests: 2, + TotalSuccesses: 0, + TotalFailures: 2, + ConsecutiveSuccesses: 0, + ConsecutiveFailures: 2, + } + assert.False(t, st.ReadyToTrip(counts)) + + counts = gobreaker.Counts{ + Requests: 3, + TotalSuccesses: 0, + TotalFailures: 3, + ConsecutiveSuccesses: 0, + ConsecutiveFailures: 3, + } + assert.True(t, st.ReadyToTrip(counts)) + + type testData struct { + err servicefailure + expected bool + } + testDataSet := []testData{ + { + err: servicefailure{ + StatusCode: 400, + Code: "InvalidParameter"}, + expected: true, + }, + { + err: servicefailure{ + StatusCode: 409, + Code: "IncorrectState"}, + expected: false, + }, + { + err: servicefailure{ + StatusCode: 429, + Code: "TooManyRequests"}, + expected: false, + }, + { + err: servicefailure{ + StatusCode: 504, + Code: "whatever"}, + expected: false, + }, + } + + for _, testData := range testDataSet { + assert.Equal(t, testData.expected, st.IsSuccessful(testData.err)) + } +} diff --git a/common/regions.go b/common/regions.go index 8f6bfd205d..d96bd193a2 100644 --- a/common/regions.go +++ b/common/regions.go @@ -142,6 +142,12 @@ const ( RegionMEAbudhabi2 Region = "me-abudhabi-2" //RegionMEAbudhabi4 region Abudhabi RegionMEAbudhabi4 Region = "me-abudhabi-4" + //RegionAPSeoul2 region Seoul + RegionAPSeoul2 Region = "ap-seoul-2" + //RegionAPSuwon1 region Suwon + RegionAPSuwon1 Region = "ap-suwon-1" + //RegionAPChuncheon2 region Chuncheon + RegionAPChuncheon2 Region = "ap-chuncheon-2" ) var shortNameRegion = map[string]Region{ @@ -214,6 +220,9 @@ var shortNameRegion = map[string]Region{ "ahu": RegionMEAbudhabi3, "rkt": RegionMEAbudhabi2, "shj": RegionMEAbudhabi4, + "dtz": RegionAPSeoul2, + "dln": RegionAPSuwon1, + "bno": RegionAPChuncheon2, } var realm = map[string]string{ @@ -233,6 +242,7 @@ var realm = map[string]string{ "oc24": "oraclecloud24.com", "oc26": "oraclecloud26.com", "oc29": "oraclecloud29.com", + "oc35": "oraclecloud35.com", } var regionRealm = map[Region]string{ @@ -320,4 +330,8 @@ var regionRealm = map[Region]string{ RegionMEAbudhabi2: "oc29", RegionMEAbudhabi4: "oc29", + + RegionAPSeoul2: "oc35", + RegionAPSuwon1: "oc35", + RegionAPChuncheon2: "oc35", } diff --git a/common/regions.json b/common/regions.json index 7bd7989da2..b5924ee613 100644 --- a/common/regions.json +++ b/common/regions.json @@ -412,5 +412,23 @@ "realmKey": "oc23", "regionIdentifier": "us-thames-1", "realmDomainComponent": "oraclecloud23.com" + }, + { + "regionKey": "dtz", + "realmKey": "oc35", + "regionIdentifier": "ap-seoul-2", + "realmDomainComponent": "oraclecloud35.com" + }, + { + "regionKey": "dln", + "realmKey": "oc35", + "regionIdentifier": "ap-suwon-1", + "realmDomainComponent": "oraclecloud35.com" + }, + { + "regionKey": "bno", + "realmKey": "oc35", + "regionIdentifier": "ap-chuncheon-2", + "realmDomainComponent": "oraclecloud35.com" } ] \ No newline at end of file diff --git a/common/version.go b/common/version.go index 63514ed562..6093a76f74 100644 --- a/common/version.go +++ b/common/version.go @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "77" - patch = "1" + minor = "78" + patch = "0" tag = "" ) diff --git a/dataflow/dataflow_client.go b/dataflow/dataflow_client.go index f77c45e3e4..3b7b35c14e 100644 --- a/dataflow/dataflow_client.go +++ b/dataflow/dataflow_client.go @@ -2224,6 +2224,69 @@ func (client DataFlowClient) startPool(ctx context.Context, request common.OCIRe return response, err } +// StartSqlEndpoint Starts the SqlEndpoint for a given `SqlEndpointId`. 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/dataflow/StartSqlEndpoint.go.html to see an example of how to use StartSqlEndpoint API. +// A default retry strategy applies to this operation StartSqlEndpoint() +func (client DataFlowClient) StartSqlEndpoint(ctx context.Context, request StartSqlEndpointRequest) (response StartSqlEndpointResponse, 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.startSqlEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = StartSqlEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = StartSqlEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(StartSqlEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StartSqlEndpointResponse") + } + return +} + +// startSqlEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) startSqlEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/sqlEndpoints/{sqlEndpointId}/actions/start", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response StartSqlEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-flow/20200129/SqlEndpoint/StartSqlEndpoint" + err = common.PostProcessServiceError(err, "DataFlow", "StartSqlEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // StopPool Stops the dataflow pool for a given `poolId`. When provided, If-Match is checked against ETag values of the resource. // // # See also @@ -2287,6 +2350,69 @@ func (client DataFlowClient) stopPool(ctx context.Context, request common.OCIReq return response, err } +// StopSqlEndpoint Stops the SqlEndpoint for a given `SqlEndpointId`. 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/dataflow/StopSqlEndpoint.go.html to see an example of how to use StopSqlEndpoint API. +// A default retry strategy applies to this operation StopSqlEndpoint() +func (client DataFlowClient) StopSqlEndpoint(ctx context.Context, request StopSqlEndpointRequest) (response StopSqlEndpointResponse, 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.stopSqlEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = StopSqlEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = StopSqlEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(StopSqlEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StopSqlEndpointResponse") + } + return +} + +// stopSqlEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataFlowClient) stopSqlEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/sqlEndpoints/{sqlEndpointId}/actions/stop", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response StopSqlEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-flow/20200129/SqlEndpoint/StopSqlEndpoint" + err = common.PostProcessServiceError(err, "DataFlow", "StopSqlEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateApplication Updates an application using an `applicationId`. // // # See also diff --git a/dataflow/list_sql_endpoints_request_response.go b/dataflow/list_sql_endpoints_request_response.go index c214a20593..2beb2d934e 100644 --- a/dataflow/list_sql_endpoints_request_response.go +++ b/dataflow/list_sql_endpoints_request_response.go @@ -136,6 +136,7 @@ const ( ListSqlEndpointsLifecycleStateFailed ListSqlEndpointsLifecycleStateEnum = "FAILED" ListSqlEndpointsLifecycleStateUpdating ListSqlEndpointsLifecycleStateEnum = "UPDATING" ListSqlEndpointsLifecycleStateNeedsAttention ListSqlEndpointsLifecycleStateEnum = "NEEDS_ATTENTION" + ListSqlEndpointsLifecycleStateInactive ListSqlEndpointsLifecycleStateEnum = "INACTIVE" ) var mappingListSqlEndpointsLifecycleStateEnum = map[string]ListSqlEndpointsLifecycleStateEnum{ @@ -146,6 +147,7 @@ var mappingListSqlEndpointsLifecycleStateEnum = map[string]ListSqlEndpointsLifec "FAILED": ListSqlEndpointsLifecycleStateFailed, "UPDATING": ListSqlEndpointsLifecycleStateUpdating, "NEEDS_ATTENTION": ListSqlEndpointsLifecycleStateNeedsAttention, + "INACTIVE": ListSqlEndpointsLifecycleStateInactive, } var mappingListSqlEndpointsLifecycleStateEnumLowerCase = map[string]ListSqlEndpointsLifecycleStateEnum{ @@ -156,6 +158,7 @@ var mappingListSqlEndpointsLifecycleStateEnumLowerCase = map[string]ListSqlEndpo "failed": ListSqlEndpointsLifecycleStateFailed, "updating": ListSqlEndpointsLifecycleStateUpdating, "needs_attention": ListSqlEndpointsLifecycleStateNeedsAttention, + "inactive": ListSqlEndpointsLifecycleStateInactive, } // GetListSqlEndpointsLifecycleStateEnumValues Enumerates the set of values for ListSqlEndpointsLifecycleStateEnum @@ -177,6 +180,7 @@ func GetListSqlEndpointsLifecycleStateEnumStringValues() []string { "FAILED", "UPDATING", "NEEDS_ATTENTION", + "INACTIVE", } } diff --git a/dataflow/sql_endpoint_lifecycle_state.go b/dataflow/sql_endpoint_lifecycle_state.go index 4a03047f3a..566911211e 100644 --- a/dataflow/sql_endpoint_lifecycle_state.go +++ b/dataflow/sql_endpoint_lifecycle_state.go @@ -25,6 +25,7 @@ const ( SqlEndpointLifecycleStateFailed SqlEndpointLifecycleStateEnum = "FAILED" SqlEndpointLifecycleStateUpdating SqlEndpointLifecycleStateEnum = "UPDATING" SqlEndpointLifecycleStateNeedsAttention SqlEndpointLifecycleStateEnum = "NEEDS_ATTENTION" + SqlEndpointLifecycleStateInactive SqlEndpointLifecycleStateEnum = "INACTIVE" ) var mappingSqlEndpointLifecycleStateEnum = map[string]SqlEndpointLifecycleStateEnum{ @@ -35,6 +36,7 @@ var mappingSqlEndpointLifecycleStateEnum = map[string]SqlEndpointLifecycleStateE "FAILED": SqlEndpointLifecycleStateFailed, "UPDATING": SqlEndpointLifecycleStateUpdating, "NEEDS_ATTENTION": SqlEndpointLifecycleStateNeedsAttention, + "INACTIVE": SqlEndpointLifecycleStateInactive, } var mappingSqlEndpointLifecycleStateEnumLowerCase = map[string]SqlEndpointLifecycleStateEnum{ @@ -45,6 +47,7 @@ var mappingSqlEndpointLifecycleStateEnumLowerCase = map[string]SqlEndpointLifecy "failed": SqlEndpointLifecycleStateFailed, "updating": SqlEndpointLifecycleStateUpdating, "needs_attention": SqlEndpointLifecycleStateNeedsAttention, + "inactive": SqlEndpointLifecycleStateInactive, } // GetSqlEndpointLifecycleStateEnumValues Enumerates the set of values for SqlEndpointLifecycleStateEnum @@ -66,6 +69,7 @@ func GetSqlEndpointLifecycleStateEnumStringValues() []string { "FAILED", "UPDATING", "NEEDS_ATTENTION", + "INACTIVE", } } diff --git a/dataflow/start_sql_endpoint_request_response.go b/dataflow/start_sql_endpoint_request_response.go new file mode 100644 index 0000000000..9fb4c7d701 --- /dev/null +++ b/dataflow/start_sql_endpoint_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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// StartSqlEndpointRequest wrapper for the StartSqlEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/StartSqlEndpoint.go.html to see an example of how to use StartSqlEndpointRequest. +type StartSqlEndpointRequest struct { + + // The unique id of the SQL Endpoint. + SqlEndpointId *string `mandatory:"true" contributesTo:"path" name:"sqlEndpointId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, + // set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID will include this value. + // Otherwise, a random request ID will be generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 StartSqlEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StartSqlEndpointRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request StartSqlEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StartSqlEndpointRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request StartSqlEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StartSqlEndpointResponse wrapper for the StartSqlEndpoint operation +type StartSqlEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle assigned identifier for a work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response StartSqlEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StartSqlEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/dataflow/stop_sql_endpoint_request_response.go b/dataflow/stop_sql_endpoint_request_response.go new file mode 100644 index 0000000000..5e0a59d358 --- /dev/null +++ b/dataflow/stop_sql_endpoint_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 dataflow + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// StopSqlEndpointRequest wrapper for the StopSqlEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dataflow/StopSqlEndpoint.go.html to see an example of how to use StopSqlEndpointRequest. +type StopSqlEndpointRequest struct { + + // The unique id of the SQL Endpoint. + SqlEndpointId *string `mandatory:"true" contributesTo:"path" name:"sqlEndpointId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, + // set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID will include this value. + // Otherwise, a random request ID will be generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 StopSqlEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StopSqlEndpointRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request StopSqlEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StopSqlEndpointRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request StopSqlEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StopSqlEndpointResponse wrapper for the StopSqlEndpoint operation +type StopSqlEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle assigned identifier for a work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response StopSqlEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StopSqlEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/dataflow/update_sql_endpoint_details.go b/dataflow/update_sql_endpoint_details.go index 2bf413a7a1..8db855ada1 100644 --- a/dataflow/update_sql_endpoint_details.go +++ b/dataflow/update_sql_endpoint_details.go @@ -15,7 +15,7 @@ import ( "strings" ) -// UpdateSqlEndpointDetails Currently only the tags of a SQL Endpoint can be updated. +// UpdateSqlEndpointDetails The information about all updatable parameters of a SQL Endpoint. type UpdateSqlEndpointDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -26,6 +26,41 @@ type UpdateSqlEndpointDetails struct { // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The SQL Endpoint name, which can be changed. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description of CreateSQLEndpointDetails. + Description *string `mandatory:"false" json:"description"` + + // The shape of the SQL Endpoint driver instance. + DriverShape *string `mandatory:"false" json:"driverShape"` + + DriverShapeConfig *ShapeConfig `mandatory:"false" json:"driverShapeConfig"` + + // The shape of the SQL Endpoint worker instance. + ExecutorShape *string `mandatory:"false" json:"executorShape"` + + ExecutorShapeConfig *ShapeConfig `mandatory:"false" json:"executorShapeConfig"` + + // The minimum number of executors. + MinExecutorCount *int `mandatory:"false" json:"minExecutorCount"` + + // The maximum number of executors. + MaxExecutorCount *int `mandatory:"false" json:"maxExecutorCount"` + + // Metastore OCID + MetastoreId *string `mandatory:"false" json:"metastoreId"` + + // OCI lake OCID + LakeId *string `mandatory:"false" json:"lakeId"` + + // The Spark configuration passed to the running process. + // See https://spark.apache.org/docs/latest/configuration.html#available-properties. + // Example: { "spark.app.name" : "My App Name", "spark.shuffle.io.maxRetries" : "4" } + // Note: Not all Spark properties are permitted to be set. Attempting to set a property that is + // not allowed to be overwritten will cause a 400 status to be returned. + SparkAdvancedConfigurations map[string]string `mandatory:"false" json:"sparkAdvancedConfigurations"` } func (m UpdateSqlEndpointDetails) String() string { diff --git a/identitydomains/condition.go b/identitydomains/condition.go index e481d869f2..17241de994 100644 --- a/identitydomains/condition.go +++ b/identitydomains/condition.go @@ -124,6 +124,7 @@ type Condition struct { // A list of tags on this resource. // **SCIM++ Properties:** // - idcsCompositeKey: [key, value] + // - idcsCsvAttributeNameMappings: [[columnHeaderName:Tag Key, mapsTo:tags.key], [columnHeaderName:Tag Value, mapsTo:tags.value]] // - idcsSearchable: true // - multiValued: true // - mutability: readWrite @@ -228,6 +229,8 @@ type Condition struct { // - type: string // - uniqueness: none EvaluateConditionIf *string `mandatory:"false" json:"evaluateConditionIf"` + + UrnIetfParamsScimSchemasOracleIdcsExtensionOciconsolesignonpolicyconsentPolicy *ConditionExtensionOciconsolesignonpolicyconsentPolicy `mandatory:"false" json:"urn:ietf:params:scim:schemas:oracle:idcs:extension:ociconsolesignonpolicyconsent:Policy"` } func (m Condition) String() string { diff --git a/identitydomains/condition_extension_ociconsolesignonpolicyconsent_policy.go b/identitydomains/condition_extension_ociconsolesignonpolicyconsent_policy.go new file mode 100644 index 0000000000..b953072088 --- /dev/null +++ b/identitydomains/condition_extension_ociconsolesignonpolicyconsent_policy.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. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConditionExtensionOciconsolesignonpolicyconsentPolicy This extension defines attributes used to record consent for modification of the "Security Policy for OCI Console" sign-on policy, Rule, Condition or ConditionGroup. +type ConditionExtensionOciconsolesignonpolicyconsentPolicy struct { + + // Set to true when an identity domain administrator opts to change the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. Defaults to false. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: boolean + Consent *bool `mandatory:"false" json:"consent"` + + // The justification for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: string + Justification *string `mandatory:"false" json:"justification"` + + // The detailed reason for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: string + Reason *string `mandatory:"false" json:"reason"` +} + +func (m ConditionExtensionOciconsolesignonpolicyconsentPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ConditionExtensionOciconsolesignonpolicyconsentPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/identitydomains/create_restore_oci_console_policy_request_response.go b/identitydomains/create_restore_oci_console_policy_request_response.go new file mode 100644 index 0000000000..3405e48502 --- /dev/null +++ b/identitydomains/create_restore_oci_console_policy_request_response.go @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateRestoreOciConsolePolicyRequest wrapper for the CreateRestoreOciConsolePolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/CreateRestoreOciConsolePolicy.go.html to see an example of how to use CreateRestoreOciConsolePolicyRequest. +type CreateRestoreOciConsolePolicyRequest struct { + + // The Authorization field value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested. + Authorization *string `mandatory:"false" contributesTo:"header" name:"authorization"` + + // An endpoint-specific schema version number to use in the Request. Allowed version values are Earliest Version or Latest Version as specified in each REST API endpoint description, or any sequential number inbetween. All schema attributes/body parameters are a part of version 1. After version 1, any attributes added or deprecated will be tagged with the version that they were added to or deprecated in. If no version is provided, the latest schema version is returned. + ResourceTypeSchemaVersion *string `mandatory:"false" contributesTo:"header" name:"resource_type_schema_version"` + + // RestoreOciConsolePolicy schema. + // Before you specify an attribute-value in a request to create a resource, please check the **'mutability'** property of that attribute in the resource-type schema below. Clicking on an attribute-row will expand that row to show the **SCIM++ Properties** of that attribute. + // - Your request to create, update or replace a resource may specify in its payload a value for any attribute that is defined as *mutability:readWrite* or *mutability:writeOnly* or *mutability:immutable*: + // - The SCIM APIs to create a resource will ignore silently any value that you specify for an attribute that is defined as *mutability:readOnly*. + // - The SCIM APIs to update or replace a resource will fail with an error 400 Bad Request if you specify a value for an attribute that is defined as *mutability:readOnly*. + // - Similarly, the SCIM APIs to update or replace a resource will fail with an error 400 Bad Request if you specify any value for an attribute that is defined as *mutability:immutable* and that already has a value in the specified resource. + // Also, before you use the query-parameter attributes to request specific attributes, please check the **'returned'** property of that attribute in the resource-type schema below: + // - Your request to read a resource (or to search a resource-type) can specify as the value of attributes any attributes that are defined as *returned:default* or *returned:request* or *returned:always*: + // - If you request a specific set of attributes, the SCIM APIs to read a resource (or to search a resource-type) will return in each resource the set of attributes that you requested, as well as any attribute that is defined as *returned:always*. + // - If you do not request a specific set of attributes, the SCIM APIs to read a resource (or to search a resource-type) will return in each resource the the set of attributes defined as *returned:default*, as well as any attribute that is defined as *returned:always*. + // - The SCIM APIs to read a resource (or to search a resource-type) will ignore silently any request to return an attribute that is defined as *returned:never*. + RestoreOciConsolePolicy `contributesTo:"body"` + + // A token you supply to uniquely identify the request and provide idempotency if the request is retried. Idempotency tokens expire after 24 hours. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateRestoreOciConsolePolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateRestoreOciConsolePolicyRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateRestoreOciConsolePolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateRestoreOciConsolePolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateRestoreOciConsolePolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateRestoreOciConsolePolicyResponse wrapper for the CreateRestoreOciConsolePolicy operation +type CreateRestoreOciConsolePolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The RestoreOciConsolePolicy instance + RestoreOciConsolePolicy `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 CreateRestoreOciConsolePolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateRestoreOciConsolePolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/identitydomains/get_oci_console_sign_on_policy_consent_request_response.go b/identitydomains/get_oci_console_sign_on_policy_consent_request_response.go new file mode 100644 index 0000000000..6a55148cac --- /dev/null +++ b/identitydomains/get_oci_console_sign_on_policy_consent_request_response.go @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetOciConsoleSignOnPolicyConsentRequest wrapper for the GetOciConsoleSignOnPolicyConsent operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/GetOciConsoleSignOnPolicyConsent.go.html to see an example of how to use GetOciConsoleSignOnPolicyConsentRequest. +type GetOciConsoleSignOnPolicyConsentRequest struct { + + // ID of the resource + OciConsoleSignOnPolicyConsentId *string `mandatory:"true" contributesTo:"path" name:"ociConsoleSignOnPolicyConsentId"` + + // The Authorization field value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested. + Authorization *string `mandatory:"false" contributesTo:"header" name:"authorization"` + + // An endpoint-specific schema version number to use in the Request. Allowed version values are Earliest Version or Latest Version as specified in each REST API endpoint description, or any sequential number inbetween. All schema attributes/body parameters are a part of version 1. After version 1, any attributes added or deprecated will be tagged with the version that they were added to or deprecated in. If no version is provided, the latest schema version is returned. + ResourceTypeSchemaVersion *string `mandatory:"false" contributesTo:"header" name:"resource_type_schema_version"` + + // A comma-delimited string that specifies the names of resource attributes that should be returned in the response. By default, a response that contains resource attributes contains only attributes that are defined in the schema for that resource type as returned=always or returned=default. An attribute that is defined as returned=request is returned in a response only if the request specifies its name in the value of this query parameter. If a request specifies this query parameter, the response contains the attributes that this query parameter specifies, as well as any attribute that is defined as returned=always. + Attributes *string `mandatory:"false" contributesTo:"query" name:"attributes"` + + // A multi-valued list of strings indicating the return type of attribute definition. The specified set of attributes can be fetched by the return type of the attribute. One or more values can be given together to fetch more than one group of attributes. If 'attributes' query parameter is also available, union of the two is fetched. Valid values - all, always, never, request, default. Values are case-insensitive. + AttributeSets []AttributeSetsEnum `contributesTo:"query" name:"attributeSets" omitEmpty:"true" collectionFormat:"multi"` + + // A token you supply to uniquely identify the request and provide idempotency if the request is retried. Idempotency tokens expire after 24 hours. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetOciConsoleSignOnPolicyConsentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetOciConsoleSignOnPolicyConsentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetOciConsoleSignOnPolicyConsentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetOciConsoleSignOnPolicyConsentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetOciConsoleSignOnPolicyConsentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.AttributeSets { + if _, ok := GetMappingAttributeSetsEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeSets: %s. Supported values are: %s.", val, strings.Join(GetAttributeSetsEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetOciConsoleSignOnPolicyConsentResponse wrapper for the GetOciConsoleSignOnPolicyConsent operation +type GetOciConsoleSignOnPolicyConsentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OciConsoleSignOnPolicyConsent instance + OciConsoleSignOnPolicyConsent `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 GetOciConsoleSignOnPolicyConsentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetOciConsoleSignOnPolicyConsentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/identitydomains/identitydomains_client.go b/identitydomains/identitydomains_client.go index 12ad11695c..ce4dc0feaa 100644 --- a/identitydomains/identitydomains_client.go +++ b/identitydomains/identitydomains_client.go @@ -763,7 +763,7 @@ func (client IdentityDomainsClient) createCloudGateServer(ctx context.Context, r return response, err } -// CreateCondition Create a Condition +// CreateCondition Create a condition // // # See also // @@ -2251,7 +2251,7 @@ func (client IdentityDomainsClient) createPasswordPolicy(ctx context.Context, re return response, err } -// CreatePolicy Create a Policy +// CreatePolicy Create a Policy. // // # See also // @@ -2313,7 +2313,69 @@ func (client IdentityDomainsClient) createPolicy(ctx context.Context, request co return response, err } -// CreateRule Create a Rule +// CreateRestoreOciConsolePolicy Create a RestoreOciConsolePolicy entry to restore Policy to factory default. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/CreateRestoreOciConsolePolicy.go.html to see an example of how to use CreateRestoreOciConsolePolicy API. +func (client IdentityDomainsClient) CreateRestoreOciConsolePolicy(ctx context.Context, request CreateRestoreOciConsolePolicyRequest) (response CreateRestoreOciConsolePolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createRestoreOciConsolePolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateRestoreOciConsolePolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateRestoreOciConsolePolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateRestoreOciConsolePolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateRestoreOciConsolePolicyResponse") + } + return +} + +// createRestoreOciConsolePolicy implements the OCIOperation interface (enables retrying operations) +func (client IdentityDomainsClient) createRestoreOciConsolePolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/admin/v1/RestoreOciConsolePolicy", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateRestoreOciConsolePolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "IdentityDomains", "CreateRestoreOciConsolePolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateRule Create a Rule. // // # See also // @@ -3367,7 +3429,7 @@ func (client IdentityDomainsClient) deleteCloudGateServer(ctx context.Context, r return response, err } -// DeleteCondition Delete a Condition +// DeleteCondition Delete a condition. // // # See also // @@ -4669,7 +4731,7 @@ func (client IdentityDomainsClient) deletePasswordPolicy(ctx context.Context, re return response, err } -// DeletePolicy Delete a Policy +// DeletePolicy Delete a Policy. // // # See also // @@ -4731,7 +4793,7 @@ func (client IdentityDomainsClient) deletePolicy(ctx context.Context, request co return response, err } -// DeleteRule Delete a Rule +// DeleteRule Delete a Rule. // // # See also // @@ -6033,7 +6095,7 @@ func (client IdentityDomainsClient) getCloudGateServer(ctx context.Context, requ return response, err } -// GetCondition Get a Condition +// GetCondition Get a condition. // // # See also // @@ -7707,6 +7769,68 @@ func (client IdentityDomainsClient) getOAuthPartnerCertificate(ctx context.Conte return response, err } +// GetOciConsoleSignOnPolicyConsent Get a OciConsoleSignOnPolicyConsent Entry. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/GetOciConsoleSignOnPolicyConsent.go.html to see an example of how to use GetOciConsoleSignOnPolicyConsent API. +func (client IdentityDomainsClient) GetOciConsoleSignOnPolicyConsent(ctx context.Context, request GetOciConsoleSignOnPolicyConsentRequest) (response GetOciConsoleSignOnPolicyConsentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.getOciConsoleSignOnPolicyConsent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetOciConsoleSignOnPolicyConsentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetOciConsoleSignOnPolicyConsentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetOciConsoleSignOnPolicyConsentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetOciConsoleSignOnPolicyConsentResponse") + } + return +} + +// getOciConsoleSignOnPolicyConsent implements the OCIOperation interface (enables retrying operations) +func (client IdentityDomainsClient) getOciConsoleSignOnPolicyConsent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/admin/v1/OciConsoleSignOnPolicyConsents/{ociConsoleSignOnPolicyConsentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetOciConsoleSignOnPolicyConsentResponse + 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/identity-domains/v1/OciConsoleSignOnPolicyConsent/GetOciConsoleSignOnPolicyConsent" + err = common.PostProcessServiceError(err, "IdentityDomains", "GetOciConsoleSignOnPolicyConsent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetPasswordPolicy Get a password policy. // // # See also @@ -7769,7 +7893,7 @@ func (client IdentityDomainsClient) getPasswordPolicy(ctx context.Context, reque return response, err } -// GetPolicy Get a Policy +// GetPolicy Get a Policy. // // # See also // @@ -7831,7 +7955,7 @@ func (client IdentityDomainsClient) getPolicy(ctx context.Context, request commo return response, err } -// GetRule Get a Rule +// GetRule Get a Rule. // // # See also // @@ -9381,7 +9505,7 @@ func (client IdentityDomainsClient) listCloudGates(ctx context.Context, request return response, err } -// ListConditions Search Conditions +// ListConditions Search conditions. // // # See also // @@ -9434,7 +9558,7 @@ func (client IdentityDomainsClient) listConditions(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Conditions/ListConditions" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Condition/ListConditions" err = common.PostProcessServiceError(err, "IdentityDomains", "ListConditions", apiReferenceLink) return response, err } @@ -11179,6 +11303,68 @@ func (client IdentityDomainsClient) listOAuthPartnerCertificates(ctx context.Con return response, err } +// ListOciConsoleSignOnPolicyConsents Search OciConsoleSignOnPolicyConsent entries +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/ListOciConsoleSignOnPolicyConsents.go.html to see an example of how to use ListOciConsoleSignOnPolicyConsents API. +func (client IdentityDomainsClient) ListOciConsoleSignOnPolicyConsents(ctx context.Context, request ListOciConsoleSignOnPolicyConsentsRequest) (response ListOciConsoleSignOnPolicyConsentsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.listOciConsoleSignOnPolicyConsents, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListOciConsoleSignOnPolicyConsentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListOciConsoleSignOnPolicyConsentsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListOciConsoleSignOnPolicyConsentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListOciConsoleSignOnPolicyConsentsResponse") + } + return +} + +// listOciConsoleSignOnPolicyConsents implements the OCIOperation interface (enables retrying operations) +func (client IdentityDomainsClient) listOciConsoleSignOnPolicyConsents(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/admin/v1/OciConsoleSignOnPolicyConsents", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListOciConsoleSignOnPolicyConsentsResponse + 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/identity-domains/v1/OciConsoleSignOnPolicyConsent/ListOciConsoleSignOnPolicyConsents" + err = common.PostProcessServiceError(err, "IdentityDomains", "ListOciConsoleSignOnPolicyConsents", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListPasswordPolicies Search for password policies. // // # See also @@ -11241,7 +11427,7 @@ func (client IdentityDomainsClient) listPasswordPolicies(ctx context.Context, re return response, err } -// ListPolicies Search Policies +// ListPolicies Search Policies. // // # See also // @@ -11294,7 +11480,7 @@ func (client IdentityDomainsClient) listPolicies(ctx context.Context, request co defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Policies/ListPolicies" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Policy/ListPolicies" err = common.PostProcessServiceError(err, "IdentityDomains", "ListPolicies", apiReferenceLink) return response, err } @@ -11365,7 +11551,7 @@ func (client IdentityDomainsClient) listResourceTypeSchemaAttributes(ctx context return response, err } -// ListRules Search Rules +// ListRules Search Rules. // // # See also // @@ -11418,7 +11604,7 @@ func (client IdentityDomainsClient) listRules(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Rules/ListRules" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Rule/ListRules" err = common.PostProcessServiceError(err, "IdentityDomains", "ListRules", apiReferenceLink) return response, err } @@ -12667,7 +12853,7 @@ func (client IdentityDomainsClient) patchCloudGateServer(ctx context.Context, re return response, err } -// PatchCondition Update a Condition +// PatchCondition Update a condition. // // # See also // @@ -13969,7 +14155,7 @@ func (client IdentityDomainsClient) patchPasswordPolicy(ctx context.Context, req return response, err } -// PatchPolicy Update a Policy +// PatchPolicy Update a Policy. // // # See also // @@ -14031,7 +14217,7 @@ func (client IdentityDomainsClient) patchPolicy(ctx context.Context, request com return response, err } -// PatchRule Update a Rule +// PatchRule Update a Rule. // // # See also // @@ -15147,7 +15333,7 @@ func (client IdentityDomainsClient) putCloudGateServer(ctx context.Context, requ return response, err } -// PutCondition Replace a Condition +// PutCondition Replace a condition. // // # See also // @@ -15891,7 +16077,7 @@ func (client IdentityDomainsClient) putPasswordPolicy(ctx context.Context, reque return response, err } -// PutPolicy Replace a Policy +// PutPolicy Replace a Policy. // // # See also // @@ -15953,7 +16139,7 @@ func (client IdentityDomainsClient) putPolicy(ctx context.Context, request commo return response, err } -// PutRule Replace a Rule +// PutRule Replace a Rule. // // # See also // @@ -17193,7 +17379,7 @@ func (client IdentityDomainsClient) searchCloudGates(ctx context.Context, reques return response, err } -// SearchConditions Search Conditions Using POST +// SearchConditions Search Conditions Using POST. // // # See also // @@ -17246,7 +17432,7 @@ func (client IdentityDomainsClient) searchConditions(ctx context.Context, reques defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Conditions/SearchConditions" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Condition/SearchConditions" err = common.PostProcessServiceError(err, "IdentityDomains", "SearchConditions", apiReferenceLink) return response, err } @@ -18247,6 +18433,68 @@ func (client IdentityDomainsClient) searchOAuthPartnerCertificates(ctx context.C return response, err } +// SearchOciConsoleSignOnPolicyConsents Search OciConsoleSignOnPolicyConsents Using POST +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/SearchOciConsoleSignOnPolicyConsents.go.html to see an example of how to use SearchOciConsoleSignOnPolicyConsents API. +func (client IdentityDomainsClient) SearchOciConsoleSignOnPolicyConsents(ctx context.Context, request SearchOciConsoleSignOnPolicyConsentsRequest) (response SearchOciConsoleSignOnPolicyConsentsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.searchOciConsoleSignOnPolicyConsents, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SearchOciConsoleSignOnPolicyConsentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SearchOciConsoleSignOnPolicyConsentsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SearchOciConsoleSignOnPolicyConsentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SearchOciConsoleSignOnPolicyConsentsResponse") + } + return +} + +// searchOciConsoleSignOnPolicyConsents implements the OCIOperation interface (enables retrying operations) +func (client IdentityDomainsClient) searchOciConsoleSignOnPolicyConsents(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/admin/v1/OciConsoleSignOnPolicyConsents/.search", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SearchOciConsoleSignOnPolicyConsentsResponse + 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/identity-domains/v1/OciConsoleSignOnPolicyConsent/SearchOciConsoleSignOnPolicyConsents" + err = common.PostProcessServiceError(err, "IdentityDomains", "SearchOciConsoleSignOnPolicyConsents", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // SearchPasswordPolicies Search for password policies using POST. // // # See also @@ -18362,7 +18610,7 @@ func (client IdentityDomainsClient) searchPolicies(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Policies/SearchPolicies" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Policy/SearchPolicies" err = common.PostProcessServiceError(err, "IdentityDomains", "SearchPolicies", apiReferenceLink) return response, err } @@ -18433,7 +18681,7 @@ func (client IdentityDomainsClient) searchResourceTypeSchemaAttributes(ctx conte return response, err } -// SearchRules Search Rules Using POST +// SearchRules Search Rules Using POST. // // # See also // @@ -18486,7 +18734,7 @@ func (client IdentityDomainsClient) searchRules(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Rules/SearchRules" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/identity-domains/v1/Rule/SearchRules" err = common.PostProcessServiceError(err, "IdentityDomains", "SearchRules", apiReferenceLink) return response, err } diff --git a/identitydomains/list_oci_console_sign_on_policy_consents_request_response.go b/identitydomains/list_oci_console_sign_on_policy_consents_request_response.go new file mode 100644 index 0000000000..fd56bb6181 --- /dev/null +++ b/identitydomains/list_oci_console_sign_on_policy_consents_request_response.go @@ -0,0 +1,177 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListOciConsoleSignOnPolicyConsentsRequest wrapper for the ListOciConsoleSignOnPolicyConsents operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/ListOciConsoleSignOnPolicyConsents.go.html to see an example of how to use ListOciConsoleSignOnPolicyConsentsRequest. +type ListOciConsoleSignOnPolicyConsentsRequest struct { + + // OPTIONAL. The filter string that is used to request a subset of resources. The filter string MUST be a valid filter expression. See the Filtering section of the SCIM specification for more information (Section 3.4.2.2). The string should contain at least one condition that each item must match in order to be returned in the search results. Each condition specifies an attribute, an operator, and a value. Conditions within a filter can be connected by logical operators (such as AND and OR). Sets of conditions can be grouped together using parentheses. + Filter *string `mandatory:"false" contributesTo:"query" name:"filter"` + + // OPTIONAL. A string that indicates the attribute whose value SHALL be used to order the returned responses. The sortBy attribute MUST be in standard attribute notation form. See the Attribute Notation section of the SCIM specification for more information (Section 3.10). Also, see the Sorting section of the SCIM specification for more information (Section 3.4.2.3). + SortBy *string `mandatory:"false" contributesTo:"query" name:"sortBy"` + + // A string that indicates the order in which the sortBy parameter is applied. Allowed values are 'ascending' and 'descending'. See (Sorting Section (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.4.2.3)). OPTIONAL. + SortOrder ListOciConsoleSignOnPolicyConsentsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // OPTIONAL. An integer that indicates the 1-based index of the first query result. See the Pagination section of the SCIM specification for more information. (Section 3.4.2.4). The number of results pages to return. The first page is 1. Specify 2 to access the second page of results, and so on. + StartIndex *int `mandatory:"false" contributesTo:"query" name:"startIndex"` + + // OPTIONAL. An integer that indicates the desired maximum number of query results per page. 1000 is the largest value that you can use. See the Pagination section of the System for Cross-Domain Identity Management Protocol specification for more information. (Section 3.4.2.4). + Count *int `mandatory:"false" contributesTo:"query" name:"count"` + + // A comma-delimited string that specifies the names of resource attributes that should be returned in the response. By default, a response that contains resource attributes contains only attributes that are defined in the schema for that resource type as returned=always or returned=default. An attribute that is defined as returned=request is returned in a response only if the request specifies its name in the value of this query parameter. If a request specifies this query parameter, the response contains the attributes that this query parameter specifies, as well as any attribute that is defined as returned=always. + Attributes *string `mandatory:"false" contributesTo:"query" name:"attributes"` + + // A multi-valued list of strings indicating the return type of attribute definition. The specified set of attributes can be fetched by the return type of the attribute. One or more values can be given together to fetch more than one group of attributes. If 'attributes' query parameter is also available, union of the two is fetched. Valid values - all, always, never, request, default. Values are case-insensitive. + AttributeSets []AttributeSetsEnum `contributesTo:"query" name:"attributeSets" omitEmpty:"true" collectionFormat:"multi"` + + // The Authorization field value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested. + Authorization *string `mandatory:"false" contributesTo:"header" name:"authorization"` + + // An endpoint-specific schema version number to use in the Request. Allowed version values are Earliest Version or Latest Version as specified in each REST API endpoint description, or any sequential number inbetween. All schema attributes/body parameters are a part of version 1. After version 1, any attributes added or deprecated will be tagged with the version that they were added to or deprecated in. If no version is provided, the latest schema version is returned. + ResourceTypeSchemaVersion *string `mandatory:"false" contributesTo:"header" name:"resource_type_schema_version"` + + // A token you supply to uniquely identify the request and provide idempotency if the request is retried. Idempotency tokens expire after 24 hours. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The value of the `opc-next-page` response header from the previous 'List' call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return in a paginated 'List' call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // 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 ListOciConsoleSignOnPolicyConsentsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListOciConsoleSignOnPolicyConsentsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListOciConsoleSignOnPolicyConsentsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListOciConsoleSignOnPolicyConsentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListOciConsoleSignOnPolicyConsentsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListOciConsoleSignOnPolicyConsentsSortOrderEnum(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(GetListOciConsoleSignOnPolicyConsentsSortOrderEnumStringValues(), ","))) + } + for _, val := range request.AttributeSets { + if _, ok := GetMappingAttributeSetsEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeSets: %s. Supported values are: %s.", val, strings.Join(GetAttributeSetsEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListOciConsoleSignOnPolicyConsentsResponse wrapper for the ListOciConsoleSignOnPolicyConsents operation +type ListOciConsoleSignOnPolicyConsentsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of OciConsoleSignOnPolicyConsents instances + OciConsoleSignOnPolicyConsents `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 ListOciConsoleSignOnPolicyConsentsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListOciConsoleSignOnPolicyConsentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListOciConsoleSignOnPolicyConsentsSortOrderEnum Enum with underlying type: string +type ListOciConsoleSignOnPolicyConsentsSortOrderEnum string + +// Set of constants representing the allowable values for ListOciConsoleSignOnPolicyConsentsSortOrderEnum +const ( + ListOciConsoleSignOnPolicyConsentsSortOrderAscending ListOciConsoleSignOnPolicyConsentsSortOrderEnum = "ASCENDING" + ListOciConsoleSignOnPolicyConsentsSortOrderDescending ListOciConsoleSignOnPolicyConsentsSortOrderEnum = "DESCENDING" +) + +var mappingListOciConsoleSignOnPolicyConsentsSortOrderEnum = map[string]ListOciConsoleSignOnPolicyConsentsSortOrderEnum{ + "ASCENDING": ListOciConsoleSignOnPolicyConsentsSortOrderAscending, + "DESCENDING": ListOciConsoleSignOnPolicyConsentsSortOrderDescending, +} + +var mappingListOciConsoleSignOnPolicyConsentsSortOrderEnumLowerCase = map[string]ListOciConsoleSignOnPolicyConsentsSortOrderEnum{ + "ascending": ListOciConsoleSignOnPolicyConsentsSortOrderAscending, + "descending": ListOciConsoleSignOnPolicyConsentsSortOrderDescending, +} + +// GetListOciConsoleSignOnPolicyConsentsSortOrderEnumValues Enumerates the set of values for ListOciConsoleSignOnPolicyConsentsSortOrderEnum +func GetListOciConsoleSignOnPolicyConsentsSortOrderEnumValues() []ListOciConsoleSignOnPolicyConsentsSortOrderEnum { + values := make([]ListOciConsoleSignOnPolicyConsentsSortOrderEnum, 0) + for _, v := range mappingListOciConsoleSignOnPolicyConsentsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListOciConsoleSignOnPolicyConsentsSortOrderEnumStringValues Enumerates the set of values in String for ListOciConsoleSignOnPolicyConsentsSortOrderEnum +func GetListOciConsoleSignOnPolicyConsentsSortOrderEnumStringValues() []string { + return []string{ + "ASCENDING", + "DESCENDING", + } +} + +// GetMappingListOciConsoleSignOnPolicyConsentsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOciConsoleSignOnPolicyConsentsSortOrderEnum(val string) (ListOciConsoleSignOnPolicyConsentsSortOrderEnum, bool) { + enum, ok := mappingListOciConsoleSignOnPolicyConsentsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/identitydomains/oci_console_sign_on_policy_consent.go b/identitydomains/oci_console_sign_on_policy_consent.go new file mode 100644 index 0000000000..7cda3c3ca2 --- /dev/null +++ b/identitydomains/oci_console_sign_on_policy_consent.go @@ -0,0 +1,286 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciConsoleSignOnPolicyConsent The "Security Policy for OCI Console" sign-on policy consent resource used to record consents. The schema to record the "Security Policy for OCI Console" sign-on policy consent. +type OciConsoleSignOnPolicyConsent struct { + + // REQUIRED. The schemas attribute is an array of Strings which allows introspection of the supported schema version for a SCIM representation as well any schema extensions supported by that representation. Each String value must be a unique URI. This specification defines URIs for User, Group, and a standard \"enterprise\" extension. All representations of SCIM schema MUST include a non-zero value array with value(s) of the URIs supported by that representation. Duplicate values MUST NOT be included. Value order is not specified and MUST not impact behavior. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: true + // - mutability: readWrite + // - required: true + // - returned: default + // - type: string + // - uniqueness: none + Schemas []string `mandatory:"true" json:"schemas"` + + ConsentSignedBy *OciConsoleSignOnPolicyConsentConsentSignedBy `mandatory:"true" json:"consentSignedBy"` + + ModifiedResource *OciConsoleSignOnPolicyConsentModifiedResource `mandatory:"true" json:"modifiedResource"` + + PolicyResource *OciConsoleSignOnPolicyConsentPolicyResource `mandatory:"true" json:"policyResource"` + + // Change Type - MODIFIED or RESTORED_TO_FACTORY_DEFAULT + // **SCIM++ Properties:** + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + // - uniqueness: none + ChangeType OciConsoleSignOnPolicyConsentChangeTypeEnum `mandatory:"true" json:"changeType"` + + // Client IP of the Consent Signer + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + // - uniqueness: none + ClientIp *string `mandatory:"true" json:"clientIp"` + + // The justification for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + // - uniqueness: none + Justification *string `mandatory:"true" json:"justification"` + + // Time when Consent was signed. + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: dateTime + // - uniqueness: none + TimeConsentSigned *string `mandatory:"true" json:"timeConsentSigned"` + + // The recipients of the email notification for the change in consent. + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: true + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + NotificationRecipients []string `mandatory:"true" json:"notificationRecipients"` + + // Unique identifier for the SCIM Resource as defined by the Service Provider. Each representation of the Resource MUST include a non-empty id value. This identifier MUST be unique across the Service Provider's entire set of Resources. It MUST be a stable, non-reassignable identifier that does not change when the same Resource is returned in subsequent requests. The value of the id attribute is always issued by the Service Provider and MUST never be specified by the Service Consumer. bulkId: is a reserved keyword and MUST NOT be used in the unique identifier. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: true + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: always + // - type: string + // - uniqueness: global + Id *string `mandatory:"false" json:"id"` + + // Unique OCI identifier for the SCIM Resource. + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: false + // - returned: default + // - type: string + // - uniqueness: global + Ocid *string `mandatory:"false" json:"ocid"` + + Meta *Meta `mandatory:"false" json:"meta"` + + IdcsCreatedBy *IdcsCreatedBy `mandatory:"false" json:"idcsCreatedBy"` + + IdcsLastModifiedBy *IdcsLastModifiedBy `mandatory:"false" json:"idcsLastModifiedBy"` + + // Each value of this attribute specifies an operation that only an internal client may perform on this particular resource. + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: true + // - mutability: readOnly + // - required: false + // - returned: request + // - type: string + // - uniqueness: none + IdcsPreventedOperations []IdcsPreventedOperationsEnum `mandatory:"false" json:"idcsPreventedOperations,omitempty"` + + // A list of tags on this resource. + // **SCIM++ Properties:** + // - idcsCompositeKey: [key, value] + // - idcsCsvAttributeNameMappings: [[columnHeaderName:Tag Key, mapsTo:tags.key], [columnHeaderName:Tag Value, mapsTo:tags.value]] + // - idcsSearchable: true + // - multiValued: true + // - mutability: readWrite + // - required: false + // - returned: request + // - type: complex + // - uniqueness: none + Tags []Tags `mandatory:"false" json:"tags"` + + // A boolean flag indicating this resource in the process of being deleted. Usually set to true when synchronous deletion of the resource would take too long. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: true + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: boolean + // - uniqueness: none + DeleteInProgress *bool `mandatory:"false" json:"deleteInProgress"` + + // The release number when the resource was upgraded. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: request + // - type: string + // - uniqueness: none + IdcsLastUpgradedInRelease *string `mandatory:"false" json:"idcsLastUpgradedInRelease"` + + // OCI Domain Id (ocid) in which the resource lives. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: string + // - uniqueness: none + DomainOcid *string `mandatory:"false" json:"domainOcid"` + + // OCI Compartment Id (ocid) in which the resource lives. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: string + // - uniqueness: none + CompartmentOcid *string `mandatory:"false" json:"compartmentOcid"` + + // OCI Tenant Id (ocid) in which the resource lives. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: string + // - uniqueness: none + TenancyOcid *string `mandatory:"false" json:"tenancyOcid"` + + // The detailed reason for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - required: false + // - returned: default + // - type: string + // - uniqueness: none + Reason *string `mandatory:"false" json:"reason"` +} + +func (m OciConsoleSignOnPolicyConsent) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OciConsoleSignOnPolicyConsent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOciConsoleSignOnPolicyConsentChangeTypeEnum(string(m.ChangeType)); !ok && m.ChangeType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ChangeType: %s. Supported values are: %s.", m.ChangeType, strings.Join(GetOciConsoleSignOnPolicyConsentChangeTypeEnumStringValues(), ","))) + } + + for _, val := range m.IdcsPreventedOperations { + if _, ok := GetMappingIdcsPreventedOperationsEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for IdcsPreventedOperations: %s. Supported values are: %s.", val, strings.Join(GetIdcsPreventedOperationsEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OciConsoleSignOnPolicyConsentChangeTypeEnum Enum with underlying type: string +type OciConsoleSignOnPolicyConsentChangeTypeEnum string + +// Set of constants representing the allowable values for OciConsoleSignOnPolicyConsentChangeTypeEnum +const ( + OciConsoleSignOnPolicyConsentChangeTypeModified OciConsoleSignOnPolicyConsentChangeTypeEnum = "MODIFIED" + OciConsoleSignOnPolicyConsentChangeTypeRestoredToFactoryDefault OciConsoleSignOnPolicyConsentChangeTypeEnum = "RESTORED_TO_FACTORY_DEFAULT" +) + +var mappingOciConsoleSignOnPolicyConsentChangeTypeEnum = map[string]OciConsoleSignOnPolicyConsentChangeTypeEnum{ + "MODIFIED": OciConsoleSignOnPolicyConsentChangeTypeModified, + "RESTORED_TO_FACTORY_DEFAULT": OciConsoleSignOnPolicyConsentChangeTypeRestoredToFactoryDefault, +} + +var mappingOciConsoleSignOnPolicyConsentChangeTypeEnumLowerCase = map[string]OciConsoleSignOnPolicyConsentChangeTypeEnum{ + "modified": OciConsoleSignOnPolicyConsentChangeTypeModified, + "restored_to_factory_default": OciConsoleSignOnPolicyConsentChangeTypeRestoredToFactoryDefault, +} + +// GetOciConsoleSignOnPolicyConsentChangeTypeEnumValues Enumerates the set of values for OciConsoleSignOnPolicyConsentChangeTypeEnum +func GetOciConsoleSignOnPolicyConsentChangeTypeEnumValues() []OciConsoleSignOnPolicyConsentChangeTypeEnum { + values := make([]OciConsoleSignOnPolicyConsentChangeTypeEnum, 0) + for _, v := range mappingOciConsoleSignOnPolicyConsentChangeTypeEnum { + values = append(values, v) + } + return values +} + +// GetOciConsoleSignOnPolicyConsentChangeTypeEnumStringValues Enumerates the set of values in String for OciConsoleSignOnPolicyConsentChangeTypeEnum +func GetOciConsoleSignOnPolicyConsentChangeTypeEnumStringValues() []string { + return []string{ + "MODIFIED", + "RESTORED_TO_FACTORY_DEFAULT", + } +} + +// GetMappingOciConsoleSignOnPolicyConsentChangeTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOciConsoleSignOnPolicyConsentChangeTypeEnum(val string) (OciConsoleSignOnPolicyConsentChangeTypeEnum, bool) { + enum, ok := mappingOciConsoleSignOnPolicyConsentChangeTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/identitydomains/oci_console_sign_on_policy_consent_consent_signed_by.go b/identitydomains/oci_console_sign_on_policy_consent_consent_signed_by.go new file mode 100644 index 0000000000..356a2270b9 --- /dev/null +++ b/identitydomains/oci_console_sign_on_policy_consent_consent_signed_by.go @@ -0,0 +1,134 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciConsoleSignOnPolicyConsentConsentSignedBy User or App that signs the consent. +// **SCIM++ Properties:** +// - idcsSearchable: true +// - multiValued: false +// - mutability: immutable +// - required: true +// - returned: default +// - type: complex +// - uniqueness: none +type OciConsoleSignOnPolicyConsentConsentSignedBy struct { + + // Id of the User or App that signed consent. + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + Value *string `mandatory:"true" json:"value"` + + // OCID of the User or App that signed consent. + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + Ocid *string `mandatory:"true" json:"ocid"` + + // Name of the User or App that signed consent. + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + DisplayName *string `mandatory:"true" json:"displayName"` + + // Type of principal that signed consent: User or App. + // **SCIM++ Properties:** + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + Type OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum `mandatory:"true" json:"type"` +} + +func (m OciConsoleSignOnPolicyConsentConsentSignedBy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OciConsoleSignOnPolicyConsentConsentSignedBy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOciConsoleSignOnPolicyConsentConsentSignedByTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetOciConsoleSignOnPolicyConsentConsentSignedByTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum Enum with underlying type: string +type OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum string + +// Set of constants representing the allowable values for OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum +const ( + OciConsoleSignOnPolicyConsentConsentSignedByTypeUser OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum = "User" + OciConsoleSignOnPolicyConsentConsentSignedByTypeApp OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum = "App" +) + +var mappingOciConsoleSignOnPolicyConsentConsentSignedByTypeEnum = map[string]OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum{ + "User": OciConsoleSignOnPolicyConsentConsentSignedByTypeUser, + "App": OciConsoleSignOnPolicyConsentConsentSignedByTypeApp, +} + +var mappingOciConsoleSignOnPolicyConsentConsentSignedByTypeEnumLowerCase = map[string]OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum{ + "user": OciConsoleSignOnPolicyConsentConsentSignedByTypeUser, + "app": OciConsoleSignOnPolicyConsentConsentSignedByTypeApp, +} + +// GetOciConsoleSignOnPolicyConsentConsentSignedByTypeEnumValues Enumerates the set of values for OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum +func GetOciConsoleSignOnPolicyConsentConsentSignedByTypeEnumValues() []OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum { + values := make([]OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum, 0) + for _, v := range mappingOciConsoleSignOnPolicyConsentConsentSignedByTypeEnum { + values = append(values, v) + } + return values +} + +// GetOciConsoleSignOnPolicyConsentConsentSignedByTypeEnumStringValues Enumerates the set of values in String for OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum +func GetOciConsoleSignOnPolicyConsentConsentSignedByTypeEnumStringValues() []string { + return []string{ + "User", + "App", + } +} + +// GetMappingOciConsoleSignOnPolicyConsentConsentSignedByTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOciConsoleSignOnPolicyConsentConsentSignedByTypeEnum(val string) (OciConsoleSignOnPolicyConsentConsentSignedByTypeEnum, bool) { + enum, ok := mappingOciConsoleSignOnPolicyConsentConsentSignedByTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/identitydomains/oci_console_sign_on_policy_consent_modified_resource.go b/identitydomains/oci_console_sign_on_policy_consent_modified_resource.go new file mode 100644 index 0000000000..0f623c783f --- /dev/null +++ b/identitydomains/oci_console_sign_on_policy_consent_modified_resource.go @@ -0,0 +1,133 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciConsoleSignOnPolicyConsentModifiedResource The modified Policy, Rule, ConditionGroup or Condition during consent signing. +// **SCIM++ Properties:** +// - idcsSearchable: false +// - multiValued: false +// - mutability: immutable +// - required: true +// - returned: default +// - type: complex +// - uniqueness: none +type OciConsoleSignOnPolicyConsentModifiedResource struct { + + // Modified Policy, Rule, ConditionGroup or Condition Id. + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + Value *string `mandatory:"true" json:"value"` + + // The modified Policy, Rule, ConditionGroup, or Condition OCID. + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + Ocid *string `mandatory:"true" json:"ocid"` + + // The Modified Resource type - Policy, Rule, ConditionGroup, or Condition. A label that indicates the resource type. + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: immutable + // - idcsDefaultValue: Policy + // - required: true + // - returned: default + // - type: string + // - uniqueness: none + Type OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum `mandatory:"true" json:"type"` +} + +func (m OciConsoleSignOnPolicyConsentModifiedResource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OciConsoleSignOnPolicyConsentModifiedResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOciConsoleSignOnPolicyConsentModifiedResourceTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetOciConsoleSignOnPolicyConsentModifiedResourceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum Enum with underlying type: string +type OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum string + +// Set of constants representing the allowable values for OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum +const ( + OciConsoleSignOnPolicyConsentModifiedResourceTypePolicy OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum = "Policy" + OciConsoleSignOnPolicyConsentModifiedResourceTypeRule OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum = "Rule" + OciConsoleSignOnPolicyConsentModifiedResourceTypeConditiongroup OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum = "ConditionGroup" + OciConsoleSignOnPolicyConsentModifiedResourceTypeCondition OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum = "Condition" +) + +var mappingOciConsoleSignOnPolicyConsentModifiedResourceTypeEnum = map[string]OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum{ + "Policy": OciConsoleSignOnPolicyConsentModifiedResourceTypePolicy, + "Rule": OciConsoleSignOnPolicyConsentModifiedResourceTypeRule, + "ConditionGroup": OciConsoleSignOnPolicyConsentModifiedResourceTypeConditiongroup, + "Condition": OciConsoleSignOnPolicyConsentModifiedResourceTypeCondition, +} + +var mappingOciConsoleSignOnPolicyConsentModifiedResourceTypeEnumLowerCase = map[string]OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum{ + "policy": OciConsoleSignOnPolicyConsentModifiedResourceTypePolicy, + "rule": OciConsoleSignOnPolicyConsentModifiedResourceTypeRule, + "conditiongroup": OciConsoleSignOnPolicyConsentModifiedResourceTypeConditiongroup, + "condition": OciConsoleSignOnPolicyConsentModifiedResourceTypeCondition, +} + +// GetOciConsoleSignOnPolicyConsentModifiedResourceTypeEnumValues Enumerates the set of values for OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum +func GetOciConsoleSignOnPolicyConsentModifiedResourceTypeEnumValues() []OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum { + values := make([]OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum, 0) + for _, v := range mappingOciConsoleSignOnPolicyConsentModifiedResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetOciConsoleSignOnPolicyConsentModifiedResourceTypeEnumStringValues Enumerates the set of values in String for OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum +func GetOciConsoleSignOnPolicyConsentModifiedResourceTypeEnumStringValues() []string { + return []string{ + "Policy", + "Rule", + "ConditionGroup", + "Condition", + } +} + +// GetMappingOciConsoleSignOnPolicyConsentModifiedResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOciConsoleSignOnPolicyConsentModifiedResourceTypeEnum(val string) (OciConsoleSignOnPolicyConsentModifiedResourceTypeEnum, bool) { + enum, ok := mappingOciConsoleSignOnPolicyConsentModifiedResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/identitydomains/oci_console_sign_on_policy_consent_policy_resource.go b/identitydomains/oci_console_sign_on_policy_consent_policy_resource.go new file mode 100644 index 0000000000..757300485a --- /dev/null +++ b/identitydomains/oci_console_sign_on_policy_consent_policy_resource.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciConsoleSignOnPolicyConsentPolicyResource Policy Resource +// **SCIM++ Properties:** +// - idcsSearchable: true +// - multiValued: false +// - mutability: immutable +// - required: true +// - returned: default +// - type: complex +// - uniqueness: none +type OciConsoleSignOnPolicyConsentPolicyResource struct { + + // Policy Resource Id + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + Value *string `mandatory:"true" json:"value"` + + // Policy Resource Ocid + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: true + // - returned: default + // - type: string + Ocid *string `mandatory:"true" json:"ocid"` +} + +func (m OciConsoleSignOnPolicyConsentPolicyResource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OciConsoleSignOnPolicyConsentPolicyResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/identitydomains/oci_console_sign_on_policy_consent_search_request.go b/identitydomains/oci_console_sign_on_policy_consent_search_request.go new file mode 100644 index 0000000000..bcd51806d4 --- /dev/null +++ b/identitydomains/oci_console_sign_on_policy_consent_search_request.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. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciConsoleSignOnPolicyConsentSearchRequest Clients MAY execute queries without passing parameters on the URL by using the HTTP POST verb combined with the **.search** path extension. The inclusion of **.search** on the end of a valid SCIM endpoint SHALL be used to indicate the HTTP POST verb is intended to be a query operation. To create a new query result set, a SCIM client sends an HTTP POST request to the desired SCIM resource endpoint (ending in **.search**). The body of the POST request MAY include any of the parameters. +type OciConsoleSignOnPolicyConsentSearchRequest struct { + + // The schemas attribute is an array of Strings which allows introspection of the supported schema version for a SCIM representation as well any schema extensions supported by that representation. Each String value must be a unique URI. Query requests MUST be identified using the following URI: "urn:ietf:params:scim:api:messages:2.0:SearchRequest" REQUIRED. + Schemas []string `mandatory:"true" json:"schemas"` + + // A multi-valued list of strings indicating the names of resource attributes to return in the response overriding the set of attributes that would be returned by default. Attribute names MUST be in standard attribute notation (Section 3.10 (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.10)) form. See (additional retrieval query parameters (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.9)). OPTIONAL. + Attributes []string `mandatory:"false" json:"attributes"` + + // A multi-valued list of strings indicating the return type of attribute definition. The specified set of attributes can be fetched by the return type of the attribute. One or more values can be given together to fetch more than one group of attributes. If "attributes" query parameter is also available, union of the two is fetched. Valid values : all, always, never, request, default. Values are case-insensitive. OPTIONAL. + AttributeSets []AttributeSetsEnum `mandatory:"false" json:"attributeSets,omitempty"` + + // The filter string that is used to request a subset of resources. The filter string MUST be a valid filter expression. See Section 3.4.2.2 (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.4.2.2). OPTIONAL. + Filter *string `mandatory:"false" json:"filter"` + + // A string that indicates the attribute whose value SHALL be used to order the returned responses. The sortBy attribute MUST be in standard attribute notation (Section 3.10 (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.10)) form. See Sorting section (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.4.2.3). OPTIONAL. + SortBy *string `mandatory:"false" json:"sortBy"` + + // A string that indicates the order in which the sortBy parameter is applied. Allowed values are "ascending" and "descending". See (Sorting Section (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.4.2.3)). OPTIONAL. + SortOrder SortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` + + // An integer that indicates the 1-based index of the first query result. See Pagination Section (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.4.2.4). OPTIONAL. + StartIndex *int `mandatory:"false" json:"startIndex"` + + // An integer that indicates the desired maximum number of query results per page. 1000 is the largest value that you can use. See the Pagination section of the System for Cross-Domain Identity Management Protocol specification for more information. (Section 3.4.2.4 (https://tools.ietf.org/html/draft-ietf-scim-api-19#section-3.4.2.4)). OPTIONAL. + Count *int `mandatory:"false" json:"count"` +} + +func (m OciConsoleSignOnPolicyConsentSearchRequest) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OciConsoleSignOnPolicyConsentSearchRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.AttributeSets { + if _, ok := GetMappingAttributeSetsEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeSets: %s. Supported values are: %s.", val, strings.Join(GetAttributeSetsEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingSortOrderEnum(string(m.SortOrder)); !ok && m.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", m.SortOrder, strings.Join(GetSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/identitydomains/oci_console_sign_on_policy_consents.go b/identitydomains/oci_console_sign_on_policy_consents.go new file mode 100644 index 0000000000..d4a4fa86b8 --- /dev/null +++ b/identitydomains/oci_console_sign_on_policy_consents.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciConsoleSignOnPolicyConsents The SCIM protocol defines a standard set of query parameters that can be used to filter, sort, and paginate to return zero or more resources in a query response. Queries MAY be made against a single resource or a resource type endpoint (e.g., /Users), or the service provider Base URI. +type OciConsoleSignOnPolicyConsents struct { + + // The schemas attribute is an array of Strings which allows introspection of the supported schema version for a SCIM representation as well any schema extensions supported by that representation. Each String value must be a unique URI. All representations of SCIM schema MUST include a non-zero value array with value(s) of the URIs supported by that representation. Duplicate values MUST NOT be included. Value order is not specified and MUST not impact behavior. REQUIRED. + Schemas []string `mandatory:"true" json:"schemas"` + + // The total number of results returned by the list or query operation. The value may be larger than the number of resources returned such as when returning a single page of results where multiple pages are available. REQUIRED. + TotalResults *int `mandatory:"true" json:"totalResults"` + + // A multi-valued list of complex objects containing the requested resources. This MAY be a subset of the full set of resources if pagination is requested. REQUIRED if "totalResults" is non-zero. + Resources []OciConsoleSignOnPolicyConsent `mandatory:"true" json:"Resources"` + + // The 1-based index of the first result in the current set of list results. REQUIRED when partial results returned due to pagination. + StartIndex *int `mandatory:"true" json:"startIndex"` + + // The number of resources returned in a list response page. REQUIRED when partial results returned due to pagination. + ItemsPerPage *int `mandatory:"true" json:"itemsPerPage"` +} + +func (m OciConsoleSignOnPolicyConsents) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OciConsoleSignOnPolicyConsents) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/identitydomains/policy.go b/identitydomains/policy.go index f9f60ef2f4..8cf5aedd9d 100644 --- a/identitydomains/policy.go +++ b/identitydomains/policy.go @@ -90,6 +90,7 @@ type Policy struct { // A list of tags on this resource. // **SCIM++ Properties:** // - idcsCompositeKey: [key, value] + // - idcsCsvAttributeNameMappings: [[columnHeaderName:Tag Key, mapsTo:tags.key], [columnHeaderName:Tag Value, mapsTo:tags.value]] // - idcsSearchable: true // - multiValued: true // - mutability: readWrite @@ -216,6 +217,8 @@ type Policy struct { // - type: complex // - uniqueness: none Rules []PolicyRules `mandatory:"false" json:"rules"` + + UrnIetfParamsScimSchemasOracleIdcsExtensionOciconsolesignonpolicyconsentPolicy *PolicyExtensionOciconsolesignonpolicyconsentPolicy `mandatory:"false" json:"urn:ietf:params:scim:schemas:oracle:idcs:extension:ociconsolesignonpolicyconsent:Policy"` } func (m Policy) String() string { diff --git a/identitydomains/policy_extension_ociconsolesignonpolicyconsent_policy.go b/identitydomains/policy_extension_ociconsolesignonpolicyconsent_policy.go new file mode 100644 index 0000000000..ed6bae47f3 --- /dev/null +++ b/identitydomains/policy_extension_ociconsolesignonpolicyconsent_policy.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. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PolicyExtensionOciconsolesignonpolicyconsentPolicy This extension defines attributes used to record consent for modification of the "Security Policy for OCI Console" sign-on policy, Rule, Condition or ConditionGroup. +type PolicyExtensionOciconsolesignonpolicyconsentPolicy struct { + + // Set to true when an identity domain administrator opts to change the Oracle security defaults for the "Security Policy for OCI Console" shipped by Oracle. Defaults to false. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: boolean + Consent *bool `mandatory:"false" json:"consent"` + + // The justification for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: string + Justification *string `mandatory:"false" json:"justification"` + + // The detailed reason for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: string + Reason *string `mandatory:"false" json:"reason"` +} + +func (m PolicyExtensionOciconsolesignonpolicyconsentPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PolicyExtensionOciconsolesignonpolicyconsentPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/identitydomains/policy_policy_type.go b/identitydomains/policy_policy_type.go index 4936dd5043..506dbe295f 100644 --- a/identitydomains/policy_policy_type.go +++ b/identitydomains/policy_policy_type.go @@ -28,7 +28,7 @@ import ( // - uniqueness: none type PolicyPolicyType struct { - // PolicyType identifier + // PolicyType identifier. // **SCIM++ Properties:** // - caseExact: true // - idcsSearchable: true diff --git a/identitydomains/restore_oci_console_policy.go b/identitydomains/restore_oci_console_policy.go new file mode 100644 index 0000000000..b71b1f60f1 --- /dev/null +++ b/identitydomains/restore_oci_console_policy.go @@ -0,0 +1,190 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RestoreOciConsolePolicy Schema to restoring OCI Console Policy to Factory Defaults. +type RestoreOciConsolePolicy struct { + + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: true + // - mutability: readWrite + // - required: true + // - returned: default + // - type: string + // - uniqueness: none + // REQUIRED. The schemas attribute is an array of Strings which allows introspection of the supported schema version for a SCIM representation as well any schema extensions supported by that representation. Each String value must be a unique URI. This specification defines URIs for User, Group, and a standard \"enterprise\" extension. All representations of SCIM schema MUST include a non-zero value array with value(s) of the URIs supported by that representation. Duplicate values MUST NOT be included. Value order is not specified and MUST not impact behavior. + Schemas []string `mandatory:"true" json:"schemas"` + + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - required: true + // - mutability: writeOnly + // - returned: default + // - type: boolean + // Consent to be provided for restoring the Oci Console SignOn Policy to Factory Defaults. Defaults to false + Consent *bool `mandatory:"true" json:"consent"` + + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: true + // - returned: default + // - type: string + // Detailed reason when domain admin opts to restore the Oci Console SignOn Policy to Factory Defaults + Reason *string `mandatory:"true" json:"reason"` + + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: true + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: always + // - type: string + // - uniqueness: global + // Unique identifier for the SCIM Resource as defined by the Service Provider. Each representation of the Resource MUST include a non-empty id value. This identifier MUST be unique across the Service Provider's entire set of Resources. It MUST be a stable, non-reassignable identifier that does not change when the same Resource is returned in subsequent requests. The value of the id attribute is always issued by the Service Provider and MUST never be specified by the Service Consumer. bulkId: is a reserved keyword and MUST NOT be used in the unique identifier. + Id *string `mandatory:"false" json:"id"` + + // **SCIM++ Properties:** + // - caseExact: true + // - idcsSearchable: true + // - multiValued: false + // - mutability: immutable + // - required: false + // - returned: default + // - type: string + // - uniqueness: global + // Unique OCI identifier for the SCIM Resource. + Ocid *string `mandatory:"false" json:"ocid"` + + Meta *Meta `mandatory:"false" json:"meta"` + + IdcsCreatedBy *IdcsCreatedBy `mandatory:"false" json:"idcsCreatedBy"` + + IdcsLastModifiedBy *IdcsLastModifiedBy `mandatory:"false" json:"idcsLastModifiedBy"` + + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: true + // - mutability: readOnly + // - required: false + // - returned: request + // - type: string + // - uniqueness: none + // Each value of this attribute specifies an operation that only an internal client may perform on this particular resource. + IdcsPreventedOperations []IdcsPreventedOperationsEnum `mandatory:"false" json:"idcsPreventedOperations,omitempty"` + + // **SCIM++ Properties:** + // - idcsCompositeKey: [key, value] + // - idcsCsvAttributeNameMappings: [[columnHeaderName:Tag Key, mapsTo:tags.key], [columnHeaderName:Tag Value, mapsTo:tags.value]] + // - idcsSearchable: true + // - multiValued: true + // - mutability: readWrite + // - required: false + // - returned: request + // - type: complex + // - uniqueness: none + // A list of tags on this resource. + Tags []Tags `mandatory:"false" json:"tags"` + + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: true + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: boolean + // - uniqueness: none + // A boolean flag indicating this resource in the process of being deleted. Usually set to true when synchronous deletion of the resource would take too long. + DeleteInProgress *bool `mandatory:"false" json:"deleteInProgress"` + + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: request + // - type: string + // - uniqueness: none + // The release number when the resource was upgraded. + IdcsLastUpgradedInRelease *string `mandatory:"false" json:"idcsLastUpgradedInRelease"` + + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: string + // - uniqueness: none + // OCI Domain Id (ocid) in which the resource lives. + DomainOcid *string `mandatory:"false" json:"domainOcid"` + + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: string + // - uniqueness: none + // OCI Compartment Id (ocid) in which the resource lives. + CompartmentOcid *string `mandatory:"false" json:"compartmentOcid"` + + // **SCIM++ Properties:** + // - caseExact: false + // - idcsSearchable: false + // - multiValued: false + // - mutability: readOnly + // - required: false + // - returned: default + // - type: string + // - uniqueness: none + // OCI Tenant Id (ocid) in which the resource lives. + TenancyOcid *string `mandatory:"false" json:"tenancyOcid"` +} + +func (m RestoreOciConsolePolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RestoreOciConsolePolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.IdcsPreventedOperations { + if _, ok := GetMappingIdcsPreventedOperationsEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for IdcsPreventedOperations: %s. Supported values are: %s.", val, strings.Join(GetIdcsPreventedOperationsEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/identitydomains/rule.go b/identitydomains/rule.go index f3d4d88241..c9110a296a 100644 --- a/identitydomains/rule.go +++ b/identitydomains/rule.go @@ -115,6 +115,7 @@ type Rule struct { // A list of tags on this resource. // **SCIM++ Properties:** // - idcsCompositeKey: [key, value] + // - idcsCsvAttributeNameMappings: [[columnHeaderName:Tag Key, mapsTo:tags.key], [columnHeaderName:Tag Value, mapsTo:tags.value]] // - idcsSearchable: true // - multiValued: true // - mutability: readWrite @@ -242,6 +243,8 @@ type Rule struct { RuleGroovy *string `mandatory:"false" json:"ruleGroovy"` ConditionGroup *RuleConditionGroup `mandatory:"false" json:"conditionGroup"` + + UrnIetfParamsScimSchemasOracleIdcsExtensionOciconsolesignonpolicyconsentPolicy *RuleExtensionOciconsolesignonpolicyconsentPolicy `mandatory:"false" json:"urn:ietf:params:scim:schemas:oracle:idcs:extension:ociconsolesignonpolicyconsent:Policy"` } func (m Rule) String() string { diff --git a/identitydomains/rule_condition_group.go b/identitydomains/rule_condition_group.go index 82203480bb..9ff0177b11 100644 --- a/identitydomains/rule_condition_group.go +++ b/identitydomains/rule_condition_group.go @@ -40,7 +40,7 @@ type RuleConditionGroup struct { // - uniqueness: none Type RuleConditionGroupTypeEnum `mandatory:"true" json:"type"` - // Condition or ConditionGroup identifier + // Condition or ConditionGroup identifier. // **SCIM++ Properties:** // - caseExact: true // - idcsSearchable: true diff --git a/identitydomains/rule_extension_ociconsolesignonpolicyconsent_policy.go b/identitydomains/rule_extension_ociconsolesignonpolicyconsent_policy.go new file mode 100644 index 0000000000..8805ba0d96 --- /dev/null +++ b/identitydomains/rule_extension_ociconsolesignonpolicyconsent_policy.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. + +// Identity Domains API +// +// Use the Identity Domains API to manage resources within an identity domain, for example, users, dynamic resource groups, groups, and identity providers. For information about managing resources within identity domains, see Identity and Access Management (with identity domains) (https://docs.oracle.com/iaas/Content/Identity/home.htm). +// Use this pattern to construct endpoints for identity domains: `https:///admin/v1/`. See Finding an Identity Domain URL (https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/locate-identity-domain-url.htm) to locate the domain URL you need. +// Use the table of contents and search tool to explore the Identity Domains API. +// + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RuleExtensionOciconsolesignonpolicyconsentPolicy This extension defines attributes used to record consent for modification of the "Security Policy for OCI Console" sign-on policy, Rule, Condition or ConditionGroup. +type RuleExtensionOciconsolesignonpolicyconsentPolicy struct { + + // Set to true when an identity domain administrator opts to change the Oracle security defaults for the "Security Policy for OCI Console" shipped by Oracle. Defaults to false. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: boolean + Consent *bool `mandatory:"false" json:"consent"` + + // The justification for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: string + Justification *string `mandatory:"false" json:"justification"` + + // The detailed reason for the change when an identity domain administrator opts to modify the Oracle security defaults for the "Security Policy for OCI Console" sign-on policy shipped by Oracle. + // **Added In:** 2405220110 + // **SCIM++ Properties:** + // - idcsSearchable: false + // - multiValued: false + // - mutability: writeOnly + // - required: false + // - returned: never + // - type: string + Reason *string `mandatory:"false" json:"reason"` +} + +func (m RuleExtensionOciconsolesignonpolicyconsentPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RuleExtensionOciconsolesignonpolicyconsentPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/identitydomains/search_oci_console_sign_on_policy_consents_request_response.go b/identitydomains/search_oci_console_sign_on_policy_consents_request_response.go new file mode 100644 index 0000000000..c01409c5b0 --- /dev/null +++ b/identitydomains/search_oci_console_sign_on_policy_consents_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package identitydomains + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SearchOciConsoleSignOnPolicyConsentsRequest wrapper for the SearchOciConsoleSignOnPolicyConsents operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/identitydomains/SearchOciConsoleSignOnPolicyConsents.go.html to see an example of how to use SearchOciConsoleSignOnPolicyConsentsRequest. +type SearchOciConsoleSignOnPolicyConsentsRequest struct { + + // The Authorization field value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested. + Authorization *string `mandatory:"false" contributesTo:"header" name:"authorization"` + + // An endpoint-specific schema version number to use in the Request. Allowed version values are Earliest Version or Latest Version as specified in each REST API endpoint description, or any sequential number inbetween. All schema attributes/body parameters are a part of version 1. After version 1, any attributes added or deprecated will be tagged with the version that they were added to or deprecated in. If no version is provided, the latest schema version is returned. + ResourceTypeSchemaVersion *string `mandatory:"false" contributesTo:"header" name:"resource_type_schema_version"` + + // Parameters for searching OciConsoleSignOnPolicyConsents + OciConsoleSignOnPolicyConsentSearchRequest `contributesTo:"body"` + + // A token you supply to uniquely identify the request and provide idempotency if the request is retried. Idempotency tokens expire after 24 hours. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The value of the `opc-next-page` response header from the previous 'List' call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return in a paginated 'List' call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // 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 SearchOciConsoleSignOnPolicyConsentsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SearchOciConsoleSignOnPolicyConsentsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request SearchOciConsoleSignOnPolicyConsentsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SearchOciConsoleSignOnPolicyConsentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request SearchOciConsoleSignOnPolicyConsentsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SearchOciConsoleSignOnPolicyConsentsResponse wrapper for the SearchOciConsoleSignOnPolicyConsents operation +type SearchOciConsoleSignOnPolicyConsentsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of OciConsoleSignOnPolicyConsents instances + OciConsoleSignOnPolicyConsents `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 SearchOciConsoleSignOnPolicyConsentsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SearchOciConsoleSignOnPolicyConsentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +}