diff --git a/CHANGELOG.md b/CHANGELOG.md index c00fec3a87..0b82251c72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.47.2 - 2023-08-22 +### Added +- Support for Compute Cloud at Customer service +- Support for warehouse data objects in the Operations Insights service +- Support for standard queries on operations Insights data objects in the Operations Insights service +- Support for database in memory on autonomous database create operations in the Database service + + ## 65.47.1 - 2023-08-15 ### Added - Support for credential stores, including Single Sign-On support, for deployments in the GoldenGate service diff --git a/Makefile b/Makefile index 179f28bf46..9c87a1bab7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com -GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate ##SPECNAME## +GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/common/version.go b/common/version.go index 794aa64f46..434b65d097 100644 --- a/common/version.go +++ b/common/version.go @@ -13,7 +13,7 @@ import ( const ( major = "65" minor = "47" - patch = "1" + patch = "2" tag = "" ) diff --git a/computecloudatcustomer/ccc_infrastructure.go b/computecloudatcustomer/ccc_infrastructure.go new file mode 100644 index 0000000000..4a42e96196 --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure.go @@ -0,0 +1,231 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructure The Oracle Cloud Infrastructure resource representing the connection to the hardware and +// software located in a customer's data center running the Compute Cloud@Customer IaaS services. +type CccInfrastructure struct { + + // The Compute Cloud@Customer infrastructure OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The infrastructure compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is + // used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Compute Cloud@Customer infrastructure creation date and time, using an RFC3339 formatted + // datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the Compute Cloud@Customer infrastructure. + LifecycleState CccInfrastructureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The Compute Cloud@Customer infrastructure short name. + // This cannot be changed once created. The + // short name is used to refer to the infrastructure in several contexts and is unique. + ShortName *string `mandatory:"false" json:"shortName"` + + // A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // The current connection state of the infrastructure. A user can only update + // it from REQUEST to READY or from any state back to REJECT. The system automatically + // handles the REJECT to REQUEST, READY to CONNECTED, or CONNECTED to DISCONNECTED transitions. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // A message describing the current connection state in more detail. + ConnectionDetails *string `mandatory:"false" json:"connectionDetails"` + + // Schedule used for upgrades. If no schedule is associated with the infrastructure, + // it can be updated at any time. + CccUpgradeScheduleId *string `mandatory:"false" json:"cccUpgradeScheduleId"` + + // Fingerprint of a Compute Cloud@Customer infrastructure in a data center generated + // during the initial connection to this resource. The fingerprint should be verified + // by the administrator when changing the connectionState from REQUEST to READY. + ProvisioningFingerprint *string `mandatory:"false" json:"provisioningFingerprint"` + + // Code that is required for service personnel to connect a + // Compute Cloud@Customer infrastructure in a data center to this resource. + // This code will only be available when the connectionState is REJECT (usually + // at create time of the Compute Cloud@Customer infrastructure). + ProvisioningPin *string `mandatory:"false" json:"provisioningPin"` + + // Compute Cloud@Customer infrastructure updated date and time, using an RFC3339 formatted + // datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message describing the current lifecycle state in more detail. + // For example, this can be used to provide actionable information for a resource that is in + // a Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + InfrastructureInventory *CccInfrastructureInventory `mandatory:"false" json:"infrastructureInventory"` + + InfrastructureNetworkConfiguration *CccInfrastructureNetworkConfiguration `mandatory:"false" json:"infrastructureNetworkConfiguration"` + + UpgradeInformation *CccUpgradeInformation `mandatory:"false" json:"upgradeInformation"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m CccInfrastructure) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructure) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccInfrastructureLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCccInfrastructureLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccInfrastructureConnectionStateEnum Enum with underlying type: string +type CccInfrastructureConnectionStateEnum string + +// Set of constants representing the allowable values for CccInfrastructureConnectionStateEnum +const ( + CccInfrastructureConnectionStateReject CccInfrastructureConnectionStateEnum = "REJECT" + CccInfrastructureConnectionStateRequest CccInfrastructureConnectionStateEnum = "REQUEST" + CccInfrastructureConnectionStateReady CccInfrastructureConnectionStateEnum = "READY" + CccInfrastructureConnectionStateConnected CccInfrastructureConnectionStateEnum = "CONNECTED" + CccInfrastructureConnectionStateDisconnected CccInfrastructureConnectionStateEnum = "DISCONNECTED" +) + +var mappingCccInfrastructureConnectionStateEnum = map[string]CccInfrastructureConnectionStateEnum{ + "REJECT": CccInfrastructureConnectionStateReject, + "REQUEST": CccInfrastructureConnectionStateRequest, + "READY": CccInfrastructureConnectionStateReady, + "CONNECTED": CccInfrastructureConnectionStateConnected, + "DISCONNECTED": CccInfrastructureConnectionStateDisconnected, +} + +var mappingCccInfrastructureConnectionStateEnumLowerCase = map[string]CccInfrastructureConnectionStateEnum{ + "reject": CccInfrastructureConnectionStateReject, + "request": CccInfrastructureConnectionStateRequest, + "ready": CccInfrastructureConnectionStateReady, + "connected": CccInfrastructureConnectionStateConnected, + "disconnected": CccInfrastructureConnectionStateDisconnected, +} + +// GetCccInfrastructureConnectionStateEnumValues Enumerates the set of values for CccInfrastructureConnectionStateEnum +func GetCccInfrastructureConnectionStateEnumValues() []CccInfrastructureConnectionStateEnum { + values := make([]CccInfrastructureConnectionStateEnum, 0) + for _, v := range mappingCccInfrastructureConnectionStateEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureConnectionStateEnumStringValues Enumerates the set of values in String for CccInfrastructureConnectionStateEnum +func GetCccInfrastructureConnectionStateEnumStringValues() []string { + return []string{ + "REJECT", + "REQUEST", + "READY", + "CONNECTED", + "DISCONNECTED", + } +} + +// GetMappingCccInfrastructureConnectionStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureConnectionStateEnum(val string) (CccInfrastructureConnectionStateEnum, bool) { + enum, ok := mappingCccInfrastructureConnectionStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// CccInfrastructureLifecycleStateEnum Enum with underlying type: string +type CccInfrastructureLifecycleStateEnum string + +// Set of constants representing the allowable values for CccInfrastructureLifecycleStateEnum +const ( + CccInfrastructureLifecycleStateActive CccInfrastructureLifecycleStateEnum = "ACTIVE" + CccInfrastructureLifecycleStateNeedsAttention CccInfrastructureLifecycleStateEnum = "NEEDS_ATTENTION" + CccInfrastructureLifecycleStateDeleted CccInfrastructureLifecycleStateEnum = "DELETED" + CccInfrastructureLifecycleStateFailed CccInfrastructureLifecycleStateEnum = "FAILED" +) + +var mappingCccInfrastructureLifecycleStateEnum = map[string]CccInfrastructureLifecycleStateEnum{ + "ACTIVE": CccInfrastructureLifecycleStateActive, + "NEEDS_ATTENTION": CccInfrastructureLifecycleStateNeedsAttention, + "DELETED": CccInfrastructureLifecycleStateDeleted, + "FAILED": CccInfrastructureLifecycleStateFailed, +} + +var mappingCccInfrastructureLifecycleStateEnumLowerCase = map[string]CccInfrastructureLifecycleStateEnum{ + "active": CccInfrastructureLifecycleStateActive, + "needs_attention": CccInfrastructureLifecycleStateNeedsAttention, + "deleted": CccInfrastructureLifecycleStateDeleted, + "failed": CccInfrastructureLifecycleStateFailed, +} + +// GetCccInfrastructureLifecycleStateEnumValues Enumerates the set of values for CccInfrastructureLifecycleStateEnum +func GetCccInfrastructureLifecycleStateEnumValues() []CccInfrastructureLifecycleStateEnum { + values := make([]CccInfrastructureLifecycleStateEnum, 0) + for _, v := range mappingCccInfrastructureLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureLifecycleStateEnumStringValues Enumerates the set of values in String for CccInfrastructureLifecycleStateEnum +func GetCccInfrastructureLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "NEEDS_ATTENTION", + "DELETED", + "FAILED", + } +} + +// GetMappingCccInfrastructureLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureLifecycleStateEnum(val string) (CccInfrastructureLifecycleStateEnum, bool) { + enum, ok := mappingCccInfrastructureLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/computecloudatcustomer/ccc_infrastructure_collection.go b/computecloudatcustomer/ccc_infrastructure_collection.go new file mode 100644 index 0000000000..a22f239e88 --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureCollection Results of a Compute Cloud@Customer infrastructure search. +type CccInfrastructureCollection struct { + + // List of Compute Cloud@Customer infrastructures. + Items []CccInfrastructureSummary `mandatory:"true" json:"items"` +} + +func (m CccInfrastructureCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructureCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_infrastructure_inventory.go b/computecloudatcustomer/ccc_infrastructure_inventory.go new file mode 100644 index 0000000000..b4a62f03f0 --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure_inventory.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureInventory Inventory for a Compute Cloud@Customer infrastructure. This information +// cannot be updated and is from the infrastructure. The information will only be available +// after the connectionState is transitioned to CONNECTED. +type CccInfrastructureInventory struct { + + // The serial number of the Compute Cloud@Customer infrastructure rack. + SerialNumber *string `mandatory:"false" json:"serialNumber"` + + // The number of management nodes that are available and in active use + // on the Compute Cloud@Customer infrastructure rack. + ManagementNodeCount *int `mandatory:"false" json:"managementNodeCount"` + + // The number of compute nodes that are available and usable + // on the Compute Cloud@Customer infrastructure rack. There is no distinction + // of compute node type in this information. + ComputeNodeCount *int `mandatory:"false" json:"computeNodeCount"` + + // The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for capacity storage. + CapacityStorageTrayCount *int `mandatory:"false" json:"capacityStorageTrayCount"` + + // The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for performance storage. + PerformanceStorageTrayCount *int `mandatory:"false" json:"performanceStorageTrayCount"` +} + +func (m CccInfrastructureInventory) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructureInventory) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_infrastructure_management_node.go b/computecloudatcustomer/ccc_infrastructure_management_node.go new file mode 100644 index 0000000000..5ce6f1049e --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure_management_node.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureManagementNode Information about an individual management node in a Compute Cloud@Customer infrastructure. +type CccInfrastructureManagementNode struct { + + // Address of the management node. + Ip *string `mandatory:"false" json:"ip"` + + // Hostname for interface to the management node. + Hostname *string `mandatory:"false" json:"hostname"` +} + +func (m CccInfrastructureManagementNode) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructureManagementNode) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_infrastructure_network_configuration.go b/computecloudatcustomer/ccc_infrastructure_network_configuration.go new file mode 100644 index 0000000000..76bc159899 --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure_network_configuration.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureNetworkConfiguration Configuration information for the Compute Cloud@Customer infrastructure. This +// network configuration information cannot be updated and is retrieved from the data center. +// The information will only be available +// after the connectionState is transitioned to CONNECTED. +type CccInfrastructureNetworkConfiguration struct { + + // Information about the management nodes that are provisioned in the Compute Cloud@Customer + // infrastructure. + ManagementNodes []CccInfrastructureManagementNode `mandatory:"false" json:"managementNodes"` + + // Uplink port speed defined in gigabytes per second. + // All uplink ports must have identical speed. + UplinkPortSpeedInGbps *int `mandatory:"false" json:"uplinkPortSpeedInGbps"` + + // Number of uplink ports per spine switch. Connectivity is identical on both spine switches. + // For example, if input is two 100 gigabyte ports; then port-1 and port-2 on both spines will be configured. + UplinkPortCount *int `mandatory:"false" json:"uplinkPortCount"` + + // The virtual local area network (VLAN) maximum transmission unit (MTU) size + // for the uplink ports. + UplinkVlanMtu *int `mandatory:"false" json:"uplinkVlanMtu"` + + // Netmask of the subnet that the Compute Cloud@Customer infrastructure is + // connected to. + UplinkNetmask *string `mandatory:"false" json:"uplinkNetmask"` + + // The port forward error correction (FEC) setting for the uplink port on the + // Compute Cloud@Customer infrastructure. + UplinkPortForwardErrorCorrection CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum `mandatory:"false" json:"uplinkPortForwardErrorCorrection,omitempty"` + + // Domain name to be used as the base domain for the internal network and by + // public facing services. + UplinkDomain *string `mandatory:"false" json:"uplinkDomain"` + + // Uplink gateway in the datacenter network that the Compute Cloud@Customer + // connects to. + UplinkGatewayIp *string `mandatory:"false" json:"uplinkGatewayIp"` + + // Addresses of the network spine switches. + SpineIps []string `mandatory:"false" json:"spineIps"` + + // The spine switch public virtual IP (VIP). Traffic routed to the + // Compute Cloud@Customer infrastructure and + // and virtual cloud networks (VCNs) should have this address as next hop. + SpineVip *string `mandatory:"false" json:"spineVip"` + + // The hostname corresponding to the virtual IP (VIP) address of the management nodes. + MgmtVipHostname *string `mandatory:"false" json:"mgmtVipHostname"` + + // The IP address used as the virtual IP (VIP) address of the management nodes. + MgmtVipIp *string `mandatory:"false" json:"mgmtVipIp"` + + // The domain name system (DNS) addresses that the Compute Cloud@Customer infrastructure + // uses for the data center network. + DnsIps []string `mandatory:"false" json:"dnsIps"` + + InfrastructureRoutingStatic *CccInfrastructureRoutingStaticDetails `mandatory:"false" json:"infrastructureRoutingStatic"` + + InfrastructureRoutingDynamic *CccInfrastructureRoutingDynamicDetails `mandatory:"false" json:"infrastructureRoutingDynamic"` +} + +func (m CccInfrastructureNetworkConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructureNetworkConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum(string(m.UplinkPortForwardErrorCorrection)); !ok && m.UplinkPortForwardErrorCorrection != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UplinkPortForwardErrorCorrection: %s. Supported values are: %s.", m.UplinkPortForwardErrorCorrection, strings.Join(GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum Enum with underlying type: string +type CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum string + +// Set of constants representing the allowable values for CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum +const ( + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionAuto CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "AUTO" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionFireCodeFec CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "FIRE_CODE_FEC" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonConsortium16 CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "REED_SOLOMON_CONSORTIUM_16" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonFec CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "REED_SOLOMON_FEC" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonIeee CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "REED_SOLOMON_IEEE" +) + +var mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = map[string]CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum{ + "AUTO": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionAuto, + "FIRE_CODE_FEC": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionFireCodeFec, + "REED_SOLOMON_CONSORTIUM_16": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonConsortium16, + "REED_SOLOMON_FEC": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonFec, + "REED_SOLOMON_IEEE": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonIeee, +} + +var mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumLowerCase = map[string]CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum{ + "auto": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionAuto, + "fire_code_fec": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionFireCodeFec, + "reed_solomon_consortium_16": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonConsortium16, + "reed_solomon_fec": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonFec, + "reed_solomon_ieee": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonIeee, +} + +// GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumValues Enumerates the set of values for CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum +func GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumValues() []CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum { + values := make([]CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum, 0) + for _, v := range mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumStringValues Enumerates the set of values in String for CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum +func GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumStringValues() []string { + return []string{ + "AUTO", + "FIRE_CODE_FEC", + "REED_SOLOMON_CONSORTIUM_16", + "REED_SOLOMON_FEC", + "REED_SOLOMON_IEEE", + } +} + +// GetMappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum(val string) (CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum, bool) { + enum, ok := mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go b/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go new file mode 100644 index 0000000000..f7eec920d4 --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureRoutingDynamicDetails Dynamic routing information for the Compute Cloud@Customer infrastructure. +type CccInfrastructureRoutingDynamicDetails struct { + + // The list of peer devices in the dynamic routing configuration. + PeerInformation []PeerInformation `mandatory:"false" json:"peerInformation"` + + // The Oracle Autonomous System Number (ASN) to control routing and exchange information + // within the dynamic routing configuration. + OracleAsn *int `mandatory:"false" json:"oracleAsn"` + + // The topology in use for the Border Gateway Protocol (BGP) configuration. + BgpTopology CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum `mandatory:"false" json:"bgpTopology,omitempty"` +} + +func (m CccInfrastructureRoutingDynamicDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructureRoutingDynamicDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum(string(m.BgpTopology)); !ok && m.BgpTopology != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BgpTopology: %s. Supported values are: %s.", m.BgpTopology, strings.Join(GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum Enum with underlying type: string +type CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum string + +// Set of constants representing the allowable values for CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum +const ( + CccInfrastructureRoutingDynamicDetailsBgpTopologyTriangle CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = "TRIANGLE" + CccInfrastructureRoutingDynamicDetailsBgpTopologySquare CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = "SQUARE" + CccInfrastructureRoutingDynamicDetailsBgpTopologyMesh CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = "MESH" +) + +var mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = map[string]CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum{ + "TRIANGLE": CccInfrastructureRoutingDynamicDetailsBgpTopologyTriangle, + "SQUARE": CccInfrastructureRoutingDynamicDetailsBgpTopologySquare, + "MESH": CccInfrastructureRoutingDynamicDetailsBgpTopologyMesh, +} + +var mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumLowerCase = map[string]CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum{ + "triangle": CccInfrastructureRoutingDynamicDetailsBgpTopologyTriangle, + "square": CccInfrastructureRoutingDynamicDetailsBgpTopologySquare, + "mesh": CccInfrastructureRoutingDynamicDetailsBgpTopologyMesh, +} + +// GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumValues Enumerates the set of values for CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum +func GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumValues() []CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum { + values := make([]CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum, 0) + for _, v := range mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumStringValues Enumerates the set of values in String for CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum +func GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumStringValues() []string { + return []string{ + "TRIANGLE", + "SQUARE", + "MESH", + } +} + +// GetMappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum(val string) (CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum, bool) { + enum, ok := mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/computecloudatcustomer/ccc_infrastructure_routing_static_details.go b/computecloudatcustomer/ccc_infrastructure_routing_static_details.go new file mode 100644 index 0000000000..f1fee10e18 --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure_routing_static_details.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureRoutingStaticDetails Static routing information for a rack. +type CccInfrastructureRoutingStaticDetails struct { + + // The virtual local area network (VLAN) identifier used to connect to the uplink + // (only access mode is supported). + UplinkVlan *int `mandatory:"false" json:"uplinkVlan"` + + // The uplink Hot Standby Router Protocol (HSRP) group value for the switch in the + // Compute Cloud@Customer infrastructure. + UplinkHsrpGroup *int `mandatory:"false" json:"uplinkHsrpGroup"` +} + +func (m CccInfrastructureRoutingStaticDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructureRoutingStaticDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_infrastructure_summary.go b/computecloudatcustomer/ccc_infrastructure_summary.go new file mode 100644 index 0000000000..3f4038f806 --- /dev/null +++ b/computecloudatcustomer/ccc_infrastructure_summary.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureSummary Summary information about a Compute Cloud@Customer infrastructure. +type CccInfrastructureSummary struct { + + // The Compute Cloud@Customer infrastructure + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with + // the infrastructure. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is + // used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Compute Cloud@Customer infrastructure creation date and time. An RFC3339 formatted + // datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the Compute Cloud@Customer infrastructure. + LifecycleState CccInfrastructureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The Compute Cloud@Customer infrastructure short name. This is generated at + // the time the resource is created and cannot be changed. The short name can be + // used when communicating with Oracle Service and may be used during the configuration + // of the data center network. + ShortName *string `mandatory:"false" json:"shortName"` + + // The current connection state of the infrastructure. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m CccInfrastructureSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccInfrastructureSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccInfrastructureLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCccInfrastructureLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_schedule_event.go b/computecloudatcustomer/ccc_schedule_event.go new file mode 100644 index 0000000000..bc5ed99fd3 --- /dev/null +++ b/computecloudatcustomer/ccc_schedule_event.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccScheduleEvent A period where upgrades may be applied to Compute Cloud@Customer infrastructures +// associated with the schedule. All upgrade windows may not be used. +type CccScheduleEvent struct { + + // Generated name associated with the event. + Name *string `mandatory:"true" json:"name"` + + // A description of the Compute Cloud@Customer upgrade schedule time block. + Description *string `mandatory:"true" json:"description"` + + // The date and time when the Compute Cloud@Customer upgrade schedule event starts, + // inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, + // this is the date that a recurrence can start being applied. + TimeStart *common.SDKTime `mandatory:"true" json:"timeStart"` + + // The duration of this block of time. The duration must be specified and be of the + // ISO-8601 format for durations. + ScheduleEventDuration *string `mandatory:"true" json:"scheduleEventDuration"` + + // Frequency of recurrence of schedule block. When this field is not included, the event + // is assumed to be a one time occurrence. The frequency field is strictly parsed and must + // conform to RFC-5545 formatting for recurrences. + ScheduleEventRecurrences *string `mandatory:"false" json:"scheduleEventRecurrences"` +} + +func (m CccScheduleEvent) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccScheduleEvent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_upgrade_information.go b/computecloudatcustomer/ccc_upgrade_information.go new file mode 100644 index 0000000000..4d46ef32cf --- /dev/null +++ b/computecloudatcustomer/ccc_upgrade_information.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeInformation Upgrade information that relates to a Compute Cloud@Customer infrastructure. This information +// cannot be updated. +type CccUpgradeInformation struct { + + // The current version of software installed on the Compute Cloud@Customer infrastructure. + CurrentVersion *string `mandatory:"false" json:"currentVersion"` + + // Compute Cloud@Customer infrastructure next upgrade time. The rack might have performance + // impacts during this time. + TimeOfScheduledUpgrade *common.SDKTime `mandatory:"false" json:"timeOfScheduledUpgrade"` + + // Expected duration of Compute Cloud@Customer infrastructure scheduled upgrade. The actual + // upgrade time might be longer or shorter than this duration depending on rack activity, this + // is only an estimate. + ScheduledUpgradeDuration *string `mandatory:"false" json:"scheduledUpgradeDuration"` + + // Indication that the Compute Cloud@Customer infrastructure is in the process of + // an upgrade or an upgrade activity (such as preloading upgrade images). + IsActive *bool `mandatory:"false" json:"isActive"` +} + +func (m CccUpgradeInformation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccUpgradeInformation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_upgrade_schedule.go b/computecloudatcustomer/ccc_upgrade_schedule.go new file mode 100644 index 0000000000..ac0cf0f063 --- /dev/null +++ b/computecloudatcustomer/ccc_upgrade_schedule.go @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeSchedule Defines a schedule for preferred upgrade times. +type CccUpgradeSchedule struct { + + // Upgrade schedule OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the + // Compute Cloud@Customer upgrade schedule. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the upgrade schedule was created, using an RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Lifecycle state of the resource. + LifecycleState CccUpgradeScheduleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // An optional description of the Compute Cloud@Customer upgrade schedule. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // The time the upgrade schedule was updated, using an RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message describing the current state in more detail. + // For example, the message can be used to provide actionable information for a resource in + // a Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // List of preferred times for Compute Cloud@Customer infrastructures associated with this + // schedule to be upgraded. + Events []CccScheduleEvent `mandatory:"false" json:"events"` + + // List of Compute Cloud@Customer infrastructure + // OCIDs (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) that are using this upgrade + // schedule. + InfrastructureIds []string `mandatory:"false" json:"infrastructureIds"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m CccUpgradeSchedule) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccUpgradeSchedule) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccUpgradeScheduleLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCccUpgradeScheduleLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccUpgradeScheduleLifecycleStateEnum Enum with underlying type: string +type CccUpgradeScheduleLifecycleStateEnum string + +// Set of constants representing the allowable values for CccUpgradeScheduleLifecycleStateEnum +const ( + CccUpgradeScheduleLifecycleStateActive CccUpgradeScheduleLifecycleStateEnum = "ACTIVE" + CccUpgradeScheduleLifecycleStateNeedsAttention CccUpgradeScheduleLifecycleStateEnum = "NEEDS_ATTENTION" + CccUpgradeScheduleLifecycleStateDeleted CccUpgradeScheduleLifecycleStateEnum = "DELETED" + CccUpgradeScheduleLifecycleStateFailed CccUpgradeScheduleLifecycleStateEnum = "FAILED" +) + +var mappingCccUpgradeScheduleLifecycleStateEnum = map[string]CccUpgradeScheduleLifecycleStateEnum{ + "ACTIVE": CccUpgradeScheduleLifecycleStateActive, + "NEEDS_ATTENTION": CccUpgradeScheduleLifecycleStateNeedsAttention, + "DELETED": CccUpgradeScheduleLifecycleStateDeleted, + "FAILED": CccUpgradeScheduleLifecycleStateFailed, +} + +var mappingCccUpgradeScheduleLifecycleStateEnumLowerCase = map[string]CccUpgradeScheduleLifecycleStateEnum{ + "active": CccUpgradeScheduleLifecycleStateActive, + "needs_attention": CccUpgradeScheduleLifecycleStateNeedsAttention, + "deleted": CccUpgradeScheduleLifecycleStateDeleted, + "failed": CccUpgradeScheduleLifecycleStateFailed, +} + +// GetCccUpgradeScheduleLifecycleStateEnumValues Enumerates the set of values for CccUpgradeScheduleLifecycleStateEnum +func GetCccUpgradeScheduleLifecycleStateEnumValues() []CccUpgradeScheduleLifecycleStateEnum { + values := make([]CccUpgradeScheduleLifecycleStateEnum, 0) + for _, v := range mappingCccUpgradeScheduleLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetCccUpgradeScheduleLifecycleStateEnumStringValues Enumerates the set of values in String for CccUpgradeScheduleLifecycleStateEnum +func GetCccUpgradeScheduleLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "NEEDS_ATTENTION", + "DELETED", + "FAILED", + } +} + +// GetMappingCccUpgradeScheduleLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccUpgradeScheduleLifecycleStateEnum(val string) (CccUpgradeScheduleLifecycleStateEnum, bool) { + enum, ok := mappingCccUpgradeScheduleLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/computecloudatcustomer/ccc_upgrade_schedule_collection.go b/computecloudatcustomer/ccc_upgrade_schedule_collection.go new file mode 100644 index 0000000000..6ff19c89b5 --- /dev/null +++ b/computecloudatcustomer/ccc_upgrade_schedule_collection.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeScheduleCollection Results of a Compute Cloud@Customer upgrade schedule search. +// Contains the summary items and other information, +// such as metadata. +type CccUpgradeScheduleCollection struct { + + // List of Compute Cloud@Customer upgrade schedules. + Items []CccUpgradeScheduleSummary `mandatory:"true" json:"items"` +} + +func (m CccUpgradeScheduleCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccUpgradeScheduleCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/ccc_upgrade_schedule_summary.go b/computecloudatcustomer/ccc_upgrade_schedule_summary.go new file mode 100644 index 0000000000..ce0299e48c --- /dev/null +++ b/computecloudatcustomer/ccc_upgrade_schedule_summary.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeScheduleSummary Basic information about a Compute Cloud@Customer schedule. This summary +// only includes high level resource information, not the schedule events. +type CccUpgradeScheduleSummary struct { + + // The upgrade schedule OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering any confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the + // Compute Cloud@Customer Upgrade Schedule. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the upgrade schedule was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the Compute Cloud@Customer + // upgrade schedule. + LifecycleState CccUpgradeScheduleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m CccUpgradeScheduleSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CccUpgradeScheduleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccUpgradeScheduleLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCccUpgradeScheduleLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go b/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go new file mode 100644 index 0000000000..93722370d2 --- /dev/null +++ b/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeCccInfrastructureCompartmentDetails Information required for the compartment change operation. +type ChangeCccInfrastructureCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment + // into which the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeCccInfrastructureCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeCccInfrastructureCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/change_ccc_infrastructure_compartment_request_response.go b/computecloudatcustomer/change_ccc_infrastructure_compartment_request_response.go new file mode 100644 index 0000000000..f5e9bd1ed3 --- /dev/null +++ b/computecloudatcustomer/change_ccc_infrastructure_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeCccInfrastructureCompartmentRequest wrapper for the ChangeCccInfrastructureCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccInfrastructureCompartment.go.html to see an example of how to use ChangeCccInfrastructureCompartmentRequest. +type ChangeCccInfrastructureCompartmentRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // Details about the compartment change operation including the destination compartment + // specified by the resource OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + ChangeCccInfrastructureCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeCccInfrastructureCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeCccInfrastructureCompartmentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ChangeCccInfrastructureCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeCccInfrastructureCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ChangeCccInfrastructureCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeCccInfrastructureCompartmentResponse wrapper for the ChangeCccInfrastructureCompartment operation +type ChangeCccInfrastructureCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeCccInfrastructureCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeCccInfrastructureCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go b/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go new file mode 100644 index 0000000000..d17ff1aa7e --- /dev/null +++ b/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeCccUpgradeScheduleCompartmentDetails Change the compartment of a Compute Cloud@Customer upgrade schedule. +type ChangeCccUpgradeScheduleCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment + // into which the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeCccUpgradeScheduleCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeCccUpgradeScheduleCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_request_response.go b/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_request_response.go new file mode 100644 index 0000000000..ba39626704 --- /dev/null +++ b/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeCccUpgradeScheduleCompartmentRequest wrapper for the ChangeCccUpgradeScheduleCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccUpgradeScheduleCompartment.go.html to see an example of how to use ChangeCccUpgradeScheduleCompartmentRequest. +type ChangeCccUpgradeScheduleCompartmentRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // Details about the compartment change operation including the destination compartment + // specified by the resource OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + ChangeCccUpgradeScheduleCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeCccUpgradeScheduleCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeCccUpgradeScheduleCompartmentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ChangeCccUpgradeScheduleCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeCccUpgradeScheduleCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ChangeCccUpgradeScheduleCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeCccUpgradeScheduleCompartmentResponse wrapper for the ChangeCccUpgradeScheduleCompartment operation +type ChangeCccUpgradeScheduleCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeCccUpgradeScheduleCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeCccUpgradeScheduleCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/computecloudatcustomer_client.go b/computecloudatcustomer/computecloudatcustomer_client.go new file mode 100644 index 0000000000..d3357fcd52 --- /dev/null +++ b/computecloudatcustomer/computecloudatcustomer_client.go @@ -0,0 +1,812 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ComputeCloudAtCustomerClient a client for ComputeCloudAtCustomer +type ComputeCloudAtCustomerClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewComputeCloudAtCustomerClientWithConfigurationProvider Creates a new default ComputeCloudAtCustomer client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewComputeCloudAtCustomerClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ComputeCloudAtCustomerClient, err error) { + if enabled := common.CheckForEnabledServices("computecloudatcustomer"); !enabled { + return client, fmt.Errorf("the Alloy configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local alloy_config file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newComputeCloudAtCustomerClientFromBaseClient(baseClient, provider) +} + +// NewComputeCloudAtCustomerClientWithOboToken Creates a new default ComputeCloudAtCustomer client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewComputeCloudAtCustomerClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ComputeCloudAtCustomerClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newComputeCloudAtCustomerClientFromBaseClient(baseClient, configProvider) +} + +func newComputeCloudAtCustomerClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ComputeCloudAtCustomerClient, err error) { + // ComputeCloudAtCustomer service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ComputeCloudAtCustomer")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ComputeCloudAtCustomerClient{BaseClient: baseClient} + client.BasePath = "20221208" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ComputeCloudAtCustomerClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("computecloudatcustomer", "https://ccc.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ComputeCloudAtCustomerClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ComputeCloudAtCustomerClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ChangeCccInfrastructureCompartment Moves a Compute Cloud@Customer infrastructure resource from one compartment to another. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccInfrastructureCompartment.go.html to see an example of how to use ChangeCccInfrastructureCompartment API. +// A default retry strategy applies to this operation ChangeCccInfrastructureCompartment() +func (client ComputeCloudAtCustomerClient) ChangeCccInfrastructureCompartment(ctx context.Context, request ChangeCccInfrastructureCompartmentRequest) (response ChangeCccInfrastructureCompartmentResponse, 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.changeCccInfrastructureCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeCccInfrastructureCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeCccInfrastructureCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeCccInfrastructureCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeCccInfrastructureCompartmentResponse") + } + return +} + +// changeCccInfrastructureCompartment implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) changeCccInfrastructureCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccInfrastructures/{cccInfrastructureId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeCccInfrastructureCompartmentResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/ChangeCccInfrastructureCompartment" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ChangeCccInfrastructureCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeCccUpgradeScheduleCompartment Moves a Compute Cloud@Customer upgrade schedule from one compartment to another using the +// specified OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccUpgradeScheduleCompartment.go.html to see an example of how to use ChangeCccUpgradeScheduleCompartment API. +// A default retry strategy applies to this operation ChangeCccUpgradeScheduleCompartment() +func (client ComputeCloudAtCustomerClient) ChangeCccUpgradeScheduleCompartment(ctx context.Context, request ChangeCccUpgradeScheduleCompartmentRequest) (response ChangeCccUpgradeScheduleCompartmentResponse, 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.changeCccUpgradeScheduleCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeCccUpgradeScheduleCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeCccUpgradeScheduleCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeCccUpgradeScheduleCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeCccUpgradeScheduleCompartmentResponse") + } + return +} + +// changeCccUpgradeScheduleCompartment implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) changeCccUpgradeScheduleCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccUpgradeSchedules/{cccUpgradeScheduleId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeCccUpgradeScheduleCompartmentResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/ChangeCccUpgradeScheduleCompartment" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ChangeCccUpgradeScheduleCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateCccInfrastructure Creates a Compute Cloud@Customer infrastructure. Once created, Oracle Services +// must connect the rack in the data center to this Oracle Cloud Infrastructure resource. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccInfrastructure.go.html to see an example of how to use CreateCccInfrastructure API. +// A default retry strategy applies to this operation CreateCccInfrastructure() +func (client ComputeCloudAtCustomerClient) CreateCccInfrastructure(ctx context.Context, request CreateCccInfrastructureRequest) (response CreateCccInfrastructureResponse, 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.createCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCccInfrastructureResponse") + } + return +} + +// createCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) createCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccInfrastructures", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/CreateCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "CreateCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateCccUpgradeSchedule Creates a new Compute Cloud@Customer upgrade schedule. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccUpgradeSchedule.go.html to see an example of how to use CreateCccUpgradeSchedule API. +// A default retry strategy applies to this operation CreateCccUpgradeSchedule() +func (client ComputeCloudAtCustomerClient) CreateCccUpgradeSchedule(ctx context.Context, request CreateCccUpgradeScheduleRequest) (response CreateCccUpgradeScheduleResponse, 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.createCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCccUpgradeScheduleResponse") + } + return +} + +// createCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) createCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccUpgradeSchedules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/CreateCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "CreateCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteCccInfrastructure Deletes a Compute Cloud@Customer infrastructure resource specified by the resource +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccInfrastructure.go.html to see an example of how to use DeleteCccInfrastructure API. +func (client ComputeCloudAtCustomerClient) DeleteCccInfrastructure(ctx context.Context, request DeleteCccInfrastructureRequest) (response DeleteCccInfrastructureResponse, 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.deleteCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCccInfrastructureResponse") + } + return +} + +// deleteCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) deleteCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/cccInfrastructures/{cccInfrastructureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/DeleteCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "DeleteCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteCccUpgradeSchedule Deletes a Compute Cloud@Customer upgrade schedule by the specified +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccUpgradeSchedule.go.html to see an example of how to use DeleteCccUpgradeSchedule API. +func (client ComputeCloudAtCustomerClient) DeleteCccUpgradeSchedule(ctx context.Context, request DeleteCccUpgradeScheduleRequest) (response DeleteCccUpgradeScheduleResponse, 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.deleteCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCccUpgradeScheduleResponse") + } + return +} + +// deleteCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) deleteCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/cccUpgradeSchedules/{cccUpgradeScheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/DeleteCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "DeleteCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCccInfrastructure Gets a Compute Cloud@Customer infrastructure using the infrastructure +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccInfrastructure.go.html to see an example of how to use GetCccInfrastructure API. +// A default retry strategy applies to this operation GetCccInfrastructure() +func (client ComputeCloudAtCustomerClient) GetCccInfrastructure(ctx context.Context, request GetCccInfrastructureRequest) (response GetCccInfrastructureResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCccInfrastructureResponse") + } + return +} + +// getCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) getCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccInfrastructures/{cccInfrastructureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/GetCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "GetCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCccUpgradeSchedule Gets a Compute Cloud@Customer upgrade schedule by the specified +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccUpgradeSchedule.go.html to see an example of how to use GetCccUpgradeSchedule API. +// A default retry strategy applies to this operation GetCccUpgradeSchedule() +func (client ComputeCloudAtCustomerClient) GetCccUpgradeSchedule(ctx context.Context, request GetCccUpgradeScheduleRequest) (response GetCccUpgradeScheduleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCccUpgradeScheduleResponse") + } + return +} + +// getCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) getCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccUpgradeSchedules/{cccUpgradeScheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/GetCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "GetCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCccInfrastructures Returns a list of Compute Cloud@Customer infrastructures. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccInfrastructures.go.html to see an example of how to use ListCccInfrastructures API. +// A default retry strategy applies to this operation ListCccInfrastructures() +func (client ComputeCloudAtCustomerClient) ListCccInfrastructures(ctx context.Context, request ListCccInfrastructuresRequest) (response ListCccInfrastructuresResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCccInfrastructures, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCccInfrastructuresResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCccInfrastructuresResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCccInfrastructuresResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCccInfrastructuresResponse") + } + return +} + +// listCccInfrastructures implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) listCccInfrastructures(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccInfrastructures", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCccInfrastructuresResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructureCollection/ListCccInfrastructures" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ListCccInfrastructures", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCccUpgradeSchedules Returns a list of Compute Cloud@Customer upgrade schedules. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccUpgradeSchedules.go.html to see an example of how to use ListCccUpgradeSchedules API. +// A default retry strategy applies to this operation ListCccUpgradeSchedules() +func (client ComputeCloudAtCustomerClient) ListCccUpgradeSchedules(ctx context.Context, request ListCccUpgradeSchedulesRequest) (response ListCccUpgradeSchedulesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCccUpgradeSchedules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCccUpgradeSchedulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCccUpgradeSchedulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCccUpgradeSchedulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCccUpgradeSchedulesResponse") + } + return +} + +// listCccUpgradeSchedules implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) listCccUpgradeSchedules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccUpgradeSchedules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCccUpgradeSchedulesResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeScheduleCollection/ListCccUpgradeSchedules" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ListCccUpgradeSchedules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCccInfrastructure Updates Compute Cloud@Customer infrastructure resource. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccInfrastructure.go.html to see an example of how to use UpdateCccInfrastructure API. +func (client ComputeCloudAtCustomerClient) UpdateCccInfrastructure(ctx context.Context, request UpdateCccInfrastructureRequest) (response UpdateCccInfrastructureResponse, 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.updateCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCccInfrastructureResponse") + } + return +} + +// updateCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) updateCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/cccInfrastructures/{cccInfrastructureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/UpdateCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "UpdateCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCccUpgradeSchedule Updates the Compute Cloud@Customer upgrade schedule. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccUpgradeSchedule.go.html to see an example of how to use UpdateCccUpgradeSchedule API. +func (client ComputeCloudAtCustomerClient) UpdateCccUpgradeSchedule(ctx context.Context, request UpdateCccUpgradeScheduleRequest) (response UpdateCccUpgradeScheduleResponse, 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.updateCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCccUpgradeScheduleResponse") + } + return +} + +// updateCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) updateCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/cccUpgradeSchedules/{cccUpgradeScheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/UpdateCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "UpdateCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/computecloudatcustomer/create_ccc_infrastructure_details.go b/computecloudatcustomer/create_ccc_infrastructure_details.go new file mode 100644 index 0000000000..404d58726c --- /dev/null +++ b/computecloudatcustomer/create_ccc_infrastructure_details.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCccInfrastructureDetails The configuration details for creating Compute Cloud@Customer infrastructure. +type CreateCccInfrastructureDetails struct { + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with + // the infrastructure. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Identifier for network subnet that will be used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // The current connection state of the Compute Cloud@Customer infrastructure. This value + // will default to REJECT if the value is not provided. The only valid value at creation + // time is REJECT. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // A message describing the current connection state in more detail. + ConnectionDetails *string `mandatory:"false" json:"connectionDetails"` + + // Schedule used for upgrades. If no schedule is associated with the infrastructure, + // it can be upgraded at any time. + CccUpgradeScheduleId *string `mandatory:"false" json:"cccUpgradeScheduleId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateCccInfrastructureDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateCccInfrastructureDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/create_ccc_infrastructure_request_response.go b/computecloudatcustomer/create_ccc_infrastructure_request_response.go new file mode 100644 index 0000000000..330dae4428 --- /dev/null +++ b/computecloudatcustomer/create_ccc_infrastructure_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateCccInfrastructureRequest wrapper for the CreateCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccInfrastructure.go.html to see an example of how to use CreateCccInfrastructureRequest. +type CreateCccInfrastructureRequest struct { + + // Details for the new CccInfrastructure. + CreateCccInfrastructureDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateCccInfrastructureRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCccInfrastructureRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateCccInfrastructureResponse wrapper for the CreateCccInfrastructure operation +type CreateCccInfrastructureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccInfrastructure instance + CccInfrastructure `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/create_ccc_schedule_event.go b/computecloudatcustomer/create_ccc_schedule_event.go new file mode 100644 index 0000000000..cb4f8acbe1 --- /dev/null +++ b/computecloudatcustomer/create_ccc_schedule_event.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCccScheduleEvent A period where upgrades may be applied to Compute Cloud@Customer infrastructures +// associated with the schedule. All upgrade windows may not be used. +type CreateCccScheduleEvent struct { + + // A description of the Compute Cloud@Customer upgrade schedule time block. + Description *string `mandatory:"true" json:"description"` + + // The date and time when the Compute Cloud@Customer upgrade schedule event starts, + // inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, + // this is the date that a recurrence can start being applied. + TimeStart *common.SDKTime `mandatory:"true" json:"timeStart"` + + // The duration of this block of time. The duration must be specified and be of the + // ISO-8601 format for durations. + ScheduleEventDuration *string `mandatory:"true" json:"scheduleEventDuration"` + + // Frequency of recurrence of schedule block. When this field is not included, the event + // is assumed to be a one time occurrence. The frequency field is strictly parsed and must + // conform to RFC-5545 formatting for recurrences. + ScheduleEventRecurrences *string `mandatory:"false" json:"scheduleEventRecurrences"` +} + +func (m CreateCccScheduleEvent) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateCccScheduleEvent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/create_ccc_upgrade_schedule_details.go b/computecloudatcustomer/create_ccc_upgrade_schedule_details.go new file mode 100644 index 0000000000..bf77c11389 --- /dev/null +++ b/computecloudatcustomer/create_ccc_upgrade_schedule_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCccUpgradeScheduleDetails Defines a schedule for times when automated Compute Cloud@Customer upgrades are preferred. +// A created upgrade schedule must supply events with a minimum frequency and duration or +// the schedule will be rejected. Upgrades may impact performance of +// Compute Cloud@Customer infrastructures when they are being applied. +type CreateCccUpgradeScheduleDetails struct { + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the + // Compute Cloud@Customer Upgrade Schedule. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // List of preferred times for Compute Cloud@Customer infrastructure to be upgraded. + Events []CreateCccScheduleEvent `mandatory:"true" json:"events"` + + // An optional description of the Compute Cloud@Customer upgrade schedule. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateCccUpgradeScheduleDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateCccUpgradeScheduleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/create_ccc_upgrade_schedule_request_response.go b/computecloudatcustomer/create_ccc_upgrade_schedule_request_response.go new file mode 100644 index 0000000000..07628d58e8 --- /dev/null +++ b/computecloudatcustomer/create_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateCccUpgradeScheduleRequest wrapper for the CreateCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccUpgradeSchedule.go.html to see an example of how to use CreateCccUpgradeScheduleRequest. +type CreateCccUpgradeScheduleRequest struct { + + // Details for the new CCC Upgrade Schedule. + CreateCccUpgradeScheduleDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateCccUpgradeScheduleRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCccUpgradeScheduleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateCccUpgradeScheduleResponse wrapper for the CreateCccUpgradeSchedule operation +type CreateCccUpgradeScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccUpgradeSchedule instance + CccUpgradeSchedule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/delete_ccc_infrastructure_request_response.go b/computecloudatcustomer/delete_ccc_infrastructure_request_response.go new file mode 100644 index 0000000000..520599cff4 --- /dev/null +++ b/computecloudatcustomer/delete_ccc_infrastructure_request_response.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteCccInfrastructureRequest wrapper for the DeleteCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccInfrastructure.go.html to see an example of how to use DeleteCccInfrastructureRequest. +type DeleteCccInfrastructureRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCccInfrastructureRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCccInfrastructureRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteCccInfrastructureResponse wrapper for the DeleteCccInfrastructure operation +type DeleteCccInfrastructureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/delete_ccc_upgrade_schedule_request_response.go b/computecloudatcustomer/delete_ccc_upgrade_schedule_request_response.go new file mode 100644 index 0000000000..e5880c6f19 --- /dev/null +++ b/computecloudatcustomer/delete_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteCccUpgradeScheduleRequest wrapper for the DeleteCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccUpgradeSchedule.go.html to see an example of how to use DeleteCccUpgradeScheduleRequest. +type DeleteCccUpgradeScheduleRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCccUpgradeScheduleRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCccUpgradeScheduleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteCccUpgradeScheduleResponse wrapper for the DeleteCccUpgradeSchedule operation +type DeleteCccUpgradeScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/get_ccc_infrastructure_request_response.go b/computecloudatcustomer/get_ccc_infrastructure_request_response.go new file mode 100644 index 0000000000..b0cb0e7328 --- /dev/null +++ b/computecloudatcustomer/get_ccc_infrastructure_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCccInfrastructureRequest wrapper for the GetCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccInfrastructure.go.html to see an example of how to use GetCccInfrastructureRequest. +type GetCccInfrastructureRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCccInfrastructureRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCccInfrastructureRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCccInfrastructureResponse wrapper for the GetCccInfrastructure operation +type GetCccInfrastructureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccInfrastructure instance + CccInfrastructure `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/get_ccc_upgrade_schedule_request_response.go b/computecloudatcustomer/get_ccc_upgrade_schedule_request_response.go new file mode 100644 index 0000000000..8fe59f227a --- /dev/null +++ b/computecloudatcustomer/get_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCccUpgradeScheduleRequest wrapper for the GetCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccUpgradeSchedule.go.html to see an example of how to use GetCccUpgradeScheduleRequest. +type GetCccUpgradeScheduleRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCccUpgradeScheduleRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCccUpgradeScheduleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCccUpgradeScheduleResponse wrapper for the GetCccUpgradeSchedule operation +type GetCccUpgradeScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccUpgradeSchedule instance + CccUpgradeSchedule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/list_ccc_infrastructures_request_response.go b/computecloudatcustomer/list_ccc_infrastructures_request_response.go new file mode 100644 index 0000000000..f478f36086 --- /dev/null +++ b/computecloudatcustomer/list_ccc_infrastructures_request_response.go @@ -0,0 +1,276 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCccInfrastructuresRequest wrapper for the ListCccInfrastructures operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccInfrastructures.go.html to see an example of how to use ListCccInfrastructuresRequest. +type ListCccInfrastructuresRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to + // list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Default is false. + // When set to true, the hierarchy of compartments is traversed and all compartments and + // sub-compartments in the tenancy are returned. Depends on the 'accessLevel' setting. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. + // Setting this to ACCESSIBLE returns only those compartments for which the + // user has INSPECT permissions directly or indirectly (permissions can be on a + // resource in a subcompartment). When set to RESTRICTED permissions are checked and no + // partial results are displayed. + AccessLevel ListCccInfrastructuresAccessLevelEnum `mandatory:"false" contributesTo:"query" name:"accessLevel" omitEmpty:"true"` + + // A filter used to return only resources that match the given lifecycleState. + LifecycleState CccInfrastructureLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only resources whose display name contains the substring. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"false" contributesTo:"query" name:"cccInfrastructureId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListCccInfrastructuresSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. + SortBy ListCccInfrastructuresSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCccInfrastructuresRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCccInfrastructuresRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListCccInfrastructuresRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCccInfrastructuresRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListCccInfrastructuresRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCccInfrastructuresAccessLevelEnum(string(request.AccessLevel)); !ok && request.AccessLevel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AccessLevel: %s. Supported values are: %s.", request.AccessLevel, strings.Join(GetListCccInfrastructuresAccessLevelEnumStringValues(), ","))) + } + if _, ok := GetMappingCccInfrastructureLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetCccInfrastructureLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccInfrastructuresSortOrderEnum(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(GetListCccInfrastructuresSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccInfrastructuresSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListCccInfrastructuresSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCccInfrastructuresResponse wrapper for the ListCccInfrastructures operation +type ListCccInfrastructuresResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CccInfrastructureCollection instances + CccInfrastructureCollection `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"` + + // 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 previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` +} + +func (response ListCccInfrastructuresResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCccInfrastructuresResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCccInfrastructuresAccessLevelEnum Enum with underlying type: string +type ListCccInfrastructuresAccessLevelEnum string + +// Set of constants representing the allowable values for ListCccInfrastructuresAccessLevelEnum +const ( + ListCccInfrastructuresAccessLevelRestricted ListCccInfrastructuresAccessLevelEnum = "RESTRICTED" + ListCccInfrastructuresAccessLevelAccessible ListCccInfrastructuresAccessLevelEnum = "ACCESSIBLE" +) + +var mappingListCccInfrastructuresAccessLevelEnum = map[string]ListCccInfrastructuresAccessLevelEnum{ + "RESTRICTED": ListCccInfrastructuresAccessLevelRestricted, + "ACCESSIBLE": ListCccInfrastructuresAccessLevelAccessible, +} + +var mappingListCccInfrastructuresAccessLevelEnumLowerCase = map[string]ListCccInfrastructuresAccessLevelEnum{ + "restricted": ListCccInfrastructuresAccessLevelRestricted, + "accessible": ListCccInfrastructuresAccessLevelAccessible, +} + +// GetListCccInfrastructuresAccessLevelEnumValues Enumerates the set of values for ListCccInfrastructuresAccessLevelEnum +func GetListCccInfrastructuresAccessLevelEnumValues() []ListCccInfrastructuresAccessLevelEnum { + values := make([]ListCccInfrastructuresAccessLevelEnum, 0) + for _, v := range mappingListCccInfrastructuresAccessLevelEnum { + values = append(values, v) + } + return values +} + +// GetListCccInfrastructuresAccessLevelEnumStringValues Enumerates the set of values in String for ListCccInfrastructuresAccessLevelEnum +func GetListCccInfrastructuresAccessLevelEnumStringValues() []string { + return []string{ + "RESTRICTED", + "ACCESSIBLE", + } +} + +// GetMappingListCccInfrastructuresAccessLevelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccInfrastructuresAccessLevelEnum(val string) (ListCccInfrastructuresAccessLevelEnum, bool) { + enum, ok := mappingListCccInfrastructuresAccessLevelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccInfrastructuresSortOrderEnum Enum with underlying type: string +type ListCccInfrastructuresSortOrderEnum string + +// Set of constants representing the allowable values for ListCccInfrastructuresSortOrderEnum +const ( + ListCccInfrastructuresSortOrderAsc ListCccInfrastructuresSortOrderEnum = "ASC" + ListCccInfrastructuresSortOrderDesc ListCccInfrastructuresSortOrderEnum = "DESC" +) + +var mappingListCccInfrastructuresSortOrderEnum = map[string]ListCccInfrastructuresSortOrderEnum{ + "ASC": ListCccInfrastructuresSortOrderAsc, + "DESC": ListCccInfrastructuresSortOrderDesc, +} + +var mappingListCccInfrastructuresSortOrderEnumLowerCase = map[string]ListCccInfrastructuresSortOrderEnum{ + "asc": ListCccInfrastructuresSortOrderAsc, + "desc": ListCccInfrastructuresSortOrderDesc, +} + +// GetListCccInfrastructuresSortOrderEnumValues Enumerates the set of values for ListCccInfrastructuresSortOrderEnum +func GetListCccInfrastructuresSortOrderEnumValues() []ListCccInfrastructuresSortOrderEnum { + values := make([]ListCccInfrastructuresSortOrderEnum, 0) + for _, v := range mappingListCccInfrastructuresSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCccInfrastructuresSortOrderEnumStringValues Enumerates the set of values in String for ListCccInfrastructuresSortOrderEnum +func GetListCccInfrastructuresSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCccInfrastructuresSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccInfrastructuresSortOrderEnum(val string) (ListCccInfrastructuresSortOrderEnum, bool) { + enum, ok := mappingListCccInfrastructuresSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccInfrastructuresSortByEnum Enum with underlying type: string +type ListCccInfrastructuresSortByEnum string + +// Set of constants representing the allowable values for ListCccInfrastructuresSortByEnum +const ( + ListCccInfrastructuresSortByTimecreated ListCccInfrastructuresSortByEnum = "timeCreated" + ListCccInfrastructuresSortByDisplayname ListCccInfrastructuresSortByEnum = "displayName" +) + +var mappingListCccInfrastructuresSortByEnum = map[string]ListCccInfrastructuresSortByEnum{ + "timeCreated": ListCccInfrastructuresSortByTimecreated, + "displayName": ListCccInfrastructuresSortByDisplayname, +} + +var mappingListCccInfrastructuresSortByEnumLowerCase = map[string]ListCccInfrastructuresSortByEnum{ + "timecreated": ListCccInfrastructuresSortByTimecreated, + "displayname": ListCccInfrastructuresSortByDisplayname, +} + +// GetListCccInfrastructuresSortByEnumValues Enumerates the set of values for ListCccInfrastructuresSortByEnum +func GetListCccInfrastructuresSortByEnumValues() []ListCccInfrastructuresSortByEnum { + values := make([]ListCccInfrastructuresSortByEnum, 0) + for _, v := range mappingListCccInfrastructuresSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCccInfrastructuresSortByEnumStringValues Enumerates the set of values in String for ListCccInfrastructuresSortByEnum +func GetListCccInfrastructuresSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListCccInfrastructuresSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccInfrastructuresSortByEnum(val string) (ListCccInfrastructuresSortByEnum, bool) { + enum, ok := mappingListCccInfrastructuresSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/computecloudatcustomer/list_ccc_upgrade_schedules_request_response.go b/computecloudatcustomer/list_ccc_upgrade_schedules_request_response.go new file mode 100644 index 0000000000..61e0934553 --- /dev/null +++ b/computecloudatcustomer/list_ccc_upgrade_schedules_request_response.go @@ -0,0 +1,276 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCccUpgradeSchedulesRequest wrapper for the ListCccUpgradeSchedules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccUpgradeSchedules.go.html to see an example of how to use ListCccUpgradeSchedulesRequest. +type ListCccUpgradeSchedulesRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"false" contributesTo:"query" name:"cccUpgradeScheduleId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to + // list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Default is false. + // When set to true, the hierarchy of compartments is traversed and all compartments and + // sub-compartments in the tenancy are returned. Depends on the 'accessLevel' setting. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. + // Setting this to ACCESSIBLE returns only those compartments for which the + // user has INSPECT permissions directly or indirectly (permissions can be on a + // resource in a subcompartment). When set to RESTRICTED permissions are checked and no + // partial results are displayed. + AccessLevel ListCccUpgradeSchedulesAccessLevelEnum `mandatory:"false" contributesTo:"query" name:"accessLevel" omitEmpty:"true"` + + // A filter to return resources only when their lifecycleState matches the given lifecycleState. + LifecycleState CccUpgradeScheduleLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only resources whose display name contains the substring. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListCccUpgradeSchedulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. + SortBy ListCccUpgradeSchedulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCccUpgradeSchedulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCccUpgradeSchedulesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListCccUpgradeSchedulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCccUpgradeSchedulesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListCccUpgradeSchedulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCccUpgradeSchedulesAccessLevelEnum(string(request.AccessLevel)); !ok && request.AccessLevel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AccessLevel: %s. Supported values are: %s.", request.AccessLevel, strings.Join(GetListCccUpgradeSchedulesAccessLevelEnumStringValues(), ","))) + } + if _, ok := GetMappingCccUpgradeScheduleLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetCccUpgradeScheduleLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccUpgradeSchedulesSortOrderEnum(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(GetListCccUpgradeSchedulesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccUpgradeSchedulesSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListCccUpgradeSchedulesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCccUpgradeSchedulesResponse wrapper for the ListCccUpgradeSchedules operation +type ListCccUpgradeSchedulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CccUpgradeScheduleCollection instances + CccUpgradeScheduleCollection `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"` + + // 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 previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` +} + +func (response ListCccUpgradeSchedulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCccUpgradeSchedulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCccUpgradeSchedulesAccessLevelEnum Enum with underlying type: string +type ListCccUpgradeSchedulesAccessLevelEnum string + +// Set of constants representing the allowable values for ListCccUpgradeSchedulesAccessLevelEnum +const ( + ListCccUpgradeSchedulesAccessLevelRestricted ListCccUpgradeSchedulesAccessLevelEnum = "RESTRICTED" + ListCccUpgradeSchedulesAccessLevelAccessible ListCccUpgradeSchedulesAccessLevelEnum = "ACCESSIBLE" +) + +var mappingListCccUpgradeSchedulesAccessLevelEnum = map[string]ListCccUpgradeSchedulesAccessLevelEnum{ + "RESTRICTED": ListCccUpgradeSchedulesAccessLevelRestricted, + "ACCESSIBLE": ListCccUpgradeSchedulesAccessLevelAccessible, +} + +var mappingListCccUpgradeSchedulesAccessLevelEnumLowerCase = map[string]ListCccUpgradeSchedulesAccessLevelEnum{ + "restricted": ListCccUpgradeSchedulesAccessLevelRestricted, + "accessible": ListCccUpgradeSchedulesAccessLevelAccessible, +} + +// GetListCccUpgradeSchedulesAccessLevelEnumValues Enumerates the set of values for ListCccUpgradeSchedulesAccessLevelEnum +func GetListCccUpgradeSchedulesAccessLevelEnumValues() []ListCccUpgradeSchedulesAccessLevelEnum { + values := make([]ListCccUpgradeSchedulesAccessLevelEnum, 0) + for _, v := range mappingListCccUpgradeSchedulesAccessLevelEnum { + values = append(values, v) + } + return values +} + +// GetListCccUpgradeSchedulesAccessLevelEnumStringValues Enumerates the set of values in String for ListCccUpgradeSchedulesAccessLevelEnum +func GetListCccUpgradeSchedulesAccessLevelEnumStringValues() []string { + return []string{ + "RESTRICTED", + "ACCESSIBLE", + } +} + +// GetMappingListCccUpgradeSchedulesAccessLevelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccUpgradeSchedulesAccessLevelEnum(val string) (ListCccUpgradeSchedulesAccessLevelEnum, bool) { + enum, ok := mappingListCccUpgradeSchedulesAccessLevelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccUpgradeSchedulesSortOrderEnum Enum with underlying type: string +type ListCccUpgradeSchedulesSortOrderEnum string + +// Set of constants representing the allowable values for ListCccUpgradeSchedulesSortOrderEnum +const ( + ListCccUpgradeSchedulesSortOrderAsc ListCccUpgradeSchedulesSortOrderEnum = "ASC" + ListCccUpgradeSchedulesSortOrderDesc ListCccUpgradeSchedulesSortOrderEnum = "DESC" +) + +var mappingListCccUpgradeSchedulesSortOrderEnum = map[string]ListCccUpgradeSchedulesSortOrderEnum{ + "ASC": ListCccUpgradeSchedulesSortOrderAsc, + "DESC": ListCccUpgradeSchedulesSortOrderDesc, +} + +var mappingListCccUpgradeSchedulesSortOrderEnumLowerCase = map[string]ListCccUpgradeSchedulesSortOrderEnum{ + "asc": ListCccUpgradeSchedulesSortOrderAsc, + "desc": ListCccUpgradeSchedulesSortOrderDesc, +} + +// GetListCccUpgradeSchedulesSortOrderEnumValues Enumerates the set of values for ListCccUpgradeSchedulesSortOrderEnum +func GetListCccUpgradeSchedulesSortOrderEnumValues() []ListCccUpgradeSchedulesSortOrderEnum { + values := make([]ListCccUpgradeSchedulesSortOrderEnum, 0) + for _, v := range mappingListCccUpgradeSchedulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCccUpgradeSchedulesSortOrderEnumStringValues Enumerates the set of values in String for ListCccUpgradeSchedulesSortOrderEnum +func GetListCccUpgradeSchedulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCccUpgradeSchedulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccUpgradeSchedulesSortOrderEnum(val string) (ListCccUpgradeSchedulesSortOrderEnum, bool) { + enum, ok := mappingListCccUpgradeSchedulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccUpgradeSchedulesSortByEnum Enum with underlying type: string +type ListCccUpgradeSchedulesSortByEnum string + +// Set of constants representing the allowable values for ListCccUpgradeSchedulesSortByEnum +const ( + ListCccUpgradeSchedulesSortByTimecreated ListCccUpgradeSchedulesSortByEnum = "timeCreated" + ListCccUpgradeSchedulesSortByDisplayname ListCccUpgradeSchedulesSortByEnum = "displayName" +) + +var mappingListCccUpgradeSchedulesSortByEnum = map[string]ListCccUpgradeSchedulesSortByEnum{ + "timeCreated": ListCccUpgradeSchedulesSortByTimecreated, + "displayName": ListCccUpgradeSchedulesSortByDisplayname, +} + +var mappingListCccUpgradeSchedulesSortByEnumLowerCase = map[string]ListCccUpgradeSchedulesSortByEnum{ + "timecreated": ListCccUpgradeSchedulesSortByTimecreated, + "displayname": ListCccUpgradeSchedulesSortByDisplayname, +} + +// GetListCccUpgradeSchedulesSortByEnumValues Enumerates the set of values for ListCccUpgradeSchedulesSortByEnum +func GetListCccUpgradeSchedulesSortByEnumValues() []ListCccUpgradeSchedulesSortByEnum { + values := make([]ListCccUpgradeSchedulesSortByEnum, 0) + for _, v := range mappingListCccUpgradeSchedulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCccUpgradeSchedulesSortByEnumStringValues Enumerates the set of values in String for ListCccUpgradeSchedulesSortByEnum +func GetListCccUpgradeSchedulesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListCccUpgradeSchedulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccUpgradeSchedulesSortByEnum(val string) (ListCccUpgradeSchedulesSortByEnum, bool) { + enum, ok := mappingListCccUpgradeSchedulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/computecloudatcustomer/peer_information.go b/computecloudatcustomer/peer_information.go new file mode 100644 index 0000000000..1737ec6a2b --- /dev/null +++ b/computecloudatcustomer/peer_information.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PeerInformation Routing information for peer nodes using the Border Gateway Protocol (BGP). +type PeerInformation struct { + + // The Autonomous System Number (ASN) of the peer network. + Asn *int `mandatory:"false" json:"asn"` + + // Neighbor Border Gateway Protocal (BGP) IP address. + // The IP address usually refers to the customer data center router. + Ip *string `mandatory:"false" json:"ip"` +} + +func (m PeerInformation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PeerInformation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/sort_order.go b/computecloudatcustomer/sort_order.go new file mode 100644 index 0000000000..475c9d04e2 --- /dev/null +++ b/computecloudatcustomer/sort_order.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "strings" +) + +// SortOrderEnum Enum with underlying type: string +type SortOrderEnum string + +// Set of constants representing the allowable values for SortOrderEnum +const ( + SortOrderAsc SortOrderEnum = "ASC" + SortOrderDesc SortOrderEnum = "DESC" +) + +var mappingSortOrderEnum = map[string]SortOrderEnum{ + "ASC": SortOrderAsc, + "DESC": SortOrderDesc, +} + +var mappingSortOrderEnumLowerCase = map[string]SortOrderEnum{ + "asc": SortOrderAsc, + "desc": SortOrderDesc, +} + +// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum +func GetSortOrderEnumValues() []SortOrderEnum { + values := make([]SortOrderEnum, 0) + for _, v := range mappingSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSortOrderEnumStringValues Enumerates the set of values in String for SortOrderEnum +func GetSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrderEnum(val string) (SortOrderEnum, bool) { + enum, ok := mappingSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/computecloudatcustomer/update_ccc_infrastructure_details.go b/computecloudatcustomer/update_ccc_infrastructure_details.go new file mode 100644 index 0000000000..d3c92236b7 --- /dev/null +++ b/computecloudatcustomer/update_ccc_infrastructure_details.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateCccInfrastructureDetails Updates Compute Cloud@Customer infrastructure configuration details. +type UpdateCccInfrastructureDetails struct { + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is + // used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"false" json:"subnetId"` + + // An updated connection state of the Compute Cloud@Customer infrastructure. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // A message describing the current connection state in more detail. + ConnectionDetails *string `mandatory:"false" json:"connectionDetails"` + + // Schedule used for upgrades. If no schedule is associated with the infrastructure, + // it can be updated at any time. + CccUpgradeScheduleId *string `mandatory:"false" json:"cccUpgradeScheduleId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateCccInfrastructureDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateCccInfrastructureDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/update_ccc_infrastructure_request_response.go b/computecloudatcustomer/update_ccc_infrastructure_request_response.go new file mode 100644 index 0000000000..1e4ecc913b --- /dev/null +++ b/computecloudatcustomer/update_ccc_infrastructure_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateCccInfrastructureRequest wrapper for the UpdateCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccInfrastructure.go.html to see an example of how to use UpdateCccInfrastructureRequest. +type UpdateCccInfrastructureRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // The information to be updated. + UpdateCccInfrastructureDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateCccInfrastructureRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCccInfrastructureRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateCccInfrastructureResponse wrapper for the UpdateCccInfrastructure operation +type UpdateCccInfrastructureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccInfrastructure instance + CccInfrastructure `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/computecloudatcustomer/update_ccc_schedule_event.go b/computecloudatcustomer/update_ccc_schedule_event.go new file mode 100644 index 0000000000..00b70cbc5a --- /dev/null +++ b/computecloudatcustomer/update_ccc_schedule_event.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateCccScheduleEvent A period where upgrades may be applied to Compute Cloud@Customer infrastructures +// associated with the schedule. All upgrade windows may not be used. +type UpdateCccScheduleEvent struct { + + // A description of the Compute Cloud@Customer upgrade schedule time block. + Description *string `mandatory:"true" json:"description"` + + // The date and time when the Compute Cloud@Customer upgrade schedule event starts, + // inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, + // this is the date that a recurrence can start being applied. + TimeStart *common.SDKTime `mandatory:"true" json:"timeStart"` + + // The duration of this block of time. The duration must be specified and be of the + // ISO-8601 format for durations. + ScheduleEventDuration *string `mandatory:"true" json:"scheduleEventDuration"` + + // Frequency of recurrence of schedule block. When this field is not included, the event + // is assumed to be a one time occurrence. The frequency field is strictly parsed and must + // conform to RFC-5545 formatting for recurrences. + ScheduleEventRecurrences *string `mandatory:"false" json:"scheduleEventRecurrences"` +} + +func (m UpdateCccScheduleEvent) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateCccScheduleEvent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/update_ccc_upgrade_schedule_details.go b/computecloudatcustomer/update_ccc_upgrade_schedule_details.go new file mode 100644 index 0000000000..dba5fd4ac9 --- /dev/null +++ b/computecloudatcustomer/update_ccc_upgrade_schedule_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateCccUpgradeScheduleDetails Updates the schedule details, all schedule information must be entered, similar to an +// initial schedule create. Include all events in the update. +type UpdateCccUpgradeScheduleDetails struct { + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // An optional description of the Compute Cloud@Customer upgrade schedule. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // List of preferred times for a Compute Cloud@Customer infrastructure to be upgraded. + Events []UpdateCccScheduleEvent `mandatory:"false" json:"events"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateCccUpgradeScheduleDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateCccUpgradeScheduleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/computecloudatcustomer/update_ccc_upgrade_schedule_request_response.go b/computecloudatcustomer/update_ccc_upgrade_schedule_request_response.go new file mode 100644 index 0000000000..b0cdfe0442 --- /dev/null +++ b/computecloudatcustomer/update_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateCccUpgradeScheduleRequest wrapper for the UpdateCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccUpgradeSchedule.go.html to see an example of how to use UpdateCccUpgradeScheduleRequest. +type UpdateCccUpgradeScheduleRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // The information to be updated in the Compute Cloud@Customer upgrade schedule. + UpdateCccUpgradeScheduleDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateCccUpgradeScheduleRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCccUpgradeScheduleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateCccUpgradeScheduleResponse wrapper for the UpdateCccUpgradeSchedule operation +type UpdateCccUpgradeScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccUpgradeSchedule instance + CccUpgradeSchedule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/autonomous_database.go b/database/autonomous_database.go index cfacd8c4ff..7f6b0e2391 100644 --- a/database/autonomous_database.go +++ b/database/autonomous_database.go @@ -56,6 +56,12 @@ type AutonomousDatabase struct { // AL16UTF16 or UTF8. NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + + // The area assigned to In-Memory tables in Autonomous Database. + InMemoryAreaInGBs *int `mandatory:"false" json:"inMemoryAreaInGBs"` + // The date and time when the next long-term backup would be created. NextLongTermBackupTimeStamp *common.SDKTime `mandatory:"false" json:"nextLongTermBackupTimeStamp"` diff --git a/database/autonomous_database_summary.go b/database/autonomous_database_summary.go index c6ab6f874a..50f5118b0a 100644 --- a/database/autonomous_database_summary.go +++ b/database/autonomous_database_summary.go @@ -57,6 +57,12 @@ type AutonomousDatabaseSummary struct { // AL16UTF16 or UTF8. NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + + // The area assigned to In-Memory tables in Autonomous Database. + InMemoryAreaInGBs *int `mandatory:"false" json:"inMemoryAreaInGBs"` + // The date and time when the next long-term backup would be created. NextLongTermBackupTimeStamp *common.SDKTime `mandatory:"false" json:"nextLongTermBackupTimeStamp"` diff --git a/database/create_autonomous_database_base.go b/database/create_autonomous_database_base.go index c927e5ac22..1c41b3204b 100644 --- a/database/create_autonomous_database_base.go +++ b/database/create_autonomous_database_base.go @@ -115,6 +115,9 @@ type CreateAutonomousDatabaseBase interface { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). GetAutonomousContainerDatabaseId() *string + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + GetInMemoryPercentage() *int + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -256,6 +259,7 @@ type createautonomousdatabasebase struct { IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` IsDedicated *bool `mandatory:"false" json:"isDedicated"` AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` IsAccessControlEnabled *bool `mandatory:"false" json:"isAccessControlEnabled"` WhitelistedIps []string `mandatory:"false" json:"whitelistedIps"` ArePrimaryWhitelistedIpsUsed *bool `mandatory:"false" json:"arePrimaryWhitelistedIpsUsed"` @@ -315,6 +319,7 @@ func (m *createautonomousdatabasebase) UnmarshalJSON(data []byte) error { m.IsAutoScalingEnabled = s.Model.IsAutoScalingEnabled m.IsDedicated = s.Model.IsDedicated m.AutonomousContainerDatabaseId = s.Model.AutonomousContainerDatabaseId + m.InMemoryPercentage = s.Model.InMemoryPercentage m.IsAccessControlEnabled = s.Model.IsAccessControlEnabled m.WhitelistedIps = s.Model.WhitelistedIps m.ArePrimaryWhitelistedIpsUsed = s.Model.ArePrimaryWhitelistedIpsUsed @@ -496,6 +501,11 @@ func (m createautonomousdatabasebase) GetAutonomousContainerDatabaseId() *string return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m createautonomousdatabasebase) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m createautonomousdatabasebase) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/create_autonomous_database_clone_details.go b/database/create_autonomous_database_clone_details.go index 90b27bccb0..1d7d630516 100644 --- a/database/create_autonomous_database_clone_details.go +++ b/database/create_autonomous_database_clone_details.go @@ -95,6 +95,9 @@ type CreateAutonomousDatabaseCloneDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -343,6 +346,11 @@ func (m CreateAutonomousDatabaseCloneDetails) GetAutonomousContainerDatabaseId() return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseCloneDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseCloneDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/create_autonomous_database_details.go b/database/create_autonomous_database_details.go index 41cc2e29c3..d4276c9d89 100644 --- a/database/create_autonomous_database_details.go +++ b/database/create_autonomous_database_details.go @@ -92,6 +92,9 @@ type CreateAutonomousDatabaseDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -337,6 +340,11 @@ func (m CreateAutonomousDatabaseDetails) GetAutonomousContainerDatabaseId() *str return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/create_autonomous_database_from_backup_details.go b/database/create_autonomous_database_from_backup_details.go index 68e5440baa..084a1cdab2 100644 --- a/database/create_autonomous_database_from_backup_details.go +++ b/database/create_autonomous_database_from_backup_details.go @@ -95,6 +95,9 @@ type CreateAutonomousDatabaseFromBackupDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -343,6 +346,11 @@ func (m CreateAutonomousDatabaseFromBackupDetails) GetAutonomousContainerDatabas return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseFromBackupDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseFromBackupDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/create_autonomous_database_from_backup_timestamp_details.go b/database/create_autonomous_database_from_backup_timestamp_details.go index 5b6dd7e696..aee8e24309 100644 --- a/database/create_autonomous_database_from_backup_timestamp_details.go +++ b/database/create_autonomous_database_from_backup_timestamp_details.go @@ -95,6 +95,9 @@ type CreateAutonomousDatabaseFromBackupTimestampDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -349,6 +352,11 @@ func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetAutonomousContain return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/create_cross_region_autonomous_database_data_guard_details.go b/database/create_cross_region_autonomous_database_data_guard_details.go index 2abb313c2e..a8e53cfee8 100644 --- a/database/create_cross_region_autonomous_database_data_guard_details.go +++ b/database/create_cross_region_autonomous_database_data_guard_details.go @@ -137,6 +137,9 @@ type CreateCrossRegionAutonomousDatabaseDataGuardDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -382,6 +385,11 @@ func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetAutonomousContai return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/create_cross_region_disaster_recovery_details.go b/database/create_cross_region_disaster_recovery_details.go index e2058f94cc..61a1b04e32 100644 --- a/database/create_cross_region_disaster_recovery_details.go +++ b/database/create_cross_region_disaster_recovery_details.go @@ -135,6 +135,9 @@ type CreateCrossRegionDisasterRecoveryDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -385,6 +388,11 @@ func (m CreateCrossRegionDisasterRecoveryDetails) GetAutonomousContainerDatabase return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateCrossRegionDisasterRecoveryDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateCrossRegionDisasterRecoveryDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/create_refreshable_autonomous_database_clone_details.go b/database/create_refreshable_autonomous_database_clone_details.go index fed12954e1..a37f2ed200 100644 --- a/database/create_refreshable_autonomous_database_clone_details.go +++ b/database/create_refreshable_autonomous_database_clone_details.go @@ -95,6 +95,9 @@ type CreateRefreshableAutonomousDatabaseCloneDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -343,6 +346,11 @@ func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetAutonomousContainerD return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/database/update_autonomous_database_details.go b/database/update_autonomous_database_details.go index ab2e853e74..9e5918fa35 100644 --- a/database/update_autonomous_database_details.go +++ b/database/update_autonomous_database_details.go @@ -29,6 +29,9 @@ type UpdateAutonomousDatabaseDetails struct { // The compute model of the Autonomous Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ComputeModel UpdateAutonomousDatabaseDetailsComputeModelEnum `mandatory:"false" json:"computeModel,omitempty"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard LocalAdgAutoFailoverMaxDataLossLimit *int `mandatory:"false" json:"localAdgAutoFailoverMaxDataLossLimit"` diff --git a/opsi/awr_hub.go b/opsi/awr_hub.go index 0a69f3fcfe..b68379a0de 100644 --- a/opsi/awr_hub.go +++ b/opsi/awr_hub.go @@ -61,6 +61,9 @@ type AwrHub struct { // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // Dst Time Zone Version of the AWR Hub + HubDstTimezoneVersion *string `mandatory:"false" json:"hubDstTimezoneVersion"` } func (m AwrHub) String() string { diff --git a/opsi/data_object_bind_parameter.go b/opsi/data_object_bind_parameter.go new file mode 100644 index 0000000000..329a0c3174 --- /dev/null +++ b/opsi/data_object_bind_parameter.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataObjectBindParameter Details for a bind parameter used in data object query. +type DataObjectBindParameter struct { + + // Name of the bind parameter. + Name *string `mandatory:"true" json:"name"` + + // Value for the bind parameter. + Value *interface{} `mandatory:"true" json:"value"` + + // Data type of the bind parameter. + DataType *string `mandatory:"true" json:"dataType"` +} + +func (m DataObjectBindParameter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DataObjectBindParameter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/data_object_column_metadata.go b/opsi/data_object_column_metadata.go index 69eaddd71d..8b56308070 100644 --- a/opsi/data_object_column_metadata.go +++ b/opsi/data_object_column_metadata.go @@ -27,6 +27,9 @@ type DataObjectColumnMetadata struct { // Category of the column. Category DataObjectColumnMetadataCategoryEnum `mandatory:"false" json:"category,omitempty"` + // Type of a data object column. + DataType *string `mandatory:"false" json:"dataType"` + // Type name of a data object column. DataTypeName DataObjectColumnMetadataDataTypeNameEnum `mandatory:"false" json:"dataTypeName,omitempty"` @@ -68,6 +71,7 @@ func (m DataObjectColumnMetadata) ValidateEnumValue() (bool, error) { func (m *DataObjectColumnMetadata) UnmarshalJSON(data []byte) (e error) { model := struct { Category DataObjectColumnMetadataCategoryEnum `json:"category"` + DataType *string `json:"dataType"` DataTypeName DataObjectColumnMetadataDataTypeNameEnum `json:"dataTypeName"` DisplayName *string `json:"displayName"` Description *string `json:"description"` @@ -83,6 +87,8 @@ func (m *DataObjectColumnMetadata) UnmarshalJSON(data []byte) (e error) { var nn interface{} m.Category = model.Category + m.DataType = model.DataType + m.DataTypeName = model.DataTypeName m.DisplayName = model.DisplayName @@ -114,18 +120,21 @@ const ( DataObjectColumnMetadataCategoryDimension DataObjectColumnMetadataCategoryEnum = "DIMENSION" DataObjectColumnMetadataCategoryMetric DataObjectColumnMetadataCategoryEnum = "METRIC" DataObjectColumnMetadataCategoryTimeDimension DataObjectColumnMetadataCategoryEnum = "TIME_DIMENSION" + DataObjectColumnMetadataCategoryUnknown DataObjectColumnMetadataCategoryEnum = "UNKNOWN" ) var mappingDataObjectColumnMetadataCategoryEnum = map[string]DataObjectColumnMetadataCategoryEnum{ "DIMENSION": DataObjectColumnMetadataCategoryDimension, "METRIC": DataObjectColumnMetadataCategoryMetric, "TIME_DIMENSION": DataObjectColumnMetadataCategoryTimeDimension, + "UNKNOWN": DataObjectColumnMetadataCategoryUnknown, } var mappingDataObjectColumnMetadataCategoryEnumLowerCase = map[string]DataObjectColumnMetadataCategoryEnum{ "dimension": DataObjectColumnMetadataCategoryDimension, "metric": DataObjectColumnMetadataCategoryMetric, "time_dimension": DataObjectColumnMetadataCategoryTimeDimension, + "unknown": DataObjectColumnMetadataCategoryUnknown, } // GetDataObjectColumnMetadataCategoryEnumValues Enumerates the set of values for DataObjectColumnMetadataCategoryEnum @@ -143,6 +152,7 @@ func GetDataObjectColumnMetadataCategoryEnumStringValues() []string { "DIMENSION", "METRIC", "TIME_DIMENSION", + "UNKNOWN", } } @@ -160,18 +170,21 @@ const ( DataObjectColumnMetadataDataTypeNameNumber DataObjectColumnMetadataDataTypeNameEnum = "NUMBER" DataObjectColumnMetadataDataTypeNameTimestamp DataObjectColumnMetadataDataTypeNameEnum = "TIMESTAMP" DataObjectColumnMetadataDataTypeNameVarchar2 DataObjectColumnMetadataDataTypeNameEnum = "VARCHAR2" + DataObjectColumnMetadataDataTypeNameOther DataObjectColumnMetadataDataTypeNameEnum = "OTHER" ) var mappingDataObjectColumnMetadataDataTypeNameEnum = map[string]DataObjectColumnMetadataDataTypeNameEnum{ "NUMBER": DataObjectColumnMetadataDataTypeNameNumber, "TIMESTAMP": DataObjectColumnMetadataDataTypeNameTimestamp, "VARCHAR2": DataObjectColumnMetadataDataTypeNameVarchar2, + "OTHER": DataObjectColumnMetadataDataTypeNameOther, } var mappingDataObjectColumnMetadataDataTypeNameEnumLowerCase = map[string]DataObjectColumnMetadataDataTypeNameEnum{ "number": DataObjectColumnMetadataDataTypeNameNumber, "timestamp": DataObjectColumnMetadataDataTypeNameTimestamp, "varchar2": DataObjectColumnMetadataDataTypeNameVarchar2, + "other": DataObjectColumnMetadataDataTypeNameOther, } // GetDataObjectColumnMetadataDataTypeNameEnumValues Enumerates the set of values for DataObjectColumnMetadataDataTypeNameEnum @@ -189,6 +202,7 @@ func GetDataObjectColumnMetadataDataTypeNameEnumStringValues() []string { "NUMBER", "TIMESTAMP", "VARCHAR2", + "OTHER", } } diff --git a/opsi/data_object_query.go b/opsi/data_object_query.go index 29bd754036..7c20eb7b11 100644 --- a/opsi/data_object_query.go +++ b/opsi/data_object_query.go @@ -20,11 +20,19 @@ import ( // DataObjectQuery Information required to form and execute query on a data object. type DataObjectQuery interface { + + // List of bind parameters to be applied in the query. + GetBindParams() []DataObjectBindParameter + + // Timeout (in seconds) to be set for the data object query execution. + GetQueryExecutionTimeoutInSeconds() *float64 } type dataobjectquery struct { - JsonData []byte - QueryType string `json:"queryType"` + JsonData []byte + BindParams []DataObjectBindParameter `mandatory:"false" json:"bindParams"` + QueryExecutionTimeoutInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeoutInSeconds"` + QueryType string `json:"queryType"` } // UnmarshalJSON unmarshals json @@ -38,6 +46,8 @@ func (m *dataobjectquery) UnmarshalJSON(data []byte) error { if err != nil { return err } + m.BindParams = s.Model.BindParams + m.QueryExecutionTimeoutInSeconds = s.Model.QueryExecutionTimeoutInSeconds m.QueryType = s.Model.QueryType return err @@ -52,6 +62,10 @@ func (m *dataobjectquery) UnmarshalPolymorphicJSON(data []byte) (interface{}, er var err error switch m.QueryType { + case "STANDARD_QUERY": + mm := DataObjectStandardQuery{} + err = json.Unmarshal(data, &mm) + return mm, err case "TEMPLATIZED_QUERY": mm := DataObjectTemplatizedQuery{} err = json.Unmarshal(data, &mm) @@ -62,6 +76,16 @@ func (m *dataobjectquery) UnmarshalPolymorphicJSON(data []byte) (interface{}, er } } +//GetBindParams returns BindParams +func (m dataobjectquery) GetBindParams() []DataObjectBindParameter { + return m.BindParams +} + +//GetQueryExecutionTimeoutInSeconds returns QueryExecutionTimeoutInSeconds +func (m dataobjectquery) GetQueryExecutionTimeoutInSeconds() *float64 { + return m.QueryExecutionTimeoutInSeconds +} + func (m dataobjectquery) String() string { return common.PointerString(m) } @@ -84,14 +108,17 @@ type DataObjectQueryQueryTypeEnum string // Set of constants representing the allowable values for DataObjectQueryQueryTypeEnum const ( DataObjectQueryQueryTypeTemplatizedQuery DataObjectQueryQueryTypeEnum = "TEMPLATIZED_QUERY" + DataObjectQueryQueryTypeStandardQuery DataObjectQueryQueryTypeEnum = "STANDARD_QUERY" ) var mappingDataObjectQueryQueryTypeEnum = map[string]DataObjectQueryQueryTypeEnum{ "TEMPLATIZED_QUERY": DataObjectQueryQueryTypeTemplatizedQuery, + "STANDARD_QUERY": DataObjectQueryQueryTypeStandardQuery, } var mappingDataObjectQueryQueryTypeEnumLowerCase = map[string]DataObjectQueryQueryTypeEnum{ "templatized_query": DataObjectQueryQueryTypeTemplatizedQuery, + "standard_query": DataObjectQueryQueryTypeStandardQuery, } // GetDataObjectQueryQueryTypeEnumValues Enumerates the set of values for DataObjectQueryQueryTypeEnum @@ -107,6 +134,7 @@ func GetDataObjectQueryQueryTypeEnumValues() []DataObjectQueryQueryTypeEnum { func GetDataObjectQueryQueryTypeEnumStringValues() []string { return []string{ "TEMPLATIZED_QUERY", + "STANDARD_QUERY", } } diff --git a/opsi/data_object_standard_query.go b/opsi/data_object_standard_query.go new file mode 100644 index 0000000000..adb92d8e6f --- /dev/null +++ b/opsi/data_object_standard_query.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataObjectStandardQuery Information required to execute query on data objects. Query is given in standard SQL syntax providing flexibility +// to form complex queries such as queries with joins and nested queries. +type DataObjectStandardQuery struct { + + // List of bind parameters to be applied in the query. + BindParams []DataObjectBindParameter `mandatory:"false" json:"bindParams"` + + // Timeout (in seconds) to be set for the data object query execution. + QueryExecutionTimeoutInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeoutInSeconds"` + + // SQL query statement with standard Oracle supported SQL syntax. + // - When Warehouse (e.g: Awr hub) data objects are queried, use the actual names of underlying data objects (e.g: tables, views) in the query. + // The same query that works through JDBC connection with the OperationsInsightsWarehouseUsers credentials will work here and vice-versa. + // SCHEMA.VIEW syntax can also be used here. + // - When OPSI data objects are queried, use name of the respective OPSI data object, just like how views are used in a query. + // Identifier of the OPSI data object cannot be used in the query. + Statement *string `mandatory:"false" json:"statement"` + + TimeFilters *DataObjectQueryTimeFilters `mandatory:"false" json:"timeFilters"` +} + +//GetBindParams returns BindParams +func (m DataObjectStandardQuery) GetBindParams() []DataObjectBindParameter { + return m.BindParams +} + +//GetQueryExecutionTimeoutInSeconds returns QueryExecutionTimeoutInSeconds +func (m DataObjectStandardQuery) GetQueryExecutionTimeoutInSeconds() *float64 { + return m.QueryExecutionTimeoutInSeconds +} + +func (m DataObjectStandardQuery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DataObjectStandardQuery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DataObjectStandardQuery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDataObjectStandardQuery DataObjectStandardQuery + s := struct { + DiscriminatorParam string `json:"queryType"` + MarshalTypeDataObjectStandardQuery + }{ + "STANDARD_QUERY", + (MarshalTypeDataObjectStandardQuery)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/data_object_templatized_query.go b/opsi/data_object_templatized_query.go index 37ddf7e012..f858ef42d8 100644 --- a/opsi/data_object_templatized_query.go +++ b/opsi/data_object_templatized_query.go @@ -21,9 +21,21 @@ import ( // DataObjectTemplatizedQuery Information required in a structured template to form and execute query on a data object. type DataObjectTemplatizedQuery struct { + // List of bind parameters to be applied in the query. + BindParams []DataObjectBindParameter `mandatory:"false" json:"bindParams"` + + // Timeout (in seconds) to be set for the data object query execution. + QueryExecutionTimeoutInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeoutInSeconds"` + // List of items to be added into the SELECT clause of the query; items will be added with comma separation. SelectList []string `mandatory:"false" json:"selectList"` + // Unique data object name that will be added into the FROM clause of the query, just like a view name in FROM clause. + // - Use actual name of the data objects (e.g: tables, views) in case of Warehouse (e.g: Awr hub) data objects query. SCHEMA.VIEW name syntax can also be used here. + // e.g: SYS.DBA_HIST_SNAPSHOT or DBA_HIST_SNAPSHOT + // - Use name of the data object (e.g: SQL_STATS_DO) in case of OPSI data objects. Identifier of the OPSI data object cannot be used here. + FromClause *string `mandatory:"false" json:"fromClause"` + // List of items to be added into the WHERE clause of the query; items will be added with AND separation. // Item can contain a single condition or multiple conditions. // Single condition e.g: "optimizer_mode='mode1'" @@ -42,6 +54,16 @@ type DataObjectTemplatizedQuery struct { TimeFilters *DataObjectQueryTimeFilters `mandatory:"false" json:"timeFilters"` } +//GetBindParams returns BindParams +func (m DataObjectTemplatizedQuery) GetBindParams() []DataObjectBindParameter { + return m.BindParams +} + +//GetQueryExecutionTimeoutInSeconds returns QueryExecutionTimeoutInSeconds +func (m DataObjectTemplatizedQuery) GetQueryExecutionTimeoutInSeconds() *float64 { + return m.QueryExecutionTimeoutInSeconds +} + func (m DataObjectTemplatizedQuery) String() string { return common.PointerString(m) } diff --git a/opsi/data_object_time_column_unit.go b/opsi/data_object_time_column_unit.go index d877112fb6..a8e7211593 100644 --- a/opsi/data_object_time_column_unit.go +++ b/opsi/data_object_time_column_unit.go @@ -81,6 +81,7 @@ const ( DataObjectTimeColumnUnitUnitWeek DataObjectTimeColumnUnitUnitEnum = "WEEK" DataObjectTimeColumnUnitUnitMonth DataObjectTimeColumnUnitUnitEnum = "MONTH" DataObjectTimeColumnUnitUnitYear DataObjectTimeColumnUnitUnitEnum = "YEAR" + DataObjectTimeColumnUnitUnitMinute DataObjectTimeColumnUnitUnitEnum = "MINUTE" ) var mappingDataObjectTimeColumnUnitUnitEnum = map[string]DataObjectTimeColumnUnitUnitEnum{ @@ -94,6 +95,7 @@ var mappingDataObjectTimeColumnUnitUnitEnum = map[string]DataObjectTimeColumnUni "WEEK": DataObjectTimeColumnUnitUnitWeek, "MONTH": DataObjectTimeColumnUnitUnitMonth, "YEAR": DataObjectTimeColumnUnitUnitYear, + "MINUTE": DataObjectTimeColumnUnitUnitMinute, } var mappingDataObjectTimeColumnUnitUnitEnumLowerCase = map[string]DataObjectTimeColumnUnitUnitEnum{ @@ -107,6 +109,7 @@ var mappingDataObjectTimeColumnUnitUnitEnumLowerCase = map[string]DataObjectTime "week": DataObjectTimeColumnUnitUnitWeek, "month": DataObjectTimeColumnUnitUnitMonth, "year": DataObjectTimeColumnUnitUnitYear, + "minute": DataObjectTimeColumnUnitUnitMinute, } // GetDataObjectTimeColumnUnitUnitEnumValues Enumerates the set of values for DataObjectTimeColumnUnitUnitEnum @@ -131,6 +134,7 @@ func GetDataObjectTimeColumnUnitUnitEnumStringValues() []string { "WEEK", "MONTH", "YEAR", + "MINUTE", } } diff --git a/opsi/data_object_type.go b/opsi/data_object_type.go new file mode 100644 index 0000000000..e45d939d89 --- /dev/null +++ b/opsi/data_object_type.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// DataObjectTypeEnum Enum with underlying type: string +type DataObjectTypeEnum string + +// Set of constants representing the allowable values for DataObjectTypeEnum +const ( + DataObjectTypeView DataObjectTypeEnum = "VIEW" + DataObjectTypeTable DataObjectTypeEnum = "TABLE" +) + +var mappingDataObjectTypeEnum = map[string]DataObjectTypeEnum{ + "VIEW": DataObjectTypeView, + "TABLE": DataObjectTypeTable, +} + +var mappingDataObjectTypeEnumLowerCase = map[string]DataObjectTypeEnum{ + "view": DataObjectTypeView, + "table": DataObjectTypeTable, +} + +// GetDataObjectTypeEnumValues Enumerates the set of values for DataObjectTypeEnum +func GetDataObjectTypeEnumValues() []DataObjectTypeEnum { + values := make([]DataObjectTypeEnum, 0) + for _, v := range mappingDataObjectTypeEnum { + values = append(values, v) + } + return values +} + +// GetDataObjectTypeEnumStringValues Enumerates the set of values in String for DataObjectTypeEnum +func GetDataObjectTypeEnumStringValues() []string { + return []string{ + "VIEW", + "TABLE", + } +} + +// GetMappingDataObjectTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDataObjectTypeEnum(val string) (DataObjectTypeEnum, bool) { + enum, ok := mappingDataObjectTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/database_insights_data_object.go b/opsi/database_insights_data_object.go index f6e3e7ae44..13640beb9d 100644 --- a/opsi/database_insights_data_object.go +++ b/opsi/database_insights_data_object.go @@ -32,6 +32,20 @@ type DatabaseInsightsDataObject struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` } //GetIdentifier returns Identifier @@ -49,11 +63,31 @@ func (m DatabaseInsightsDataObject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m DatabaseInsightsDataObject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m DatabaseInsightsDataObject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m DatabaseInsightsDataObject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + //GetColumnsMetadata returns ColumnsMetadata func (m DatabaseInsightsDataObject) GetColumnsMetadata() []DataObjectColumnMetadata { return m.ColumnsMetadata } +//GetSupportedQueryParams returns SupportedQueryParams +func (m DatabaseInsightsDataObject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m DatabaseInsightsDataObject) String() string { return common.PointerString(m) } diff --git a/opsi/database_insights_data_object_summary.go b/opsi/database_insights_data_object_summary.go index 620e2ab91f..70497194db 100644 --- a/opsi/database_insights_data_object_summary.go +++ b/opsi/database_insights_data_object_summary.go @@ -29,6 +29,12 @@ type DatabaseInsightsDataObjectSummary struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` } //GetIdentifier returns Identifier @@ -46,6 +52,16 @@ func (m DatabaseInsightsDataObjectSummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m DatabaseInsightsDataObjectSummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m DatabaseInsightsDataObjectSummary) GetGroupNames() []string { + return m.GroupNames +} + func (m DatabaseInsightsDataObjectSummary) String() string { return common.PointerString(m) } diff --git a/opsi/exadata_insights_data_object.go b/opsi/exadata_insights_data_object.go index 670a3d1234..9372413eb4 100644 --- a/opsi/exadata_insights_data_object.go +++ b/opsi/exadata_insights_data_object.go @@ -32,6 +32,20 @@ type ExadataInsightsDataObject struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` } //GetIdentifier returns Identifier @@ -49,11 +63,31 @@ func (m ExadataInsightsDataObject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m ExadataInsightsDataObject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m ExadataInsightsDataObject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m ExadataInsightsDataObject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + //GetColumnsMetadata returns ColumnsMetadata func (m ExadataInsightsDataObject) GetColumnsMetadata() []DataObjectColumnMetadata { return m.ColumnsMetadata } +//GetSupportedQueryParams returns SupportedQueryParams +func (m ExadataInsightsDataObject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m ExadataInsightsDataObject) String() string { return common.PointerString(m) } diff --git a/opsi/exadata_insights_data_object_summary.go b/opsi/exadata_insights_data_object_summary.go index 012df3170c..423d10080e 100644 --- a/opsi/exadata_insights_data_object_summary.go +++ b/opsi/exadata_insights_data_object_summary.go @@ -29,6 +29,12 @@ type ExadataInsightsDataObjectSummary struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` } //GetIdentifier returns Identifier @@ -46,6 +52,16 @@ func (m ExadataInsightsDataObjectSummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m ExadataInsightsDataObjectSummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m ExadataInsightsDataObjectSummary) GetGroupNames() []string { + return m.GroupNames +} + func (m ExadataInsightsDataObjectSummary) String() string { return common.PointerString(m) } diff --git a/opsi/host_insights_data_object.go b/opsi/host_insights_data_object.go index 94e1b7ea7b..77a5436a3e 100644 --- a/opsi/host_insights_data_object.go +++ b/opsi/host_insights_data_object.go @@ -32,6 +32,20 @@ type HostInsightsDataObject struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` } //GetIdentifier returns Identifier @@ -49,11 +63,31 @@ func (m HostInsightsDataObject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m HostInsightsDataObject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m HostInsightsDataObject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m HostInsightsDataObject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + //GetColumnsMetadata returns ColumnsMetadata func (m HostInsightsDataObject) GetColumnsMetadata() []DataObjectColumnMetadata { return m.ColumnsMetadata } +//GetSupportedQueryParams returns SupportedQueryParams +func (m HostInsightsDataObject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m HostInsightsDataObject) String() string { return common.PointerString(m) } diff --git a/opsi/host_insights_data_object_summary.go b/opsi/host_insights_data_object_summary.go index 9a04262eff..bbfc12f487 100644 --- a/opsi/host_insights_data_object_summary.go +++ b/opsi/host_insights_data_object_summary.go @@ -29,6 +29,12 @@ type HostInsightsDataObjectSummary struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` } //GetIdentifier returns Identifier @@ -46,6 +52,16 @@ func (m HostInsightsDataObjectSummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m HostInsightsDataObjectSummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m HostInsightsDataObjectSummary) GetGroupNames() []string { + return m.GroupNames +} + func (m HostInsightsDataObjectSummary) String() string { return common.PointerString(m) } diff --git a/opsi/individual_opsi_data_object_details_in_query.go b/opsi/individual_opsi_data_object_details_in_query.go new file mode 100644 index 0000000000..a01cb30b61 --- /dev/null +++ b/opsi/individual_opsi_data_object_details_in_query.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// IndividualOpsiDataObjectDetailsInQuery Details applicable for an individual OPSI data object used in a data object query. +type IndividualOpsiDataObjectDetailsInQuery struct { + + // Unique OPSI data object identifier. + DataObjectIdentifier *string `mandatory:"true" json:"dataObjectIdentifier"` + + // An array of query parameters to be applied, for the OPSI data objects targetted by dataObjectDetailsTarget, before executing the query. + // Refer to supportedQueryParams of OpsiDataObject for the supported query parameters. + QueryParams []OpsiDataObjectQueryParam `mandatory:"false" json:"queryParams"` +} + +//GetQueryParams returns QueryParams +func (m IndividualOpsiDataObjectDetailsInQuery) GetQueryParams() []OpsiDataObjectQueryParam { + return m.QueryParams +} + +func (m IndividualOpsiDataObjectDetailsInQuery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m IndividualOpsiDataObjectDetailsInQuery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m IndividualOpsiDataObjectDetailsInQuery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeIndividualOpsiDataObjectDetailsInQuery IndividualOpsiDataObjectDetailsInQuery + s := struct { + DiscriminatorParam string `json:"dataObjectDetailsTarget"` + MarshalTypeIndividualOpsiDataObjectDetailsInQuery + }{ + "INDIVIDUAL_OPSIDATAOBJECT", + (MarshalTypeIndividualOpsiDataObjectDetailsInQuery)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/list_opsi_data_objects_request_response.go b/opsi/list_opsi_data_objects_request_response.go index d961ff5e9e..0f590a7605 100644 --- a/opsi/list_opsi_data_objects_request_response.go +++ b/opsi/list_opsi_data_objects_request_response.go @@ -45,6 +45,12 @@ type ListOpsiDataObjectsRequest struct { // OPSI data object list sort options. SortBy ListOpsiDataObjectsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + // A filter to return only data objects that belongs to the group of the given group name. By default, no filtering will be applied on group name. + GroupName *string `mandatory:"false" contributesTo:"query" name:"groupName"` + + // A filter to return only data objects that match the entire data object name. By default, no filtering will be applied on data object name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` @@ -180,16 +186,19 @@ type ListOpsiDataObjectsSortByEnum string const ( ListOpsiDataObjectsSortByDisplayname ListOpsiDataObjectsSortByEnum = "displayName" ListOpsiDataObjectsSortByDataobjecttype ListOpsiDataObjectsSortByEnum = "dataObjectType" + ListOpsiDataObjectsSortByName ListOpsiDataObjectsSortByEnum = "name" ) var mappingListOpsiDataObjectsSortByEnum = map[string]ListOpsiDataObjectsSortByEnum{ "displayName": ListOpsiDataObjectsSortByDisplayname, "dataObjectType": ListOpsiDataObjectsSortByDataobjecttype, + "name": ListOpsiDataObjectsSortByName, } var mappingListOpsiDataObjectsSortByEnumLowerCase = map[string]ListOpsiDataObjectsSortByEnum{ "displayname": ListOpsiDataObjectsSortByDisplayname, "dataobjecttype": ListOpsiDataObjectsSortByDataobjecttype, + "name": ListOpsiDataObjectsSortByName, } // GetListOpsiDataObjectsSortByEnumValues Enumerates the set of values for ListOpsiDataObjectsSortByEnum @@ -206,6 +215,7 @@ func GetListOpsiDataObjectsSortByEnumStringValues() []string { return []string{ "displayName", "dataObjectType", + "name", } } diff --git a/opsi/list_warehouse_data_objects_request_response.go b/opsi/list_warehouse_data_objects_request_response.go new file mode 100644 index 0000000000..22af80ef6a --- /dev/null +++ b/opsi/list_warehouse_data_objects_request_response.go @@ -0,0 +1,314 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWarehouseDataObjectsRequest wrapper for the ListWarehouseDataObjects operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListWarehouseDataObjects.go.html to see an example of how to use ListWarehouseDataObjectsRequest. +type ListWarehouseDataObjectsRequest struct { + + // Type of the Warehouse. + WarehouseType ListWarehouseDataObjectsWarehouseTypeEnum `mandatory:"true" contributesTo:"path" name:"warehouseType"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a Warehouse. + WarehouseId *string `mandatory:"true" contributesTo:"path" name:"warehouseId"` + + // A filter to return only data objects that match the data object type. By default, no filtering will be applied on data object type. + DataObjectType []DataObjectTypeEnum `contributesTo:"query" name:"dataObjectType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only data objects that match the entire data object name. By default, no filtering will be applied on data object name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return only data objects that match the entire data object owner name. By default, no filtering will be applied on data object owner name. + Owner *string `mandatory:"false" contributesTo:"query" name:"owner"` + + // 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/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from + // the previous "List" call. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWarehouseDataObjectsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Sort options for Warehouse data objects list. + SortBy ListWarehouseDataObjectsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Specifies the optional fields to return in a WarehouseDataObjectSummary. Unless requested, these fields are not returned by default. + SummaryField []ListWarehouseDataObjectsSummaryFieldEnum `contributesTo:"query" name:"summaryField" omitEmpty:"true" collectionFormat:"multi"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWarehouseDataObjectsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWarehouseDataObjectsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWarehouseDataObjectsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWarehouseDataObjectsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWarehouseDataObjectsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWarehouseDataObjectsWarehouseTypeEnum(string(request.WarehouseType)); !ok && request.WarehouseType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WarehouseType: %s. Supported values are: %s.", request.WarehouseType, strings.Join(GetListWarehouseDataObjectsWarehouseTypeEnumStringValues(), ","))) + } + for _, val := range request.DataObjectType { + if _, ok := GetMappingDataObjectTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataObjectType: %s. Supported values are: %s.", val, strings.Join(GetDataObjectTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListWarehouseDataObjectsSortOrderEnum(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(GetListWarehouseDataObjectsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWarehouseDataObjectsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWarehouseDataObjectsSortByEnumStringValues(), ","))) + } + for _, val := range request.SummaryField { + if _, ok := GetMappingListWarehouseDataObjectsSummaryFieldEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SummaryField: %s. Supported values are: %s.", val, strings.Join(GetListWarehouseDataObjectsSummaryFieldEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWarehouseDataObjectsResponse wrapper for the ListWarehouseDataObjects operation +type ListWarehouseDataObjectsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WarehouseDataObjectCollection instances + WarehouseDataObjectCollection `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 ListWarehouseDataObjectsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWarehouseDataObjectsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWarehouseDataObjectsWarehouseTypeEnum Enum with underlying type: string +type ListWarehouseDataObjectsWarehouseTypeEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsWarehouseTypeEnum +const ( + ListWarehouseDataObjectsWarehouseTypeAwrhubs ListWarehouseDataObjectsWarehouseTypeEnum = "awrHubs" +) + +var mappingListWarehouseDataObjectsWarehouseTypeEnum = map[string]ListWarehouseDataObjectsWarehouseTypeEnum{ + "awrHubs": ListWarehouseDataObjectsWarehouseTypeAwrhubs, +} + +var mappingListWarehouseDataObjectsWarehouseTypeEnumLowerCase = map[string]ListWarehouseDataObjectsWarehouseTypeEnum{ + "awrhubs": ListWarehouseDataObjectsWarehouseTypeAwrhubs, +} + +// GetListWarehouseDataObjectsWarehouseTypeEnumValues Enumerates the set of values for ListWarehouseDataObjectsWarehouseTypeEnum +func GetListWarehouseDataObjectsWarehouseTypeEnumValues() []ListWarehouseDataObjectsWarehouseTypeEnum { + values := make([]ListWarehouseDataObjectsWarehouseTypeEnum, 0) + for _, v := range mappingListWarehouseDataObjectsWarehouseTypeEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsWarehouseTypeEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsWarehouseTypeEnum +func GetListWarehouseDataObjectsWarehouseTypeEnumStringValues() []string { + return []string{ + "awrHubs", + } +} + +// GetMappingListWarehouseDataObjectsWarehouseTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsWarehouseTypeEnum(val string) (ListWarehouseDataObjectsWarehouseTypeEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsWarehouseTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWarehouseDataObjectsSortOrderEnum Enum with underlying type: string +type ListWarehouseDataObjectsSortOrderEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsSortOrderEnum +const ( + ListWarehouseDataObjectsSortOrderAsc ListWarehouseDataObjectsSortOrderEnum = "ASC" + ListWarehouseDataObjectsSortOrderDesc ListWarehouseDataObjectsSortOrderEnum = "DESC" +) + +var mappingListWarehouseDataObjectsSortOrderEnum = map[string]ListWarehouseDataObjectsSortOrderEnum{ + "ASC": ListWarehouseDataObjectsSortOrderAsc, + "DESC": ListWarehouseDataObjectsSortOrderDesc, +} + +var mappingListWarehouseDataObjectsSortOrderEnumLowerCase = map[string]ListWarehouseDataObjectsSortOrderEnum{ + "asc": ListWarehouseDataObjectsSortOrderAsc, + "desc": ListWarehouseDataObjectsSortOrderDesc, +} + +// GetListWarehouseDataObjectsSortOrderEnumValues Enumerates the set of values for ListWarehouseDataObjectsSortOrderEnum +func GetListWarehouseDataObjectsSortOrderEnumValues() []ListWarehouseDataObjectsSortOrderEnum { + values := make([]ListWarehouseDataObjectsSortOrderEnum, 0) + for _, v := range mappingListWarehouseDataObjectsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsSortOrderEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsSortOrderEnum +func GetListWarehouseDataObjectsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWarehouseDataObjectsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsSortOrderEnum(val string) (ListWarehouseDataObjectsSortOrderEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWarehouseDataObjectsSortByEnum Enum with underlying type: string +type ListWarehouseDataObjectsSortByEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsSortByEnum +const ( + ListWarehouseDataObjectsSortByDataobjecttype ListWarehouseDataObjectsSortByEnum = "dataObjectType" + ListWarehouseDataObjectsSortByName ListWarehouseDataObjectsSortByEnum = "name" + ListWarehouseDataObjectsSortByOwner ListWarehouseDataObjectsSortByEnum = "owner" +) + +var mappingListWarehouseDataObjectsSortByEnum = map[string]ListWarehouseDataObjectsSortByEnum{ + "dataObjectType": ListWarehouseDataObjectsSortByDataobjecttype, + "name": ListWarehouseDataObjectsSortByName, + "owner": ListWarehouseDataObjectsSortByOwner, +} + +var mappingListWarehouseDataObjectsSortByEnumLowerCase = map[string]ListWarehouseDataObjectsSortByEnum{ + "dataobjecttype": ListWarehouseDataObjectsSortByDataobjecttype, + "name": ListWarehouseDataObjectsSortByName, + "owner": ListWarehouseDataObjectsSortByOwner, +} + +// GetListWarehouseDataObjectsSortByEnumValues Enumerates the set of values for ListWarehouseDataObjectsSortByEnum +func GetListWarehouseDataObjectsSortByEnumValues() []ListWarehouseDataObjectsSortByEnum { + values := make([]ListWarehouseDataObjectsSortByEnum, 0) + for _, v := range mappingListWarehouseDataObjectsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsSortByEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsSortByEnum +func GetListWarehouseDataObjectsSortByEnumStringValues() []string { + return []string{ + "dataObjectType", + "name", + "owner", + } +} + +// GetMappingListWarehouseDataObjectsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsSortByEnum(val string) (ListWarehouseDataObjectsSortByEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWarehouseDataObjectsSummaryFieldEnum Enum with underlying type: string +type ListWarehouseDataObjectsSummaryFieldEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsSummaryFieldEnum +const ( + ListWarehouseDataObjectsSummaryFieldDetails ListWarehouseDataObjectsSummaryFieldEnum = "details" +) + +var mappingListWarehouseDataObjectsSummaryFieldEnum = map[string]ListWarehouseDataObjectsSummaryFieldEnum{ + "details": ListWarehouseDataObjectsSummaryFieldDetails, +} + +var mappingListWarehouseDataObjectsSummaryFieldEnumLowerCase = map[string]ListWarehouseDataObjectsSummaryFieldEnum{ + "details": ListWarehouseDataObjectsSummaryFieldDetails, +} + +// GetListWarehouseDataObjectsSummaryFieldEnumValues Enumerates the set of values for ListWarehouseDataObjectsSummaryFieldEnum +func GetListWarehouseDataObjectsSummaryFieldEnumValues() []ListWarehouseDataObjectsSummaryFieldEnum { + values := make([]ListWarehouseDataObjectsSummaryFieldEnum, 0) + for _, v := range mappingListWarehouseDataObjectsSummaryFieldEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsSummaryFieldEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsSummaryFieldEnum +func GetListWarehouseDataObjectsSummaryFieldEnumStringValues() []string { + return []string{ + "details", + } +} + +// GetMappingListWarehouseDataObjectsSummaryFieldEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsSummaryFieldEnum(val string) (ListWarehouseDataObjectsSummaryFieldEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsSummaryFieldEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/operation_type.go b/opsi/operation_type.go index 144a47db69..b711995d59 100644 --- a/opsi/operation_type.go +++ b/opsi/operation_type.go @@ -69,6 +69,12 @@ const ( OperationTypeEnableAdbAdvancedFeatures OperationTypeEnum = "ENABLE_ADB_ADVANCED_FEATURES" OperationTypeDisableAdbAdvancedFeatures OperationTypeEnum = "DISABLE_ADB_ADVANCED_FEATURES" OperationTypeUpdateAdbAdvancedFeatures OperationTypeEnum = "UPDATE_ADB_ADVANCED_FEATURES" + OperationTypeCreateNewsReport OperationTypeEnum = "CREATE_NEWS_REPORT" + OperationTypeEnableNewsReport OperationTypeEnum = "ENABLE_NEWS_REPORT" + OperationTypeDisableNewsReport OperationTypeEnum = "DISABLE_NEWS_REPORT" + OperationTypeUpdateNewsReport OperationTypeEnum = "UPDATE_NEWS_REPORT" + OperationTypeMoveNewsReport OperationTypeEnum = "MOVE_NEWS_REPORT" + OperationTypeDeleteNewsReport OperationTypeEnum = "DELETE_NEWS_REPORT" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ @@ -121,6 +127,12 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "ENABLE_ADB_ADVANCED_FEATURES": OperationTypeEnableAdbAdvancedFeatures, "DISABLE_ADB_ADVANCED_FEATURES": OperationTypeDisableAdbAdvancedFeatures, "UPDATE_ADB_ADVANCED_FEATURES": OperationTypeUpdateAdbAdvancedFeatures, + "CREATE_NEWS_REPORT": OperationTypeCreateNewsReport, + "ENABLE_NEWS_REPORT": OperationTypeEnableNewsReport, + "DISABLE_NEWS_REPORT": OperationTypeDisableNewsReport, + "UPDATE_NEWS_REPORT": OperationTypeUpdateNewsReport, + "MOVE_NEWS_REPORT": OperationTypeMoveNewsReport, + "DELETE_NEWS_REPORT": OperationTypeDeleteNewsReport, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ @@ -173,6 +185,12 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "enable_adb_advanced_features": OperationTypeEnableAdbAdvancedFeatures, "disable_adb_advanced_features": OperationTypeDisableAdbAdvancedFeatures, "update_adb_advanced_features": OperationTypeUpdateAdbAdvancedFeatures, + "create_news_report": OperationTypeCreateNewsReport, + "enable_news_report": OperationTypeEnableNewsReport, + "disable_news_report": OperationTypeDisableNewsReport, + "update_news_report": OperationTypeUpdateNewsReport, + "move_news_report": OperationTypeMoveNewsReport, + "delete_news_report": OperationTypeDeleteNewsReport, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -236,6 +254,12 @@ func GetOperationTypeEnumStringValues() []string { "ENABLE_ADB_ADVANCED_FEATURES", "DISABLE_ADB_ADVANCED_FEATURES", "UPDATE_ADB_ADVANCED_FEATURES", + "CREATE_NEWS_REPORT", + "ENABLE_NEWS_REPORT", + "DISABLE_NEWS_REPORT", + "UPDATE_NEWS_REPORT", + "MOVE_NEWS_REPORT", + "DELETE_NEWS_REPORT", } } diff --git a/opsi/opsi_data_object.go b/opsi/opsi_data_object.go index ec5ceda84b..143c13145d 100644 --- a/opsi/opsi_data_object.go +++ b/opsi/opsi_data_object.go @@ -32,15 +32,33 @@ type OpsiDataObject interface { // Description of OPSI data object. GetDescription() *string + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + GetName() *string + + // Names of all the groups to which the data object belongs to. + GetGroupNames() []string + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + GetSupportedQueryTimePeriod() *string + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam } type opsidataobject struct { - JsonData []byte - Identifier *string `mandatory:"true" json:"identifier"` - DisplayName *string `mandatory:"true" json:"displayName"` - ColumnsMetadata []DataObjectColumnMetadata `mandatory:"true" json:"columnsMetadata"` - Description *string `mandatory:"false" json:"description"` - DataObjectType string `json:"dataObjectType"` + JsonData []byte + Identifier *string `mandatory:"true" json:"identifier"` + DisplayName *string `mandatory:"true" json:"displayName"` + ColumnsMetadata []DataObjectColumnMetadata `mandatory:"true" json:"columnsMetadata"` + Description *string `mandatory:"false" json:"description"` + Name *string `mandatory:"false" json:"name"` + GroupNames []string `mandatory:"false" json:"groupNames"` + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` + DataObjectType string `json:"dataObjectType"` } // UnmarshalJSON unmarshals json @@ -58,6 +76,10 @@ func (m *opsidataobject) UnmarshalJSON(data []byte) error { m.DisplayName = s.Model.DisplayName m.ColumnsMetadata = s.Model.ColumnsMetadata m.Description = s.Model.Description + m.Name = s.Model.Name + m.GroupNames = s.Model.GroupNames + m.SupportedQueryTimePeriod = s.Model.SupportedQueryTimePeriod + m.SupportedQueryParams = s.Model.SupportedQueryParams m.DataObjectType = s.Model.DataObjectType return err @@ -110,6 +132,26 @@ func (m opsidataobject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m opsidataobject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m opsidataobject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m opsidataobject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + +//GetSupportedQueryParams returns SupportedQueryParams +func (m opsidataobject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m opsidataobject) String() string { return common.PointerString(m) } diff --git a/opsi/opsi_data_object_details_in_query.go b/opsi/opsi_data_object_details_in_query.go new file mode 100644 index 0000000000..73dc38b1ad --- /dev/null +++ b/opsi/opsi_data_object_details_in_query.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectDetailsInQuery Details for OPSI data object used in a data object query. +type OpsiDataObjectDetailsInQuery interface { + + // An array of query parameters to be applied, for the OPSI data objects targetted by dataObjectDetailsTarget, before executing the query. + // Refer to supportedQueryParams of OpsiDataObject for the supported query parameters. + GetQueryParams() []OpsiDataObjectQueryParam +} + +type opsidataobjectdetailsinquery struct { + JsonData []byte + QueryParams []OpsiDataObjectQueryParam `mandatory:"false" json:"queryParams"` + DataObjectDetailsTarget string `json:"dataObjectDetailsTarget"` +} + +// UnmarshalJSON unmarshals json +func (m *opsidataobjectdetailsinquery) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshaleropsidataobjectdetailsinquery opsidataobjectdetailsinquery + s := struct { + Model Unmarshaleropsidataobjectdetailsinquery + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.QueryParams = s.Model.QueryParams + m.DataObjectDetailsTarget = s.Model.DataObjectDetailsTarget + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *opsidataobjectdetailsinquery) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.DataObjectDetailsTarget { + case "INDIVIDUAL_OPSIDATAOBJECT": + mm := IndividualOpsiDataObjectDetailsInQuery{} + err = json.Unmarshal(data, &mm) + return mm, err + case "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS": + mm := OpsiDataObjectTypeOpsiDataObjectDetailsInQuery{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for OpsiDataObjectDetailsInQuery: %s.", m.DataObjectDetailsTarget) + return *m, nil + } +} + +//GetQueryParams returns QueryParams +func (m opsidataobjectdetailsinquery) GetQueryParams() []OpsiDataObjectQueryParam { + return m.QueryParams +} + +func (m opsidataobjectdetailsinquery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m opsidataobjectdetailsinquery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/opsi_data_object_details_target.go b/opsi/opsi_data_object_details_target.go new file mode 100644 index 0000000000..2cc89fe26f --- /dev/null +++ b/opsi/opsi_data_object_details_target.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// OpsiDataObjectDetailsTargetEnum Enum with underlying type: string +type OpsiDataObjectDetailsTargetEnum string + +// Set of constants representing the allowable values for OpsiDataObjectDetailsTargetEnum +const ( + OpsiDataObjectDetailsTargetIndividualOpsidataobject OpsiDataObjectDetailsTargetEnum = "INDIVIDUAL_OPSIDATAOBJECT" + OpsiDataObjectDetailsTargetOpsidataobjecttypeOpsidataobjects OpsiDataObjectDetailsTargetEnum = "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS" +) + +var mappingOpsiDataObjectDetailsTargetEnum = map[string]OpsiDataObjectDetailsTargetEnum{ + "INDIVIDUAL_OPSIDATAOBJECT": OpsiDataObjectDetailsTargetIndividualOpsidataobject, + "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS": OpsiDataObjectDetailsTargetOpsidataobjecttypeOpsidataobjects, +} + +var mappingOpsiDataObjectDetailsTargetEnumLowerCase = map[string]OpsiDataObjectDetailsTargetEnum{ + "individual_opsidataobject": OpsiDataObjectDetailsTargetIndividualOpsidataobject, + "opsidataobjecttype_opsidataobjects": OpsiDataObjectDetailsTargetOpsidataobjecttypeOpsidataobjects, +} + +// GetOpsiDataObjectDetailsTargetEnumValues Enumerates the set of values for OpsiDataObjectDetailsTargetEnum +func GetOpsiDataObjectDetailsTargetEnumValues() []OpsiDataObjectDetailsTargetEnum { + values := make([]OpsiDataObjectDetailsTargetEnum, 0) + for _, v := range mappingOpsiDataObjectDetailsTargetEnum { + values = append(values, v) + } + return values +} + +// GetOpsiDataObjectDetailsTargetEnumStringValues Enumerates the set of values in String for OpsiDataObjectDetailsTargetEnum +func GetOpsiDataObjectDetailsTargetEnumStringValues() []string { + return []string{ + "INDIVIDUAL_OPSIDATAOBJECT", + "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS", + } +} + +// GetMappingOpsiDataObjectDetailsTargetEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOpsiDataObjectDetailsTargetEnum(val string) (OpsiDataObjectDetailsTargetEnum, bool) { + enum, ok := mappingOpsiDataObjectDetailsTargetEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/opsi_data_object_query_param.go b/opsi/opsi_data_object_query_param.go new file mode 100644 index 0000000000..768ef53b12 --- /dev/null +++ b/opsi/opsi_data_object_query_param.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectQueryParam Details for a query parameter to be applied on an OPSI data object, when a data object query is executed. +type OpsiDataObjectQueryParam struct { + + // Name of the query parameter. + Name *string `mandatory:"true" json:"name"` + + // Value for the query parameter. + Value *interface{} `mandatory:"true" json:"value"` +} + +func (m OpsiDataObjectQueryParam) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiDataObjectQueryParam) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/opsi_data_object_summary.go b/opsi/opsi_data_object_summary.go index 05be4b64d8..21e6b8fc73 100644 --- a/opsi/opsi_data_object_summary.go +++ b/opsi/opsi_data_object_summary.go @@ -29,14 +29,22 @@ type OpsiDataObjectSummary interface { // Description of OPSI data object. GetDescription() *string + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + GetName() *string + + // Names of all the groups to which the data object belongs to. + GetGroupNames() []string } type opsidataobjectsummary struct { JsonData []byte - Identifier *string `mandatory:"true" json:"identifier"` - DisplayName *string `mandatory:"true" json:"displayName"` - Description *string `mandatory:"false" json:"description"` - DataObjectType string `json:"dataObjectType"` + Identifier *string `mandatory:"true" json:"identifier"` + DisplayName *string `mandatory:"true" json:"displayName"` + Description *string `mandatory:"false" json:"description"` + Name *string `mandatory:"false" json:"name"` + GroupNames []string `mandatory:"false" json:"groupNames"` + DataObjectType string `json:"dataObjectType"` } // UnmarshalJSON unmarshals json @@ -53,6 +61,8 @@ func (m *opsidataobjectsummary) UnmarshalJSON(data []byte) error { m.Identifier = s.Model.Identifier m.DisplayName = s.Model.DisplayName m.Description = s.Model.Description + m.Name = s.Model.Name + m.GroupNames = s.Model.GroupNames m.DataObjectType = s.Model.DataObjectType return err @@ -100,6 +110,16 @@ func (m opsidataobjectsummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m opsidataobjectsummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m opsidataobjectsummary) GetGroupNames() []string { + return m.GroupNames +} + func (m opsidataobjectsummary) String() string { return common.PointerString(m) } diff --git a/opsi/opsi_data_object_supported_query_param.go b/opsi/opsi_data_object_supported_query_param.go new file mode 100644 index 0000000000..0e8ade0044 --- /dev/null +++ b/opsi/opsi_data_object_supported_query_param.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectSupportedQueryParam Details of query parameter supported by an OPSI data object. +type OpsiDataObjectSupportedQueryParam struct { + + // Name of the query parameter. + Name *string `mandatory:"true" json:"name"` + + // Description of the query parameter. + Description *string `mandatory:"false" json:"description"` + + // Data type of the for the query parameter. + DataType *string `mandatory:"false" json:"dataType"` +} + +func (m OpsiDataObjectSupportedQueryParam) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiDataObjectSupportedQueryParam) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/opsi_data_object_type_opsi_data_object_details_in_query.go b/opsi/opsi_data_object_type_opsi_data_object_details_in_query.go new file mode 100644 index 0000000000..7965c4d748 --- /dev/null +++ b/opsi/opsi_data_object_type_opsi_data_object_details_in_query.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectTypeOpsiDataObjectDetailsInQuery Details applicable for all OPSI data objects of a specific OpsiDataObjectType used in a data object query. +type OpsiDataObjectTypeOpsiDataObjectDetailsInQuery struct { + + // An array of query parameters to be applied, for the OPSI data objects targetted by dataObjectDetailsTarget, before executing the query. + // Refer to supportedQueryParams of OpsiDataObject for the supported query parameters. + QueryParams []OpsiDataObjectQueryParam `mandatory:"false" json:"queryParams"` + + // Type of OPSI data object. + DataObjectType OpsiDataObjectTypeEnum `mandatory:"true" json:"dataObjectType"` +} + +//GetQueryParams returns QueryParams +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) GetQueryParams() []OpsiDataObjectQueryParam { + return m.QueryParams +} + +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingOpsiDataObjectTypeEnum(string(m.DataObjectType)); !ok && m.DataObjectType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataObjectType: %s. Supported values are: %s.", m.DataObjectType, strings.Join(GetOpsiDataObjectTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeOpsiDataObjectTypeOpsiDataObjectDetailsInQuery OpsiDataObjectTypeOpsiDataObjectDetailsInQuery + s := struct { + DiscriminatorParam string `json:"dataObjectDetailsTarget"` + MarshalTypeOpsiDataObjectTypeOpsiDataObjectDetailsInQuery + }{ + "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS", + (MarshalTypeOpsiDataObjectTypeOpsiDataObjectDetailsInQuery)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/opsi_operationsinsights_client.go b/opsi/opsi_operationsinsights_client.go index 0ad7a700ec..a4b2f771d2 100644 --- a/opsi/opsi_operationsinsights_client.go +++ b/opsi/opsi_operationsinsights_client.go @@ -5646,6 +5646,64 @@ func (client OperationsInsightsClient) listSqlTexts(ctx context.Context, request return response, err } +// ListWarehouseDataObjects Gets a list of Warehouse data objects (e.g: views, tables), based on the query parameters specified. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListWarehouseDataObjects.go.html to see an example of how to use ListWarehouseDataObjects API. +// A default retry strategy applies to this operation ListWarehouseDataObjects() +func (client OperationsInsightsClient) ListWarehouseDataObjects(ctx context.Context, request ListWarehouseDataObjectsRequest) (response ListWarehouseDataObjectsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWarehouseDataObjects, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWarehouseDataObjectsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWarehouseDataObjectsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWarehouseDataObjectsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWarehouseDataObjectsResponse") + } + return +} + +// listWarehouseDataObjects implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) listWarehouseDataObjects(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/{warehouseType}/{warehouseId}/dataObjects", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWarehouseDataObjectsResponse + 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/operations-insights/20200630/OpsiWarehouseDataObjects/ListWarehouseDataObjects" + err = common.PostProcessServiceError(err, "OperationsInsights", "ListWarehouseDataObjects", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListWorkRequestErrors Return a (paginated) list of errors for a given work request. // // See also @@ -5879,6 +5937,65 @@ func (client OperationsInsightsClient) queryOpsiDataObjectData(ctx context.Conte return response, err } +// QueryWarehouseDataObjectData Queries Warehouse data objects (e.g: views, tables) with the inputs provided and sends the result set back. +// Any data to which an OperationsInsightsWarehouseUser with a permission to the corresponding Warehouse can be queried. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/QueryWarehouseDataObjectData.go.html to see an example of how to use QueryWarehouseDataObjectData API. +// A default retry strategy applies to this operation QueryWarehouseDataObjectData() +func (client OperationsInsightsClient) QueryWarehouseDataObjectData(ctx context.Context, request QueryWarehouseDataObjectDataRequest) (response QueryWarehouseDataObjectDataResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.queryWarehouseDataObjectData, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = QueryWarehouseDataObjectDataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = QueryWarehouseDataObjectDataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(QueryWarehouseDataObjectDataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into QueryWarehouseDataObjectDataResponse") + } + return +} + +// queryWarehouseDataObjectData implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) queryWarehouseDataObjectData(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/{warehouseType}/{warehouseId}/actions/queryData", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response QueryWarehouseDataObjectDataResponse + 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/operations-insights/20200630/OpsiWarehouseDataObjects/QueryWarehouseDataObjectData" + err = common.PostProcessServiceError(err, "OperationsInsights", "QueryWarehouseDataObjectData", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &querydataobjectresultsetrowscollection{}) + return response, err +} + // RotateOperationsInsightsWarehouseWallet Rotate the ADW wallet for Operations Insights Warehouse using which the Hub data is exposed. // // See also diff --git a/opsi/opsi_warehouse_data_objects.go b/opsi/opsi_warehouse_data_objects.go new file mode 100644 index 0000000000..2c88801bcc --- /dev/null +++ b/opsi/opsi_warehouse_data_objects.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiWarehouseDataObjects Logical grouping used for Operations Insights Warehouse data objects operations. +type OpsiWarehouseDataObjects struct { + + // Operations Insights Warehouse Data Object. + OpsiWarehouseDataObjects *interface{} `mandatory:"false" json:"opsiWarehouseDataObjects"` +} + +func (m OpsiWarehouseDataObjects) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiWarehouseDataObjects) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/query_data_object_json_result_set_rows_collection.go b/opsi/query_data_object_json_result_set_rows_collection.go index 00ad7dedf8..a926d95eef 100644 --- a/opsi/query_data_object_json_result_set_rows_collection.go +++ b/opsi/query_data_object_json_result_set_rows_collection.go @@ -26,6 +26,10 @@ type QueryDataObjectJsonResultSetRowsCollection struct { // Array of QueryDataObjectResultSetColumnMetadata objects that describe the result set columns. ItemsMetadata []QueryDataObjectResultSetColumnMetadata `mandatory:"true" json:"itemsMetadata"` + + // Time taken for executing the data object query (in seconds). + // Consider optimizing the query or reducing the target data range, if query execution time is longer. + QueryExecutionTimeInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeInSeconds"` } func (m QueryDataObjectJsonResultSetRowsCollection) String() string { diff --git a/opsi/query_data_object_result_set_column_metadata.go b/opsi/query_data_object_result_set_column_metadata.go index 68e23c8b09..4b297f376e 100644 --- a/opsi/query_data_object_result_set_column_metadata.go +++ b/opsi/query_data_object_result_set_column_metadata.go @@ -23,6 +23,9 @@ type QueryDataObjectResultSetColumnMetadata struct { // Name of the column in a data object query result set. Name *string `mandatory:"true" json:"name"` + // Type of the column in a data object query result. + DataType *string `mandatory:"false" json:"dataType"` + // Type name of the column in a data object query result set. DataTypeName QueryDataObjectResultSetColumnMetadataDataTypeNameEnum `mandatory:"false" json:"dataTypeName,omitempty"` } @@ -54,18 +57,21 @@ const ( QueryDataObjectResultSetColumnMetadataDataTypeNameNumber QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "NUMBER" QueryDataObjectResultSetColumnMetadataDataTypeNameTimestamp QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "TIMESTAMP" QueryDataObjectResultSetColumnMetadataDataTypeNameVarchar2 QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "VARCHAR2" + QueryDataObjectResultSetColumnMetadataDataTypeNameOther QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "OTHER" ) var mappingQueryDataObjectResultSetColumnMetadataDataTypeNameEnum = map[string]QueryDataObjectResultSetColumnMetadataDataTypeNameEnum{ "NUMBER": QueryDataObjectResultSetColumnMetadataDataTypeNameNumber, "TIMESTAMP": QueryDataObjectResultSetColumnMetadataDataTypeNameTimestamp, "VARCHAR2": QueryDataObjectResultSetColumnMetadataDataTypeNameVarchar2, + "OTHER": QueryDataObjectResultSetColumnMetadataDataTypeNameOther, } var mappingQueryDataObjectResultSetColumnMetadataDataTypeNameEnumLowerCase = map[string]QueryDataObjectResultSetColumnMetadataDataTypeNameEnum{ "number": QueryDataObjectResultSetColumnMetadataDataTypeNameNumber, "timestamp": QueryDataObjectResultSetColumnMetadataDataTypeNameTimestamp, "varchar2": QueryDataObjectResultSetColumnMetadataDataTypeNameVarchar2, + "other": QueryDataObjectResultSetColumnMetadataDataTypeNameOther, } // GetQueryDataObjectResultSetColumnMetadataDataTypeNameEnumValues Enumerates the set of values for QueryDataObjectResultSetColumnMetadataDataTypeNameEnum @@ -83,6 +89,7 @@ func GetQueryDataObjectResultSetColumnMetadataDataTypeNameEnumStringValues() []s "NUMBER", "TIMESTAMP", "VARCHAR2", + "OTHER", } } diff --git a/opsi/query_opsi_data_object_data_details.go b/opsi/query_opsi_data_object_data_details.go index 9e73848c8e..69ca4f5d0c 100644 --- a/opsi/query_opsi_data_object_data_details.go +++ b/opsi/query_opsi_data_object_data_details.go @@ -25,6 +25,9 @@ type QueryOpsiDataObjectDataDetails struct { // Unique OPSI data object identifier. DataObjectIdentifier *string `mandatory:"false" json:"dataObjectIdentifier"` + // Details of OPSI data objects used in the query. + DataObjects []OpsiDataObjectDetailsInQuery `mandatory:"false" json:"dataObjects"` + ResourceFilters *ResourceFilters `mandatory:"false" json:"resourceFilters"` } @@ -47,9 +50,10 @@ func (m QueryOpsiDataObjectDataDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *QueryOpsiDataObjectDataDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DataObjectIdentifier *string `json:"dataObjectIdentifier"` - ResourceFilters *ResourceFilters `json:"resourceFilters"` - Query dataobjectquery `json:"query"` + DataObjectIdentifier *string `json:"dataObjectIdentifier"` + DataObjects []opsidataobjectdetailsinquery `json:"dataObjects"` + ResourceFilters *ResourceFilters `json:"resourceFilters"` + Query dataobjectquery `json:"query"` }{} e = json.Unmarshal(data, &model) @@ -59,6 +63,19 @@ func (m *QueryOpsiDataObjectDataDetails) UnmarshalJSON(data []byte) (e error) { var nn interface{} m.DataObjectIdentifier = model.DataObjectIdentifier + m.DataObjects = make([]OpsiDataObjectDetailsInQuery, len(model.DataObjects)) + for i, n := range model.DataObjects { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.DataObjects[i] = nn.(OpsiDataObjectDetailsInQuery) + } else { + m.DataObjects[i] = nil + } + } + m.ResourceFilters = model.ResourceFilters nn, e = model.Query.UnmarshalPolymorphicJSON(model.Query.JsonData) diff --git a/opsi/query_warehouse_data_object_data_details.go b/opsi/query_warehouse_data_object_data_details.go new file mode 100644 index 0000000000..12dc1ab644 --- /dev/null +++ b/opsi/query_warehouse_data_object_data_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueryWarehouseDataObjectDataDetails Information required to form and execute Operations Insights Warehouse data objects query. +type QueryWarehouseDataObjectDataDetails struct { + Query DataObjectQuery `mandatory:"true" json:"query"` +} + +func (m QueryWarehouseDataObjectDataDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m QueryWarehouseDataObjectDataDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *QueryWarehouseDataObjectDataDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Query dataobjectquery `json:"query"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Query.UnmarshalPolymorphicJSON(model.Query.JsonData) + if e != nil { + return + } + if nn != nil { + m.Query = nn.(DataObjectQuery) + } else { + m.Query = nil + } + + return +} diff --git a/opsi/query_warehouse_data_object_data_request_response.go b/opsi/query_warehouse_data_object_data_request_response.go new file mode 100644 index 0000000000..41be9c5de2 --- /dev/null +++ b/opsi/query_warehouse_data_object_data_request_response.go @@ -0,0 +1,155 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// QueryWarehouseDataObjectDataRequest wrapper for the QueryWarehouseDataObjectData operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/QueryWarehouseDataObjectData.go.html to see an example of how to use QueryWarehouseDataObjectDataRequest. +type QueryWarehouseDataObjectDataRequest struct { + + // Type of the Warehouse. + WarehouseType QueryWarehouseDataObjectDataWarehouseTypeEnum `mandatory:"true" contributesTo:"path" name:"warehouseType"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a Warehouse. + WarehouseId *string `mandatory:"true" contributesTo:"path" name:"warehouseId"` + + // The information to be used for querying a Warehouse. + QueryWarehouseDataObjectDataDetails `contributesTo:"body"` + + // 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/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from + // the previous "List" call. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `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 QueryWarehouseDataObjectDataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request QueryWarehouseDataObjectDataRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request QueryWarehouseDataObjectDataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request QueryWarehouseDataObjectDataRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request QueryWarehouseDataObjectDataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingQueryWarehouseDataObjectDataWarehouseTypeEnum(string(request.WarehouseType)); !ok && request.WarehouseType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WarehouseType: %s. Supported values are: %s.", request.WarehouseType, strings.Join(GetQueryWarehouseDataObjectDataWarehouseTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// QueryWarehouseDataObjectDataResponse wrapper for the QueryWarehouseDataObjectData operation +type QueryWarehouseDataObjectDataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of QueryDataObjectResultSetRowsCollection instances + QueryDataObjectResultSetRowsCollection `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 QueryWarehouseDataObjectDataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response QueryWarehouseDataObjectDataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// QueryWarehouseDataObjectDataWarehouseTypeEnum Enum with underlying type: string +type QueryWarehouseDataObjectDataWarehouseTypeEnum string + +// Set of constants representing the allowable values for QueryWarehouseDataObjectDataWarehouseTypeEnum +const ( + QueryWarehouseDataObjectDataWarehouseTypeAwrhubs QueryWarehouseDataObjectDataWarehouseTypeEnum = "awrHubs" +) + +var mappingQueryWarehouseDataObjectDataWarehouseTypeEnum = map[string]QueryWarehouseDataObjectDataWarehouseTypeEnum{ + "awrHubs": QueryWarehouseDataObjectDataWarehouseTypeAwrhubs, +} + +var mappingQueryWarehouseDataObjectDataWarehouseTypeEnumLowerCase = map[string]QueryWarehouseDataObjectDataWarehouseTypeEnum{ + "awrhubs": QueryWarehouseDataObjectDataWarehouseTypeAwrhubs, +} + +// GetQueryWarehouseDataObjectDataWarehouseTypeEnumValues Enumerates the set of values for QueryWarehouseDataObjectDataWarehouseTypeEnum +func GetQueryWarehouseDataObjectDataWarehouseTypeEnumValues() []QueryWarehouseDataObjectDataWarehouseTypeEnum { + values := make([]QueryWarehouseDataObjectDataWarehouseTypeEnum, 0) + for _, v := range mappingQueryWarehouseDataObjectDataWarehouseTypeEnum { + values = append(values, v) + } + return values +} + +// GetQueryWarehouseDataObjectDataWarehouseTypeEnumStringValues Enumerates the set of values in String for QueryWarehouseDataObjectDataWarehouseTypeEnum +func GetQueryWarehouseDataObjectDataWarehouseTypeEnumStringValues() []string { + return []string{ + "awrHubs", + } +} + +// GetMappingQueryWarehouseDataObjectDataWarehouseTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingQueryWarehouseDataObjectDataWarehouseTypeEnum(val string) (QueryWarehouseDataObjectDataWarehouseTypeEnum, bool) { + enum, ok := mappingQueryWarehouseDataObjectDataWarehouseTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/warehouse_data_object_collection.go b/opsi/warehouse_data_object_collection.go new file mode 100644 index 0000000000..4053917f1a --- /dev/null +++ b/opsi/warehouse_data_object_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseDataObjectCollection Collection of Warehouse data object summary objects. +type WarehouseDataObjectCollection struct { + + // Array of Warehouse data object summary objects. + Items []WarehouseDataObjectSummary `mandatory:"true" json:"items"` +} + +func (m WarehouseDataObjectCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseDataObjectCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/warehouse_data_object_details.go b/opsi/warehouse_data_object_details.go new file mode 100644 index 0000000000..401ca25b67 --- /dev/null +++ b/opsi/warehouse_data_object_details.go @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseDataObjectDetails Warehouse data object details. +type WarehouseDataObjectDetails interface { +} + +type warehousedataobjectdetails struct { + JsonData []byte + DataObjectType string `json:"dataObjectType"` +} + +// UnmarshalJSON unmarshals json +func (m *warehousedataobjectdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerwarehousedataobjectdetails warehousedataobjectdetails + s := struct { + Model Unmarshalerwarehousedataobjectdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DataObjectType = s.Model.DataObjectType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *warehousedataobjectdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.DataObjectType { + case "VIEW": + mm := WarehouseViewDataObjectDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "TABLE": + mm := WarehouseTableDataObjectDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for WarehouseDataObjectDetails: %s.", m.DataObjectType) + return *m, nil + } +} + +func (m warehousedataobjectdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m warehousedataobjectdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/warehouse_data_object_summary.go b/opsi/warehouse_data_object_summary.go new file mode 100644 index 0000000000..555333ad21 --- /dev/null +++ b/opsi/warehouse_data_object_summary.go @@ -0,0 +1,86 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseDataObjectSummary Summary of a Warehouse data object. +type WarehouseDataObjectSummary struct { + + // Type of the data object. + DataObjectType DataObjectTypeEnum `mandatory:"true" json:"dataObjectType"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Owner of the data object, which can be used in data object queries in front of data object names just like SCHEMA.VIEW notation in queries. + Owner *string `mandatory:"false" json:"owner"` + + Details WarehouseDataObjectDetails `mandatory:"false" json:"details"` +} + +func (m WarehouseDataObjectSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseDataObjectSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDataObjectTypeEnum(string(m.DataObjectType)); !ok && m.DataObjectType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataObjectType: %s. Supported values are: %s.", m.DataObjectType, strings.Join(GetDataObjectTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *WarehouseDataObjectSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + Name *string `json:"name"` + Owner *string `json:"owner"` + Details warehousedataobjectdetails `json:"details"` + DataObjectType DataObjectTypeEnum `json:"dataObjectType"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Name = model.Name + + m.Owner = model.Owner + + nn, e = model.Details.UnmarshalPolymorphicJSON(model.Details.JsonData) + if e != nil { + return + } + if nn != nil { + m.Details = nn.(WarehouseDataObjectDetails) + } else { + m.Details = nil + } + + m.DataObjectType = model.DataObjectType + + return +} diff --git a/opsi/warehouse_table_data_object_details.go b/opsi/warehouse_table_data_object_details.go new file mode 100644 index 0000000000..d19f761ca8 --- /dev/null +++ b/opsi/warehouse_table_data_object_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseTableDataObjectDetails Details of a TABLE type data object in a Warehouse. +type WarehouseTableDataObjectDetails struct { + + // Metadata of columns in the data object. + ColumnsMetadata []DataObjectColumnMetadata `mandatory:"false" json:"columnsMetadata"` +} + +func (m WarehouseTableDataObjectDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseTableDataObjectDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m WarehouseTableDataObjectDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeWarehouseTableDataObjectDetails WarehouseTableDataObjectDetails + s := struct { + DiscriminatorParam string `json:"dataObjectType"` + MarshalTypeWarehouseTableDataObjectDetails + }{ + "TABLE", + (MarshalTypeWarehouseTableDataObjectDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/warehouse_view_data_object_details.go b/opsi/warehouse_view_data_object_details.go new file mode 100644 index 0000000000..57a8cff696 --- /dev/null +++ b/opsi/warehouse_view_data_object_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseViewDataObjectDetails Details of a VIEW type data object in a Warehouse. +type WarehouseViewDataObjectDetails struct { + + // Metadata of columns in the data object. + ColumnsMetadata []DataObjectColumnMetadata `mandatory:"false" json:"columnsMetadata"` +} + +func (m WarehouseViewDataObjectDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseViewDataObjectDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m WarehouseViewDataObjectDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeWarehouseViewDataObjectDetails WarehouseViewDataObjectDetails + s := struct { + DiscriminatorParam string `json:"dataObjectType"` + MarshalTypeWarehouseViewDataObjectDetails + }{ + "VIEW", + (MarshalTypeWarehouseViewDataObjectDetails)(m), + } + + return json.Marshal(&s) +}