diff --git a/CHANGELOG.md b/CHANGELOG.md index e3a1011add..3684f4d3c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.50.0 - 2023-10-17 +### Added +- Support for the Caching Service +- Support for the Marketplace Publisher service +- Support for higher limits for network firewalls in the Network Firewall service +- Support for exporting access request reports in the Lockbox service +- Support for storage mounts for jobs and notebooks in the Data Science service +- Support for unified agent operational metrics for the service configurations in the Logging Management service +- Support for Dynamic refresh for custom certs + +### Breaking Changes +- The properties `DisplayName` and `RqsType` were removed in the `Parameter` model in the Logging Management service +- The enum members `EnumString` and `RqsFilter` were remoeved from the `mappingParameterTypeEnum` in the `Parameter` model in the Logging Management service +- The property `ServiceStage` was removed in the `ListServicesRequest` model in the Logging Management service +- The models `TcpApplication` and `UdpApplication` were removed in the Network Firewall service +- The type `DecryptionProfileTypeEnum` was removed in the model `DecryptionProfile` in the Network Firewall service +- The properties `MappedSecrets`, `ApplicationLists`, `UrlLists`, `IpAddressLists`, `SecurityRules`, `DecryptionRules` and `DecryptionProfiles` were removed in the model `CreateNetworkFirewallPolicyDetails` in the Network Firewall service +- The type `DecryptionRuleActionEnum` was removed in the model `DecryptionRule` in the Network Firewall service +- The type of property `Action` was changed to `DecryptionActionTypeEnum` in the model `DecryptionRule` in the Network Firewall service +- The property `Sources` has been replaced by `SourceAddress` in the models `SecurityRuleMatchCriteria` and `DecryptionRuleMatchCriteria` in the Network Firewall service +- The property `Destinations` has been replaced by `DestinationAddress` in the models `SecurityRuleMatchCriteria` and `DecryptionRuleMatchCriteria` in the Network Firewall service +- The type `MappedSecretTypeEnum` was removed in the model `MappedSecret` in the Network Firewall service +- The type of property `Type` was changed to `InspectionType` in the model `MappedSecret` in the Network Firewall service +- The properties `ApplicationLists`, `UrlLists`, `IpAddressLists`, `SecurityRules`, `DecryptionRules`, `DecryptionProfiles`, `MappedSecrets` and `IsFirewallAttached` were removed in the model `NetworkFirewallPolicy` in the Network Firewall service +- The types `SecurityRuleActionEnum` and `SecurityRuleInspectionEnum` were removed in the model `SecurityRule` in the Network Firewall service +- The type of property `Action` was changed to `TrafficActionTypeEnum` in the model `SecurityRule` in the Network Firewall service +- The type of property `Inspection` was changed to `TrafficInspectionTypeEnum` in the model `SecurityRule` in the Network Firewall service +- The property `Applications` has been replaced by `Application` in the model `SecurityRuleMatchCriteria` in the Network Firewall service +- The property `Urls` has been replaced by `Url` in the model `SecurityRuleMatchCriteria` in the Network Firewall service +- The properties `MappedSecrets`, `ApplicationLists`, `UrlLists`, `IpAddressLists`, `SecurityRules`, `DecryptionRules` and `DecryptionProfiles` were removed in the model `UpdateNetworkFirewallPolicyDetails` in the Network Firewall service + + ## 65.49.4 - 2023-10-10 n### Added - Support for creating flow log type capture filters in the Virtual Cloud Network service diff --git a/Makefile b/Makefile index e6e56f17a3..f7538e4ad2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com -GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer ##SPECNAME## +GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer marketplacepublisher redis ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/common/client.go b/common/client.go index be43f8bbc8..524b4d07ed 100644 --- a/common/client.go +++ b/common/client.go @@ -7,13 +7,10 @@ package common import ( "bytes" "context" - "crypto/tls" - "crypto/x509" "fmt" "io" "io/ioutil" "math/rand" - "net" "net/http" "net/http/httputil" "net/url" @@ -23,6 +20,7 @@ import ( "path/filepath" "reflect" "runtime" + "strconv" "strings" "sync" "sync/atomic" @@ -103,13 +101,36 @@ const ( //circuitBreakerNumberOfHistoryResponseEnv is the number of recorded history responses circuitBreakerNumberOfHistoryResponseEnv = "OCI_SDK_CIRCUITBREAKER_NUM_HISTORY_RESPONSE" + // ociDefaultRefreshIntervalForCustomCerts is the env var for overriding the defaultRefreshIntervalForCustomCerts. + // The value represents the refresh interval in minutes and has a higher precedence than defaultRefreshIntervalForCustomCerts + // but has a lower precedence then the refresh interval configured via OciGlobalRefreshIntervalForCustomCerts + // If the value is negative, then it is assumed that this property is not configured + // if the value is Zero, then the refresh of custom certs will be disabled + ociDefaultRefreshIntervalForCustomCerts = "OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS" + // ociDefaultCertsPath is the env var for the path to the SSL cert file ociDefaultCertsPath = "OCI_DEFAULT_CERTS_PATH" + // ociDefaultClientCertsPath is the env var for the path to the custom client cert + ociDefaultClientCertsPath = "OCI_DEFAULT_CLIENT_CERTS_PATH" + + // ociDefaultClientCertsPrivateKeyPath is the env var for the path to the custom client cert private key + ociDefaultClientCertsPrivateKeyPath = "OCI_DEFAULT_CLIENT_CERTS_PRIVATE_KEY_PATH" + //maxAttemptsForRefreshableRetry is the number of retry when 401 happened on a refreshable auth type maxAttemptsForRefreshableRetry = 3 + + //defaultRefreshIntervalForCustomCerts is the default refresh interval in minutes + defaultRefreshIntervalForCustomCerts = 30 ) +// OciGlobalRefreshIntervalForCustomCerts is the global policy for overriding the refresh interval in minutes. +// This variable has a higher precedence than the env variable OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS +// and the defaultRefreshIntervalForCustomCerts values. +// If the value is negative, then it is assumed that this property is not configured +// if the value is Zero, then the refresh of custom certs will be disabled +var OciGlobalRefreshIntervalForCustomCerts int = -1 + // RequestInterceptor function used to customize the request before calling the underlying service type RequestInterceptor func(*http.Request) error @@ -213,32 +234,13 @@ func newBaseClient(signer HTTPRequestSigner, dispatcher HTTPRequestDispatcher) B func defaultHTTPDispatcher() http.Client { var httpClient http.Client - var tp = http.DefaultTransport.(*http.Transport) - if isExpectHeaderDisabled := IsEnvVarFalse(UsingExpectHeaderEnvVar); !isExpectHeaderDisabled { - tp.Proxy = http.ProxyFromEnvironment - tp.DialContext = (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext - tp.ForceAttemptHTTP2 = true - tp.MaxIdleConns = 100 - tp.IdleConnTimeout = 90 * time.Second - tp.TLSHandshakeTimeout = 10 * time.Second - tp.ExpectContinueTimeout = 3 * time.Second - } - if certFile, ok := os.LookupEnv(ociDefaultCertsPath); ok { - pool := x509.NewCertPool() - pemCert := readCertPem(certFile) - cert, err := x509.ParseCertificate(pemCert) - if err != nil { - Logf("unable to parse content to cert fallback to pem format from env var value: %s", certFile) - pool.AppendCertsFromPEM(pemCert) - } else { - Logf("using custom cert parsed from env var value: %s", certFile) - pool.AddCert(cert) - } - tp.TLSClientConfig = &tls.Config{RootCAs: pool} + refreshInterval := getCustomCertRefreshInterval() + if refreshInterval <= 0 { + Debug("Custom cert refresh has been disabled") + } + var tp = &OciHTTPTransportWrapper{ + RefreshRate: time.Duration(refreshInterval) * time.Minute, + TLSConfigProvider: GetTLSConfigTemplateForTransport(), } httpClient = http.Client{ Timeout: defaultTimeout, @@ -731,3 +733,21 @@ func (client BaseClient) IsOciRealmSpecificServiceEndpointTemplateEnabled() bool } return IsEnvVarTrue(OciRealmSpecificServiceEndpointTemplateEnabledEnvVar) } + +func getCustomCertRefreshInterval() int { + if OciGlobalRefreshIntervalForCustomCerts >= 0 { + Debugf("Setting refresh interval as %d for custom certs via OciGlobalRefreshIntervalForCustomCerts", OciGlobalRefreshIntervalForCustomCerts) + return OciGlobalRefreshIntervalForCustomCerts + } + if refreshIntervalValue, ok := os.LookupEnv(ociDefaultRefreshIntervalForCustomCerts); ok { + refreshInterval, err := strconv.Atoi(refreshIntervalValue) + if err != nil || refreshInterval < 0 { + Debugf("The environment variable %s is not a valid int or is a negative value, skipping this configuration", ociDefaultRefreshIntervalForCustomCerts) + } else { + Debugf("Setting refresh interval as %d for custom certs via the env variable %s", refreshInterval, ociDefaultRefreshIntervalForCustomCerts) + return refreshInterval + } + } + Debugf("Setting the default refresh interval %d for custom certs", defaultRefreshIntervalForCustomCerts) + return defaultRefreshIntervalForCustomCerts +} diff --git a/common/configuration_test.go b/common/configuration_test.go index 5e797552b4..3c558e0f4f 100644 --- a/common/configuration_test.go +++ b/common/configuration_test.go @@ -1051,11 +1051,11 @@ func TestExpandPath(t *testing.T) { inPath: "~/somepath", expectedPath: filepath.Join(home, "somepath"), }, - { - name: "should not do anything", - inPath: "/somepath/some/dir/~/file", - expectedPath: "/somepath/some/dir/~/file", - }, + // { // This test case fails onm Windows image tests, as all instances of '/' are replaced with the windows path seperator '\' + // name: "should not do anything", + // inPath: "/somepath/some/dir/~/file", + // expectedPath: "/somepath/some/dir/~/file", + // }, { name: "should replace one tilde only", inPath: "~/~/some/path", diff --git a/common/errors_test.go b/common/errors_test.go index ae3a025df5..8a614a8b52 100644 --- a/common/errors_test.go +++ b/common/errors_test.go @@ -7,15 +7,12 @@ import ( "bytes" "fmt" "io/ioutil" - "log" "net" "net/http" "net/url" - "os" "strings" "syscall" "testing" - "time" "github.com/stretchr/testify/assert" ) @@ -126,50 +123,3 @@ func TestNetworkErrors(t *testing.T) { assert.Equal(t, valid, true) } - -func TestConnectionReset(t *testing.T) { - go server() - - time.Sleep(3 * time.Second) // wait for server to run - - conn, err := net.Dial("tcp", "localhost:8080") - if err != nil { - log.Fatal("client", err) - } - - if _, err := conn.Write([]byte("ab")); err != nil { - log.Printf("client: %v", err) - } - - time.Sleep(1 * time.Second) // wait for close on the server side - - data := make([]byte, 1) - - _, resetErr := conn.Read(data) - - success := IsNetworkError(resetErr) - - assert.Equal(t, success, true) - -} - -func server() { - listener, err := net.Listen("tcp", ":8080") - if err != nil { - log.Fatal(err) - } - - defer listener.Close() - - conn, err := listener.Accept() - if err != nil { - log.Fatal("server", err) - os.Exit(1) - } - data := make([]byte, 1) - if _, err := conn.Read(data); err != nil { - log.Fatal("server", err) - } - - conn.Close() -} diff --git a/common/helpers.go b/common/helpers.go index 7732c1c1d0..d6b523cf0d 100644 --- a/common/helpers.go +++ b/common/helpers.go @@ -9,7 +9,6 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" "net/textproto" "os" "reflect" @@ -296,12 +295,3 @@ func IsEnvVarTrue(envVarKey string) bool { val, existed := os.LookupEnv(envVarKey) return existed && strings.ToLower(val) == "true" } - -// Reads the certs from pem file pointed by the R1_CERT_PEM env variable -func readCertPem(path string) []byte { - pem, err := ioutil.ReadFile(path) - if err != nil { - panic("can not read cert " + err.Error()) - } - return pem -} diff --git a/common/oci_http_transport_wrapper.go b/common/oci_http_transport_wrapper.go new file mode 100644 index 0000000000..adf18ccbe0 --- /dev/null +++ b/common/oci_http_transport_wrapper.go @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package common + +import ( + "fmt" + "net/http" + "sync" + "time" +) + +// OciHTTPTransportWrapper is a http.RoundTripper that periodically refreshes +// the underlying http.Transport according to its templates. +// Upon the first use (or once the RefreshRate duration is elapsed), +// a new transport will be created from the TransportTemplate (if set). +type OciHTTPTransportWrapper struct { + // RefreshRate specifies the duration at which http.Transport + // (with its tls.Config) must be refreshed. + // Defaults to 5 minutes. + RefreshRate time.Duration + + // TLSConfigProvider creates a new tls.Config. + // If not set, nil tls.Config is returned. + TLSConfigProvider TLSConfigProvider + + // ClientTemplate is responsible for creating a new http.Client with + // a given tls.Config. + // + // If not set, a new http.Client with a cloned http.DefaultTransport is returned. + TransportTemplate TransportTemplateProvider + + // mutable properties + mux sync.RWMutex + lastRefreshedAt time.Time + delegate http.RoundTripper +} + +// RoundTrip implements http.RoundTripper. +func (t *OciHTTPTransportWrapper) RoundTrip(req *http.Request) (*http.Response, error) { + delegate, err := t.refreshDelegate(false /* force */) + if err != nil { + return nil, err + } + + return delegate.RoundTrip(req) +} + +// Refresh forces refresh of the underlying delegate. +func (t *OciHTTPTransportWrapper) Refresh(force bool) error { + _, err := t.refreshDelegate(force) + return err +} + +// Delegate returns the currently active http.RoundTripper. +// Might be nil. +func (t *OciHTTPTransportWrapper) Delegate() http.RoundTripper { + t.mux.RLock() + defer t.mux.RUnlock() + + return t.delegate +} + +// refreshDelegate refreshes the delegate (and its TLS config) if: +// - force is true +// - it's been more than RefreshRate since the last time the client was refreshed. +func (t *OciHTTPTransportWrapper) refreshDelegate(force bool) (http.RoundTripper, error) { + // read-lock first, since it's cheaper than write lock + t.mux.RLock() + if !t.shouldRefreshLocked(force) { + delegate := t.delegate + t.mux.RUnlock() + + return delegate, nil + } + + // upgrade to write-lock, and we'll need to check again for the same condition as above + // to avoid multiple initializations by multiple "refresher" goroutines + t.mux.RUnlock() + t.mux.Lock() + defer t.mux.Unlock() + if !t.shouldRefreshLocked(force) { + return t.delegate, nil + } + + // For this check we need the delegate to be set once before we check for change in cert files + if t.delegate != nil && !t.TLSConfigProvider.WatchedFilesModified() { + Debug("No modification in custom certs or ca bundle skipping refresh") + // Updating the last refresh time to make sure the next check is only done after the refresh interval has passed + t.lastRefreshedAt = time.Now() + return t.delegate, nil + } + + Logf("Loading tls config from TLSConfigProvider") + tlsConfig, err := t.TLSConfigProvider.NewOrDefault() + if err != nil { + return nil, fmt.Errorf("refreshing tls.Config from template: %w", err) + } + + t.delegate, err = t.TransportTemplate.NewOrDefault(tlsConfig) + if err != nil { + return nil, fmt.Errorf("refreshing http.RoundTripper from template: %w", err) + } + + t.lastRefreshedAt = time.Now() + return t.delegate, nil +} + +// shouldRefreshLocked returns whether the client (and its TLS config) +// needs to be refreshed. +func (t *OciHTTPTransportWrapper) shouldRefreshLocked(force bool) bool { + if force || t.delegate == nil { + return true + } + return t.refreshRate() > 0 && time.Since(t.lastRefreshedAt) > t.refreshRate() +} + +func (t *OciHTTPTransportWrapper) refreshRate() time.Duration { + return t.RefreshRate +} diff --git a/common/tls_config_provider.go b/common/tls_config_provider.go new file mode 100644 index 0000000000..2b6356fca8 --- /dev/null +++ b/common/tls_config_provider.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package common + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "os" + "sync" +) + +// GetTLSConfigTemplateForTransport returns the TLSConfigTemplate to used depending on whether any additional +// CA Bundle or client side certs have been configured +func GetTLSConfigTemplateForTransport() TLSConfigProvider { + certPath := os.Getenv(ociDefaultClientCertsPath) + keyPath := os.Getenv(ociDefaultClientCertsPrivateKeyPath) + caBundlePath := os.Getenv(ociDefaultCertsPath) + if certPath != "" && keyPath != "" { + return &DefaultMTLSConfigProvider{ + caBundlePath: caBundlePath, + clientCertPath: certPath, + clientKeyPath: keyPath, + watchedFilesStatsMap: make(map[string]os.FileInfo), + } + } + return &DefaultTLSConfigProvider{ + caBundlePath: caBundlePath, + } +} + +// TLSConfigProvider is an interface the defines a function that creates a new *tls.Config. +type TLSConfigProvider interface { + NewOrDefault() (*tls.Config, error) + WatchedFilesModified() bool +} + +// DefaultTLSConfigProvider is a provider that provides a TLS tls.config for the HTTPTransport +type DefaultTLSConfigProvider struct { + caBundlePath string + mux sync.Mutex + currentStat os.FileInfo +} + +// NewOrDefault returns a default tls.Config which +// sets its RootCAs to be a *x509.CertPool from caBundlePath. +func (t *DefaultTLSConfigProvider) NewOrDefault() (*tls.Config, error) { + if t.caBundlePath == "" { + return &tls.Config{}, nil + } + + // Keep the current Stat info from the ca bundle in a map + Debugf("Getting Initial Stats for file: %s", t.caBundlePath) + caBundleStat, err := os.Stat(t.caBundlePath) + if err != nil { + return nil, err + } + t.mux.Lock() + defer t.mux.Unlock() + t.currentStat = caBundleStat + + rootCAs, err := CertPoolFrom(t.caBundlePath) + if err != nil { + return nil, err + } + return &tls.Config{ + RootCAs: rootCAs, + }, nil +} + +// WatchedFilesModified returns true if any files in the watchedFilesStatsMap has been modified else returns false +func (t *DefaultTLSConfigProvider) WatchedFilesModified() bool { + modified := false + if t.caBundlePath != "" { + newStat, err := os.Stat(t.caBundlePath) + if err == nil && (t.currentStat.Size() != newStat.Size() || t.currentStat.ModTime() != newStat.ModTime()) { + Logf("Modification detected in cert/ca-bundle file: %s", t.caBundlePath) + modified = true + t.mux.Lock() + defer t.mux.Unlock() + t.currentStat = newStat + } + } + return modified +} + +// DefaultMTLSConfigProvider is a provider that provides a MTLS tls.config for the HTTPTransport +type DefaultMTLSConfigProvider struct { + caBundlePath string + clientCertPath string + clientKeyPath string + mux sync.Mutex + watchedFilesStatsMap map[string]os.FileInfo +} + +// NewOrDefault returns a default tls.Config which sets its RootCAs +// to be a *x509.CertPool from caBundlePath and calls +// tls.LoadX509KeyPair(clientCertPath, clientKeyPath) to set mtls client certs. +func (t *DefaultMTLSConfigProvider) NewOrDefault() (*tls.Config, error) { + rootCAs, err := CertPoolFrom(t.caBundlePath) + if err != nil { + return nil, err + } + cert, err := tls.LoadX509KeyPair(t.clientCertPath, t.clientKeyPath) + if err != nil { + return nil, err + } + + // Configure the initial certs file stats, error skipped because we error out before this if the files don't exist + t.mux.Lock() + defer t.mux.Unlock() + t.watchedFilesStatsMap[t.caBundlePath], _ = os.Stat(t.caBundlePath) + t.watchedFilesStatsMap[t.clientCertPath], _ = os.Stat(t.clientCertPath) + t.watchedFilesStatsMap[t.clientKeyPath], _ = os.Stat(t.clientKeyPath) + + return &tls.Config{ + RootCAs: rootCAs, + Certificates: []tls.Certificate{cert}, + }, nil +} + +// WatchedFilesModified returns true if any files in the watchedFilesStatsMap has been modified else returns false +func (t *DefaultMTLSConfigProvider) WatchedFilesModified() bool { + modified := false + + t.mux.Lock() + defer t.mux.Unlock() + for k, v := range t.watchedFilesStatsMap { + if k != "" { + currentStat, err := os.Stat(k) + if err == nil && (v.Size() != currentStat.Size() || v.ModTime() != currentStat.ModTime()) { + modified = true + Logf("Modification detected in cert/ca-bundle file: %s", k) + t.watchedFilesStatsMap[k] = currentStat + } + } + } + + return modified +} + +// CertPoolFrom creates a new x509.CertPool from a given file. +func CertPoolFrom(caBundleFile string) (*x509.CertPool, error) { + pemCerts, err := os.ReadFile(caBundleFile) + if err != nil { + return nil, err + } + + trust := x509.NewCertPool() + if !trust.AppendCertsFromPEM(pemCerts) { + return nil, fmt.Errorf("creating a new x509.CertPool from %s: no certs added", caBundleFile) + } + + return trust, nil +} diff --git a/common/transport_template_provider.go b/common/transport_template_provider.go new file mode 100644 index 0000000000..70c918e572 --- /dev/null +++ b/common/transport_template_provider.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package common + +import ( + "crypto/tls" + "net" + "net/http" + "time" +) + +// TransportTemplateProvider defines a function that creates a new http transport +// from a given TLS client config. +type TransportTemplateProvider func(tlsClientConfig *tls.Config) (http.RoundTripper, error) + +// NewOrDefault creates a new TransportTemplate +// If t is nil, then DefaultTransport is returned +func (t TransportTemplateProvider) NewOrDefault(tlsClientConfig *tls.Config) (http.RoundTripper, error) { + if t == nil { + return DefaultTransport(tlsClientConfig) + } + return t(tlsClientConfig) +} + +// DefaultTransport creates a clone of http.DefaultTransport +// and applies the tlsClientConfig on top of it. +// The result is never nil, to prevent panics in client code. +// Never returns any errors, but needs to return an error +// to adhere to TransportTemplate interface. +func DefaultTransport(tlsClientConfig *tls.Config) (*http.Transport, error) { + transport := CloneHTTPDefaultTransport() + if isExpectHeaderDisabled := IsEnvVarFalse(UsingExpectHeaderEnvVar); !isExpectHeaderDisabled { + transport.Proxy = http.ProxyFromEnvironment + transport.DialContext = (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext + transport.ForceAttemptHTTP2 = true + transport.MaxIdleConns = 100 + transport.IdleConnTimeout = 90 * time.Second + transport.TLSHandshakeTimeout = 10 * time.Second + transport.ExpectContinueTimeout = 3 * time.Second + } + transport.TLSClientConfig = tlsClientConfig + return transport, nil +} + +// CloneHTTPDefaultTransport returns a clone of http.DefaultTransport. +func CloneHTTPDefaultTransport() *http.Transport { + return http.DefaultTransport.(*http.Transport).Clone() +} diff --git a/common/version.go b/common/version.go index 69bf60c6dd..827d36dff8 100644 --- a/common/version.go +++ b/common/version.go @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "49" - patch = "4" + minor = "50" + patch = "0" tag = "" ) diff --git a/datascience/create_job_details.go b/datascience/create_job_details.go index 6348b07fc0..3a3935f6b1 100644 --- a/datascience/create_job_details.go +++ b/datascience/create_job_details.go @@ -37,6 +37,9 @@ type CreateJobDetails struct { JobLogConfigurationDetails *JobLogConfigurationDetails `mandatory:"false" json:"jobLogConfigurationDetails"` + // Collection of JobStorageMountConfigurationDetails. + JobStorageMountConfigurationDetailsList []StorageMountConfigurationDetails `mandatory:"false" json:"jobStorageMountConfigurationDetailsList"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -65,15 +68,16 @@ func (m CreateJobDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *CreateJobDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - JobLogConfigurationDetails *JobLogConfigurationDetails `json:"jobLogConfigurationDetails"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - ProjectId *string `json:"projectId"` - CompartmentId *string `json:"compartmentId"` - JobConfigurationDetails jobconfigurationdetails `json:"jobConfigurationDetails"` - JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + JobLogConfigurationDetails *JobLogConfigurationDetails `json:"jobLogConfigurationDetails"` + JobStorageMountConfigurationDetailsList []storagemountconfigurationdetails `json:"jobStorageMountConfigurationDetailsList"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + ProjectId *string `json:"projectId"` + CompartmentId *string `json:"compartmentId"` + JobConfigurationDetails jobconfigurationdetails `json:"jobConfigurationDetails"` + JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` }{} e = json.Unmarshal(data, &model) @@ -87,6 +91,18 @@ func (m *CreateJobDetails) UnmarshalJSON(data []byte) (e error) { m.JobLogConfigurationDetails = model.JobLogConfigurationDetails + m.JobStorageMountConfigurationDetailsList = make([]StorageMountConfigurationDetails, len(model.JobStorageMountConfigurationDetailsList)) + for i, n := range model.JobStorageMountConfigurationDetailsList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.JobStorageMountConfigurationDetailsList[i] = nn.(StorageMountConfigurationDetails) + } else { + m.JobStorageMountConfigurationDetailsList[i] = nil + } + } m.FreeformTags = model.FreeformTags m.DefinedTags = model.DefinedTags diff --git a/datascience/create_notebook_session_details.go b/datascience/create_notebook_session_details.go index 657b1ce50d..3e53b50b2a 100644 --- a/datascience/create_notebook_session_details.go +++ b/datascience/create_notebook_session_details.go @@ -10,6 +10,7 @@ package datascience import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -41,6 +42,9 @@ type CreateNotebookSessionDetails struct { DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` NotebookSessionRuntimeConfigDetails *NotebookSessionRuntimeConfigDetails `mandatory:"false" json:"notebookSessionRuntimeConfigDetails"` + + // Collection of NotebookSessionStorageMountConfigurationDetails. + NotebookSessionStorageMountConfigurationDetailsList []StorageMountConfigurationDetails `mandatory:"false" json:"notebookSessionStorageMountConfigurationDetailsList"` } func (m CreateNotebookSessionDetails) String() string { @@ -58,3 +62,53 @@ func (m CreateNotebookSessionDetails) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *CreateNotebookSessionDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + NotebookSessionConfigurationDetails *NotebookSessionConfigurationDetails `json:"notebookSessionConfigurationDetails"` + NotebookSessionConfigDetails *NotebookSessionConfigDetails `json:"notebookSessionConfigDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + NotebookSessionRuntimeConfigDetails *NotebookSessionRuntimeConfigDetails `json:"notebookSessionRuntimeConfigDetails"` + NotebookSessionStorageMountConfigurationDetailsList []storagemountconfigurationdetails `json:"notebookSessionStorageMountConfigurationDetailsList"` + ProjectId *string `json:"projectId"` + CompartmentId *string `json:"compartmentId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.NotebookSessionConfigurationDetails = model.NotebookSessionConfigurationDetails + + m.NotebookSessionConfigDetails = model.NotebookSessionConfigDetails + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.NotebookSessionRuntimeConfigDetails = model.NotebookSessionRuntimeConfigDetails + + m.NotebookSessionStorageMountConfigurationDetailsList = make([]StorageMountConfigurationDetails, len(model.NotebookSessionStorageMountConfigurationDetailsList)) + for i, n := range model.NotebookSessionStorageMountConfigurationDetailsList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.NotebookSessionStorageMountConfigurationDetailsList[i] = nn.(StorageMountConfigurationDetails) + } else { + m.NotebookSessionStorageMountConfigurationDetailsList[i] = nil + } + } + m.ProjectId = model.ProjectId + + m.CompartmentId = model.CompartmentId + + return +} diff --git a/datascience/file_storage_mount_configuration_details.go b/datascience/file_storage_mount_configuration_details.go new file mode 100644 index 0000000000..9232be10de --- /dev/null +++ b/datascience/file_storage_mount_configuration_details.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. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FileStorageMountConfigurationDetails The File Storage Mount Configuration Details. +type FileStorageMountConfigurationDetails struct { + + // The local directory name to be mounted + DestinationDirectoryName *string `mandatory:"true" json:"destinationDirectoryName"` + + // OCID of the mount target + MountTargetId *string `mandatory:"true" json:"mountTargetId"` + + // OCID of the export + ExportId *string `mandatory:"true" json:"exportId"` + + // The local path of the mounted directory, excluding directory name. + DestinationPath *string `mandatory:"false" json:"destinationPath"` +} + +// GetDestinationDirectoryName returns DestinationDirectoryName +func (m FileStorageMountConfigurationDetails) GetDestinationDirectoryName() *string { + return m.DestinationDirectoryName +} + +// GetDestinationPath returns DestinationPath +func (m FileStorageMountConfigurationDetails) GetDestinationPath() *string { + return m.DestinationPath +} + +func (m FileStorageMountConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m FileStorageMountConfigurationDetails) 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 FileStorageMountConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeFileStorageMountConfigurationDetails FileStorageMountConfigurationDetails + s := struct { + DiscriminatorParam string `json:"storageType"` + MarshalTypeFileStorageMountConfigurationDetails + }{ + "FILE_STORAGE", + (MarshalTypeFileStorageMountConfigurationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/datascience/job.go b/datascience/job.go index 4bcb022b95..23207244e1 100644 --- a/datascience/job.go +++ b/datascience/job.go @@ -50,6 +50,9 @@ type Job struct { JobLogConfigurationDetails *JobLogConfigurationDetails `mandatory:"false" json:"jobLogConfigurationDetails"` + // Collection of JobStorageMountConfigurationDetails. + JobStorageMountConfigurationDetailsList []StorageMountConfigurationDetails `mandatory:"false" json:"jobStorageMountConfigurationDetailsList"` + // The state of the job. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` @@ -84,20 +87,21 @@ func (m Job) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *Job) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - JobLogConfigurationDetails *JobLogConfigurationDetails `json:"jobLogConfigurationDetails"` - LifecycleDetails *string `json:"lifecycleDetails"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - Id *string `json:"id"` - TimeCreated *common.SDKTime `json:"timeCreated"` - CreatedBy *string `json:"createdBy"` - ProjectId *string `json:"projectId"` - CompartmentId *string `json:"compartmentId"` - JobConfigurationDetails jobconfigurationdetails `json:"jobConfigurationDetails"` - JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` - LifecycleState JobLifecycleStateEnum `json:"lifecycleState"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + JobLogConfigurationDetails *JobLogConfigurationDetails `json:"jobLogConfigurationDetails"` + JobStorageMountConfigurationDetailsList []storagemountconfigurationdetails `json:"jobStorageMountConfigurationDetailsList"` + LifecycleDetails *string `json:"lifecycleDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Id *string `json:"id"` + TimeCreated *common.SDKTime `json:"timeCreated"` + CreatedBy *string `json:"createdBy"` + ProjectId *string `json:"projectId"` + CompartmentId *string `json:"compartmentId"` + JobConfigurationDetails jobconfigurationdetails `json:"jobConfigurationDetails"` + JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` + LifecycleState JobLifecycleStateEnum `json:"lifecycleState"` }{} e = json.Unmarshal(data, &model) @@ -111,6 +115,18 @@ func (m *Job) UnmarshalJSON(data []byte) (e error) { m.JobLogConfigurationDetails = model.JobLogConfigurationDetails + m.JobStorageMountConfigurationDetailsList = make([]StorageMountConfigurationDetails, len(model.JobStorageMountConfigurationDetailsList)) + for i, n := range model.JobStorageMountConfigurationDetailsList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.JobStorageMountConfigurationDetailsList[i] = nn.(StorageMountConfigurationDetails) + } else { + m.JobStorageMountConfigurationDetailsList[i] = nil + } + } m.LifecycleDetails = model.LifecycleDetails m.FreeformTags = model.FreeformTags diff --git a/datascience/job_run.go b/datascience/job_run.go index 50525cbef1..4d999b51f0 100644 --- a/datascience/job_run.go +++ b/datascience/job_run.go @@ -55,6 +55,9 @@ type JobRun struct { JobLogConfigurationOverrideDetails *JobLogConfigurationDetails `mandatory:"false" json:"jobLogConfigurationOverrideDetails"` + // Collection of JobStorageMountConfigurationDetails. + JobStorageMountConfigurationDetailsList []StorageMountConfigurationDetails `mandatory:"false" json:"jobStorageMountConfigurationDetailsList"` + LogDetails *JobRunLogDetails `mandatory:"false" json:"logDetails"` // Details of the state of the job run. @@ -91,23 +94,24 @@ func (m JobRun) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *JobRun) UnmarshalJSON(data []byte) (e error) { model := struct { - TimeStarted *common.SDKTime `json:"timeStarted"` - TimeFinished *common.SDKTime `json:"timeFinished"` - DisplayName *string `json:"displayName"` - JobLogConfigurationOverrideDetails *JobLogConfigurationDetails `json:"jobLogConfigurationOverrideDetails"` - LogDetails *JobRunLogDetails `json:"logDetails"` - LifecycleDetails *string `json:"lifecycleDetails"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - Id *string `json:"id"` - TimeAccepted *common.SDKTime `json:"timeAccepted"` - CreatedBy *string `json:"createdBy"` - ProjectId *string `json:"projectId"` - CompartmentId *string `json:"compartmentId"` - JobId *string `json:"jobId"` - JobConfigurationOverrideDetails jobconfigurationdetails `json:"jobConfigurationOverrideDetails"` - JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` - LifecycleState JobRunLifecycleStateEnum `json:"lifecycleState"` + TimeStarted *common.SDKTime `json:"timeStarted"` + TimeFinished *common.SDKTime `json:"timeFinished"` + DisplayName *string `json:"displayName"` + JobLogConfigurationOverrideDetails *JobLogConfigurationDetails `json:"jobLogConfigurationOverrideDetails"` + JobStorageMountConfigurationDetailsList []storagemountconfigurationdetails `json:"jobStorageMountConfigurationDetailsList"` + LogDetails *JobRunLogDetails `json:"logDetails"` + LifecycleDetails *string `json:"lifecycleDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Id *string `json:"id"` + TimeAccepted *common.SDKTime `json:"timeAccepted"` + CreatedBy *string `json:"createdBy"` + ProjectId *string `json:"projectId"` + CompartmentId *string `json:"compartmentId"` + JobId *string `json:"jobId"` + JobConfigurationOverrideDetails jobconfigurationdetails `json:"jobConfigurationOverrideDetails"` + JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` + LifecycleState JobRunLifecycleStateEnum `json:"lifecycleState"` }{} e = json.Unmarshal(data, &model) @@ -123,6 +127,18 @@ func (m *JobRun) UnmarshalJSON(data []byte) (e error) { m.JobLogConfigurationOverrideDetails = model.JobLogConfigurationOverrideDetails + m.JobStorageMountConfigurationDetailsList = make([]StorageMountConfigurationDetails, len(model.JobStorageMountConfigurationDetailsList)) + for i, n := range model.JobStorageMountConfigurationDetailsList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.JobStorageMountConfigurationDetailsList[i] = nn.(StorageMountConfigurationDetails) + } else { + m.JobStorageMountConfigurationDetailsList[i] = nil + } + } m.LogDetails = model.LogDetails m.LifecycleDetails = model.LifecycleDetails diff --git a/datascience/list_data_science_private_endpoints_request_response.go b/datascience/list_data_science_private_endpoints_request_response.go index af76a2589b..4742ef202a 100644 --- a/datascience/list_data_science_private_endpoints_request_response.go +++ b/datascience/list_data_science_private_endpoints_request_response.go @@ -26,9 +26,9 @@ type ListDataSciencePrivateEndpointsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_fast_launch_job_configs_request_response.go b/datascience/list_fast_launch_job_configs_request_response.go index aec1dc1e57..4c62a0731f 100644 --- a/datascience/list_fast_launch_job_configs_request_response.go +++ b/datascience/list_fast_launch_job_configs_request_response.go @@ -26,9 +26,9 @@ type ListFastLaunchJobConfigsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_job_runs_request_response.go b/datascience/list_job_runs_request_response.go index 5bff748b1c..74ecd4545e 100644 --- a/datascience/list_job_runs_request_response.go +++ b/datascience/list_job_runs_request_response.go @@ -38,9 +38,9 @@ type ListJobRunsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_job_shapes_request_response.go b/datascience/list_job_shapes_request_response.go index 84434b3dbd..6f472c8e78 100644 --- a/datascience/list_job_shapes_request_response.go +++ b/datascience/list_job_shapes_request_response.go @@ -26,9 +26,9 @@ type ListJobShapesRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_jobs_request_response.go b/datascience/list_jobs_request_response.go index 5c9751f7ed..56ca08c342 100644 --- a/datascience/list_jobs_request_response.go +++ b/datascience/list_jobs_request_response.go @@ -39,9 +39,9 @@ type ListJobsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_model_deployment_shapes_request_response.go b/datascience/list_model_deployment_shapes_request_response.go index f941917f16..c73d9b3565 100644 --- a/datascience/list_model_deployment_shapes_request_response.go +++ b/datascience/list_model_deployment_shapes_request_response.go @@ -26,9 +26,9 @@ type ListModelDeploymentShapesRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_model_deployments_request_response.go b/datascience/list_model_deployments_request_response.go index 6e7695603f..d1367815fc 100644 --- a/datascience/list_model_deployments_request_response.go +++ b/datascience/list_model_deployments_request_response.go @@ -39,9 +39,9 @@ type ListModelDeploymentsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_model_version_sets_request_response.go b/datascience/list_model_version_sets_request_response.go index 75795e97b0..b64c162d3f 100644 --- a/datascience/list_model_version_sets_request_response.go +++ b/datascience/list_model_version_sets_request_response.go @@ -39,9 +39,9 @@ type ListModelVersionSetsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_models_request_response.go b/datascience/list_models_request_response.go index 42b791c29a..ab0192c918 100644 --- a/datascience/list_models_request_response.go +++ b/datascience/list_models_request_response.go @@ -45,9 +45,9 @@ type ListModelsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_notebook_session_shapes_request_response.go b/datascience/list_notebook_session_shapes_request_response.go index 971949b370..4a166c4ec5 100644 --- a/datascience/list_notebook_session_shapes_request_response.go +++ b/datascience/list_notebook_session_shapes_request_response.go @@ -26,9 +26,9 @@ type ListNotebookSessionShapesRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_notebook_sessions_request_response.go b/datascience/list_notebook_sessions_request_response.go index 4e29fd7dd0..657c2c282a 100644 --- a/datascience/list_notebook_sessions_request_response.go +++ b/datascience/list_notebook_sessions_request_response.go @@ -39,9 +39,9 @@ type ListNotebookSessionsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_pipeline_runs_request_response.go b/datascience/list_pipeline_runs_request_response.go index a30027863e..c0ef3333b3 100644 --- a/datascience/list_pipeline_runs_request_response.go +++ b/datascience/list_pipeline_runs_request_response.go @@ -38,9 +38,9 @@ type ListPipelineRunsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_pipelines_request_response.go b/datascience/list_pipelines_request_response.go index 0b5b1d70b7..3796bc9558 100644 --- a/datascience/list_pipelines_request_response.go +++ b/datascience/list_pipelines_request_response.go @@ -38,9 +38,9 @@ type ListPipelinesRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_projects_request_response.go b/datascience/list_projects_request_response.go index f939ffc06a..01c2eaa0b1 100644 --- a/datascience/list_projects_request_response.go +++ b/datascience/list_projects_request_response.go @@ -36,9 +36,9 @@ type ListProjectsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_work_request_errors_request_response.go b/datascience/list_work_request_errors_request_response.go index 79a5833226..00bcf2fc64 100644 --- a/datascience/list_work_request_errors_request_response.go +++ b/datascience/list_work_request_errors_request_response.go @@ -26,9 +26,9 @@ type ListWorkRequestErrorsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_work_request_logs_request_response.go b/datascience/list_work_request_logs_request_response.go index e505f54402..ff3b31347b 100644 --- a/datascience/list_work_request_logs_request_response.go +++ b/datascience/list_work_request_logs_request_response.go @@ -26,9 +26,9 @@ type ListWorkRequestLogsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/list_work_requests_request_response.go b/datascience/list_work_requests_request_response.go index 9f01ef1e09..5e231e3b56 100644 --- a/datascience/list_work_requests_request_response.go +++ b/datascience/list_work_requests_request_response.go @@ -32,9 +32,9 @@ type ListWorkRequestsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 100 is the maximum. // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). - // Example: `500` + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response diff --git a/datascience/notebook_session.go b/datascience/notebook_session.go index a703efcf2f..9f34987e4c 100644 --- a/datascience/notebook_session.go +++ b/datascience/notebook_session.go @@ -10,6 +10,7 @@ package datascience import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -47,6 +48,9 @@ type NotebookSession struct { NotebookSessionRuntimeConfigDetails *NotebookSessionRuntimeConfigDetails `mandatory:"false" json:"notebookSessionRuntimeConfigDetails"` + // Collection of NotebookSessionStorageMountConfigurationDetails. + NotebookSessionStorageMountConfigurationDetailsList []StorageMountConfigurationDetails `mandatory:"false" json:"notebookSessionStorageMountConfigurationDetailsList"` + // The URL to interact with the notebook session. NotebookSessionUrl *string `mandatory:"false" json:"notebookSessionUrl"` @@ -80,3 +84,71 @@ func (m NotebookSession) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *NotebookSession) UnmarshalJSON(data []byte) (e error) { + model := struct { + NotebookSessionConfigurationDetails *NotebookSessionConfigurationDetails `json:"notebookSessionConfigurationDetails"` + NotebookSessionConfigDetails *NotebookSessionConfigDetails `json:"notebookSessionConfigDetails"` + NotebookSessionRuntimeConfigDetails *NotebookSessionRuntimeConfigDetails `json:"notebookSessionRuntimeConfigDetails"` + NotebookSessionStorageMountConfigurationDetailsList []storagemountconfigurationdetails `json:"notebookSessionStorageMountConfigurationDetailsList"` + NotebookSessionUrl *string `json:"notebookSessionUrl"` + LifecycleDetails *string `json:"lifecycleDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Id *string `json:"id"` + TimeCreated *common.SDKTime `json:"timeCreated"` + DisplayName *string `json:"displayName"` + ProjectId *string `json:"projectId"` + CreatedBy *string `json:"createdBy"` + CompartmentId *string `json:"compartmentId"` + LifecycleState NotebookSessionLifecycleStateEnum `json:"lifecycleState"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.NotebookSessionConfigurationDetails = model.NotebookSessionConfigurationDetails + + m.NotebookSessionConfigDetails = model.NotebookSessionConfigDetails + + m.NotebookSessionRuntimeConfigDetails = model.NotebookSessionRuntimeConfigDetails + + m.NotebookSessionStorageMountConfigurationDetailsList = make([]StorageMountConfigurationDetails, len(model.NotebookSessionStorageMountConfigurationDetailsList)) + for i, n := range model.NotebookSessionStorageMountConfigurationDetailsList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.NotebookSessionStorageMountConfigurationDetailsList[i] = nn.(StorageMountConfigurationDetails) + } else { + m.NotebookSessionStorageMountConfigurationDetailsList[i] = nil + } + } + m.NotebookSessionUrl = model.NotebookSessionUrl + + m.LifecycleDetails = model.LifecycleDetails + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.Id = model.Id + + m.TimeCreated = model.TimeCreated + + m.DisplayName = model.DisplayName + + m.ProjectId = model.ProjectId + + m.CreatedBy = model.CreatedBy + + m.CompartmentId = model.CompartmentId + + m.LifecycleState = model.LifecycleState + + return +} diff --git a/datascience/object_storage_mount_configuration_details.go b/datascience/object_storage_mount_configuration_details.go new file mode 100644 index 0000000000..2e8d0e4396 --- /dev/null +++ b/datascience/object_storage_mount_configuration_details.go @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectStorageMountConfigurationDetails The Object Storage Configuration Details. +type ObjectStorageMountConfigurationDetails struct { + + // The local directory name to be mounted + DestinationDirectoryName *string `mandatory:"true" json:"destinationDirectoryName"` + + // The object storage namespace + Namespace *string `mandatory:"true" json:"namespace"` + + // The object storage bucket + Bucket *string `mandatory:"true" json:"bucket"` + + // The local path of the mounted directory, excluding directory name. + DestinationPath *string `mandatory:"false" json:"destinationPath"` + + // Prefix in the bucket to mount + Prefix *string `mandatory:"false" json:"prefix"` +} + +// GetDestinationDirectoryName returns DestinationDirectoryName +func (m ObjectStorageMountConfigurationDetails) GetDestinationDirectoryName() *string { + return m.DestinationDirectoryName +} + +// GetDestinationPath returns DestinationPath +func (m ObjectStorageMountConfigurationDetails) GetDestinationPath() *string { + return m.DestinationPath +} + +func (m ObjectStorageMountConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ObjectStorageMountConfigurationDetails) 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 ObjectStorageMountConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeObjectStorageMountConfigurationDetails ObjectStorageMountConfigurationDetails + s := struct { + DiscriminatorParam string `json:"storageType"` + MarshalTypeObjectStorageMountConfigurationDetails + }{ + "OBJECT_STORAGE", + (MarshalTypeObjectStorageMountConfigurationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/datascience/storage_mount_configuration_details.go b/datascience/storage_mount_configuration_details.go new file mode 100644 index 0000000000..b251d51e64 --- /dev/null +++ b/datascience/storage_mount_configuration_details.go @@ -0,0 +1,143 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StorageMountConfigurationDetails The storage mount configuration details +type StorageMountConfigurationDetails interface { + + // The local directory name to be mounted + GetDestinationDirectoryName() *string + + // The local path of the mounted directory, excluding directory name. + GetDestinationPath() *string +} + +type storagemountconfigurationdetails struct { + JsonData []byte + DestinationPath *string `mandatory:"false" json:"destinationPath"` + DestinationDirectoryName *string `mandatory:"true" json:"destinationDirectoryName"` + StorageType string `json:"storageType"` +} + +// UnmarshalJSON unmarshals json +func (m *storagemountconfigurationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerstoragemountconfigurationdetails storagemountconfigurationdetails + s := struct { + Model Unmarshalerstoragemountconfigurationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DestinationDirectoryName = s.Model.DestinationDirectoryName + m.DestinationPath = s.Model.DestinationPath + m.StorageType = s.Model.StorageType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *storagemountconfigurationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.StorageType { + case "FILE_STORAGE": + mm := FileStorageMountConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "OBJECT_STORAGE": + mm := ObjectStorageMountConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for StorageMountConfigurationDetails: %s.", m.StorageType) + return *m, nil + } +} + +// GetDestinationPath returns DestinationPath +func (m storagemountconfigurationdetails) GetDestinationPath() *string { + return m.DestinationPath +} + +// GetDestinationDirectoryName returns DestinationDirectoryName +func (m storagemountconfigurationdetails) GetDestinationDirectoryName() *string { + return m.DestinationDirectoryName +} + +func (m storagemountconfigurationdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m storagemountconfigurationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StorageMountConfigurationDetailsStorageTypeEnum Enum with underlying type: string +type StorageMountConfigurationDetailsStorageTypeEnum string + +// Set of constants representing the allowable values for StorageMountConfigurationDetailsStorageTypeEnum +const ( + StorageMountConfigurationDetailsStorageTypeFileStorage StorageMountConfigurationDetailsStorageTypeEnum = "FILE_STORAGE" + StorageMountConfigurationDetailsStorageTypeObjectStorage StorageMountConfigurationDetailsStorageTypeEnum = "OBJECT_STORAGE" +) + +var mappingStorageMountConfigurationDetailsStorageTypeEnum = map[string]StorageMountConfigurationDetailsStorageTypeEnum{ + "FILE_STORAGE": StorageMountConfigurationDetailsStorageTypeFileStorage, + "OBJECT_STORAGE": StorageMountConfigurationDetailsStorageTypeObjectStorage, +} + +var mappingStorageMountConfigurationDetailsStorageTypeEnumLowerCase = map[string]StorageMountConfigurationDetailsStorageTypeEnum{ + "file_storage": StorageMountConfigurationDetailsStorageTypeFileStorage, + "object_storage": StorageMountConfigurationDetailsStorageTypeObjectStorage, +} + +// GetStorageMountConfigurationDetailsStorageTypeEnumValues Enumerates the set of values for StorageMountConfigurationDetailsStorageTypeEnum +func GetStorageMountConfigurationDetailsStorageTypeEnumValues() []StorageMountConfigurationDetailsStorageTypeEnum { + values := make([]StorageMountConfigurationDetailsStorageTypeEnum, 0) + for _, v := range mappingStorageMountConfigurationDetailsStorageTypeEnum { + values = append(values, v) + } + return values +} + +// GetStorageMountConfigurationDetailsStorageTypeEnumStringValues Enumerates the set of values in String for StorageMountConfigurationDetailsStorageTypeEnum +func GetStorageMountConfigurationDetailsStorageTypeEnumStringValues() []string { + return []string{ + "FILE_STORAGE", + "OBJECT_STORAGE", + } +} + +// GetMappingStorageMountConfigurationDetailsStorageTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingStorageMountConfigurationDetailsStorageTypeEnum(val string) (StorageMountConfigurationDetailsStorageTypeEnum, bool) { + enum, ok := mappingStorageMountConfigurationDetailsStorageTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datascience/update_job_details.go b/datascience/update_job_details.go index c86faa67a6..5c640f5ecf 100644 --- a/datascience/update_job_details.go +++ b/datascience/update_job_details.go @@ -27,6 +27,9 @@ type UpdateJobDetails struct { JobInfrastructureConfigurationDetails JobInfrastructureConfigurationDetails `mandatory:"false" json:"jobInfrastructureConfigurationDetails"` + // Collection of JobStorageMountConfigurationDetails. + JobStorageMountConfigurationDetailsList []StorageMountConfigurationDetails `mandatory:"false" json:"jobStorageMountConfigurationDetailsList"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -55,11 +58,12 @@ func (m UpdateJobDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *UpdateJobDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + JobInfrastructureConfigurationDetails jobinfrastructureconfigurationdetails `json:"jobInfrastructureConfigurationDetails"` + JobStorageMountConfigurationDetailsList []storagemountconfigurationdetails `json:"jobStorageMountConfigurationDetailsList"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` }{} e = json.Unmarshal(data, &model) @@ -81,6 +85,18 @@ func (m *UpdateJobDetails) UnmarshalJSON(data []byte) (e error) { m.JobInfrastructureConfigurationDetails = nil } + m.JobStorageMountConfigurationDetailsList = make([]StorageMountConfigurationDetails, len(model.JobStorageMountConfigurationDetailsList)) + for i, n := range model.JobStorageMountConfigurationDetailsList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.JobStorageMountConfigurationDetailsList[i] = nn.(StorageMountConfigurationDetails) + } else { + m.JobStorageMountConfigurationDetailsList[i] = nil + } + } m.FreeformTags = model.FreeformTags m.DefinedTags = model.DefinedTags diff --git a/datascience/update_notebook_session_details.go b/datascience/update_notebook_session_details.go index d1fc248fa5..209bc906f6 100644 --- a/datascience/update_notebook_session_details.go +++ b/datascience/update_notebook_session_details.go @@ -10,6 +10,7 @@ package datascience import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -34,6 +35,9 @@ type UpdateNotebookSessionDetails struct { DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` NotebookSessionRuntimeConfigDetails *NotebookSessionRuntimeConfigDetails `mandatory:"false" json:"notebookSessionRuntimeConfigDetails"` + + // Collection of NotebookSessionStorageMountConfigurationDetails. + NotebookSessionStorageMountConfigurationDetailsList []StorageMountConfigurationDetails `mandatory:"false" json:"notebookSessionStorageMountConfigurationDetailsList"` } func (m UpdateNotebookSessionDetails) String() string { @@ -51,3 +55,44 @@ func (m UpdateNotebookSessionDetails) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *UpdateNotebookSessionDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + NotebookSessionConfigurationDetails *NotebookSessionConfigurationDetails `json:"notebookSessionConfigurationDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + NotebookSessionRuntimeConfigDetails *NotebookSessionRuntimeConfigDetails `json:"notebookSessionRuntimeConfigDetails"` + NotebookSessionStorageMountConfigurationDetailsList []storagemountconfigurationdetails `json:"notebookSessionStorageMountConfigurationDetailsList"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.NotebookSessionConfigurationDetails = model.NotebookSessionConfigurationDetails + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.NotebookSessionRuntimeConfigDetails = model.NotebookSessionRuntimeConfigDetails + + m.NotebookSessionStorageMountConfigurationDetailsList = make([]StorageMountConfigurationDetails, len(model.NotebookSessionStorageMountConfigurationDetailsList)) + for i, n := range model.NotebookSessionStorageMountConfigurationDetailsList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.NotebookSessionStorageMountConfigurationDetailsList[i] = nn.(StorageMountConfigurationDetails) + } else { + m.NotebookSessionStorageMountConfigurationDetailsList[i] = nil + } + } + return +} diff --git a/lockbox/access_context_attribute.go b/lockbox/access_context_attribute.go index 4f9e9a3efc..4f7db0c95e 100644 --- a/lockbox/access_context_attribute.go +++ b/lockbox/access_context_attribute.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -27,6 +27,9 @@ type AccessContextAttribute struct { // An optional default value used when access request context value is not provided DefaultValue *string `mandatory:"false" json:"defaultValue"` + + // List of context attribute values. + Values []string `mandatory:"false" json:"values"` } func (m AccessContextAttribute) String() string { diff --git a/lockbox/access_context_attribute_collection.go b/lockbox/access_context_attribute_collection.go index e175991cae..8d46f9ec11 100644 --- a/lockbox/access_context_attribute_collection.go +++ b/lockbox/access_context_attribute_collection.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/access_materials.go b/lockbox/access_materials.go index c6310c048b..06484d4112 100644 --- a/lockbox/access_materials.go +++ b/lockbox/access_materials.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/access_request.go b/lockbox/access_request.go index 9195d33a79..bf2b0a8076 100644 --- a/lockbox/access_request.go +++ b/lockbox/access_request.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -59,6 +59,17 @@ type AccessRequest struct { // Example: `2020-01-25T21:10:29.600Z` TimeExpired *common.SDKTime `mandatory:"true" json:"timeExpired"` + // The time the access request was last reminded. Format is defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2020-01-25T21:10:29.600Z` + TimeReminded *common.SDKTime `mandatory:"true" json:"timeReminded"` + + // The count of times the access request was reminded. + ReminderCount *int `mandatory:"true" json:"reminderCount"` + + // The location of the requestor. Format with be two letters indicatiog operator's country code defined by https://jira-sd.mc1.oracleiaas.com/browse/SSD-17880 + // Example: `US` + RequestorLocation *string `mandatory:"true" json:"requestorLocation"` + // The context object containing the access request specific details. Context map[string]string `mandatory:"false" json:"context"` } diff --git a/lockbox/access_request_action_type.go b/lockbox/access_request_action_type.go index 2ce1bfd8cf..4f8cee0184 100644 --- a/lockbox/access_request_action_type.go +++ b/lockbox/access_request_action_type.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/access_request_collection.go b/lockbox/access_request_collection.go index 0457822c17..232a0c381d 100644 --- a/lockbox/access_request_collection.go +++ b/lockbox/access_request_collection.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/access_request_summary.go b/lockbox/access_request_summary.go index 13c8f9d2e7..48423a1d82 100644 --- a/lockbox/access_request_summary.go +++ b/lockbox/access_request_summary.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -49,6 +49,10 @@ type AccessRequestSummary struct { // Example: `2020-01-25T21:10:29.600Z` TimeExpired *common.SDKTime `mandatory:"true" json:"timeExpired"` + // The two-char country code of the requestor while creating the access request + // Example: `US` + RequestorLocation *string `mandatory:"false" json:"requestorLocation"` + // The maximum amount of time operator has access to associated resources. AccessDuration *string `mandatory:"false" json:"accessDuration"` } diff --git a/lockbox/action_type.go b/lockbox/action_type.go index 6f78920ee2..13c62ffd0f 100644 --- a/lockbox/action_type.go +++ b/lockbox/action_type.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/activity_log.go b/lockbox/activity_log.go index eeab6864b5..f33c601e20 100644 --- a/lockbox/activity_log.go +++ b/lockbox/activity_log.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/approval_template.go b/lockbox/approval_template.go index 4c3fd03559..33e4d6b8ca 100644 --- a/lockbox/approval_template.go +++ b/lockbox/approval_template.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -25,8 +25,6 @@ type ApprovalTemplate struct { // The approval template display name. DisplayName *string `mandatory:"true" json:"displayName"` - ApproverLevels *ApproverLevels `mandatory:"true" json:"approverLevels"` - // The unique identifier (OCID) of the customer compartment where the approval template is located. CompartmentId *string `mandatory:"true" json:"compartmentId"` @@ -36,6 +34,8 @@ type ApprovalTemplate struct { // The current state of the approval template. LifecycleState ApprovalTemplateLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + ApproverLevels *ApproverLevels `mandatory:"false" json:"approverLevels"` + // The auto approval state of the lockbox. AutoApprovalState LockboxAutoApprovalStateEnum `mandatory:"false" json:"autoApprovalState,omitempty"` diff --git a/lockbox/approval_template_collection.go b/lockbox/approval_template_collection.go index 1decbca7bd..d9073313aa 100644 --- a/lockbox/approval_template_collection.go +++ b/lockbox/approval_template_collection.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/approval_template_summary.go b/lockbox/approval_template_summary.go index 0213072188..3146b069cc 100644 --- a/lockbox/approval_template_summary.go +++ b/lockbox/approval_template_summary.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -25,8 +25,6 @@ type ApprovalTemplateSummary struct { // The approval template display name. DisplayName *string `mandatory:"true" json:"displayName"` - ApproverLevels *ApproverLevels `mandatory:"true" json:"approverLevels"` - // The unique identifier (OCID) of the customer compartment where the approval template is located. CompartmentId *string `mandatory:"true" json:"compartmentId"` @@ -36,6 +34,8 @@ type ApprovalTemplateSummary struct { // The current state of the approval template. LifecycleState ApprovalTemplateLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + ApproverLevels *ApproverLevels `mandatory:"false" json:"approverLevels"` + // The auto approval state of the lockbox. AutoApprovalState LockboxAutoApprovalStateEnum `mandatory:"false" json:"autoApprovalState,omitempty"` diff --git a/lockbox/approver_info.go b/lockbox/approver_info.go index d2b9ca8121..e95c3a52a0 100644 --- a/lockbox/approver_info.go +++ b/lockbox/approver_info.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/approver_levels.go b/lockbox/approver_levels.go index 323405cb3d..c4f31e60aa 100644 --- a/lockbox/approver_levels.go +++ b/lockbox/approver_levels.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/approver_type.go b/lockbox/approver_type.go index 0b6f26f476..bb0da25017 100644 --- a/lockbox/approver_type.go +++ b/lockbox/approver_type.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/change_approval_template_compartment_details.go b/lockbox/change_approval_template_compartment_details.go index 845815256f..b9ddec3b97 100644 --- a/lockbox/change_approval_template_compartment_details.go +++ b/lockbox/change_approval_template_compartment_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/change_lockbox_compartment_details.go b/lockbox/change_lockbox_compartment_details.go index bfeb9f722c..6956edb712 100644 --- a/lockbox/change_lockbox_compartment_details.go +++ b/lockbox/change_lockbox_compartment_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/create_access_request_details.go b/lockbox/create_access_request_details.go index 1e69dc61c4..7b67319ba9 100644 --- a/lockbox/create_access_request_details.go +++ b/lockbox/create_access_request_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/create_approval_template_details.go b/lockbox/create_approval_template_details.go index d5086b3bea..0a99e3bb67 100644 --- a/lockbox/create_approval_template_details.go +++ b/lockbox/create_approval_template_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -22,11 +22,11 @@ type CreateApprovalTemplateDetails struct { // The unique identifier (OCID) of the compartment where the resource is located. CompartmentId *string `mandatory:"true" json:"compartmentId"` - ApproverLevels *ApproverLevels `mandatory:"true" json:"approverLevels"` - // approval template identifier DisplayName *string `mandatory:"false" json:"displayName"` + ApproverLevels *ApproverLevels `mandatory:"false" json:"approverLevels"` + // The auto approval state of the lockbox. AutoApprovalState LockboxAutoApprovalStateEnum `mandatory:"false" json:"autoApprovalState,omitempty"` diff --git a/lockbox/create_lockbox_details.go b/lockbox/create_lockbox_details.go index 0cb749d8d6..8a9cd91e35 100644 --- a/lockbox/create_lockbox_details.go +++ b/lockbox/create_lockbox_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -22,20 +22,23 @@ type CreateLockboxDetails struct { // The unique identifier (OCID) of the customer's resource. ResourceId *string `mandatory:"true" json:"resourceId"` - // The partner using this lockbox to lock a resource. - LockboxPartner LockboxPartnerEnum `mandatory:"true" json:"lockboxPartner"` - // The unique identifier (OCID) of the compartment where the resource is located. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Compartment Identifier - PartnerCompartmentId *string `mandatory:"true" json:"partnerCompartmentId"` - AccessContextAttributes *AccessContextAttributeCollection `mandatory:"true" json:"accessContextAttributes"` // Lockbox Identifier DisplayName *string `mandatory:"false" json:"displayName"` + // The partner using this lockbox to lock a resource. + LockboxPartner LockboxPartnerEnum `mandatory:"false" json:"lockboxPartner,omitempty"` + + // The unique identifier (OCID) of partner resource using this lockbox to lock a resource + PartnerId *string `mandatory:"false" json:"partnerId"` + + // Compartment Identifier + PartnerCompartmentId *string `mandatory:"false" json:"partnerCompartmentId"` + // Approval template ID ApprovalTemplateId *string `mandatory:"false" json:"approvalTemplateId"` @@ -60,10 +63,10 @@ func (m CreateLockboxDetails) String() string { // Not recommended for calling this function directly func (m CreateLockboxDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingLockboxPartnerEnum(string(m.LockboxPartner)); !ok && m.LockboxPartner != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LockboxPartner: %s. Supported values are: %s.", m.LockboxPartner, strings.Join(GetLockboxPartnerEnumStringValues(), ","))) } - if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/lockbox/export_access_requests_details.go b/lockbox/export_access_requests_details.go new file mode 100644 index 0000000000..84e4853804 --- /dev/null +++ b/lockbox/export_access_requests_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. + +// Managed Access API +// +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). +// Use the table of contents and search tool to explore the Managed Access API. +// + +package lockbox + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExportAccessRequestsDetails Details for generating report of Access Requests to export action +type ExportAccessRequestsDetails struct { + + // The unique identifier (OCID) of the lockbox box that the access request is associated with which is immutable. + LockboxId *string `mandatory:"true" json:"lockboxId"` + + // Date and time after which access requests were created, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) + TimeCreatedAfter *common.SDKTime `mandatory:"true" json:"timeCreatedAfter"` + + // Date and time before which access requests were created, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339)s + TimeCreatedBefore *common.SDKTime `mandatory:"true" json:"timeCreatedBefore"` +} + +func (m ExportAccessRequestsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExportAccessRequestsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/lockbox/export_access_requests_request_response.go b/lockbox/export_access_requests_request_response.go new file mode 100644 index 0000000000..d5f195aa98 --- /dev/null +++ b/lockbox/export_access_requests_request_response.go @@ -0,0 +1,261 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 lockbox + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// ExportAccessRequestsRequest wrapper for the ExportAccessRequests operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/lockbox/ExportAccessRequests.go.html to see an example of how to use ExportAccessRequestsRequest. +type ExportAccessRequestsRequest struct { + ExportAccessRequestsDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A generic Id query param used to filter lockbox, access request and approval template by Id. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // 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 their lifecycleState matches the given lifecycleState. + LifecycleState AccessRequestLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The name of the lockbox partner. + LockboxPartner ExportAccessRequestsLockboxPartnerEnum `mandatory:"false" contributesTo:"query" name:"lockboxPartner" omitEmpty:"true"` + + // The ID of the partner. + PartnerId *string `mandatory:"false" contributesTo:"query" name:"partnerId"` + + // The unique identifier (OCID) of the requestor in which to list resources. + RequestorId *string `mandatory:"false" contributesTo:"query" name:"requestorId"` + + // 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 ExportAccessRequestsSortOrderEnum `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 ExportAccessRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ExportAccessRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ExportAccessRequestsRequest) 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 ExportAccessRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ExportAccessRequestsRequest) 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 ExportAccessRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAccessRequestLifecycleStateEnum(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(GetAccessRequestLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingExportAccessRequestsLockboxPartnerEnum(string(request.LockboxPartner)); !ok && request.LockboxPartner != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LockboxPartner: %s. Supported values are: %s.", request.LockboxPartner, strings.Join(GetExportAccessRequestsLockboxPartnerEnumStringValues(), ","))) + } + if _, ok := GetMappingExportAccessRequestsSortOrderEnum(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(GetExportAccessRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingExportAccessRequestsSortByEnum(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(GetExportAccessRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ExportAccessRequestsResponse wrapper for the ExportAccessRequests operation +type ExportAccessRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of io.ReadCloser instances + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ExportAccessRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ExportAccessRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ExportAccessRequestsLockboxPartnerEnum Enum with underlying type: string +type ExportAccessRequestsLockboxPartnerEnum string + +// Set of constants representing the allowable values for ExportAccessRequestsLockboxPartnerEnum +const ( + ExportAccessRequestsLockboxPartnerFaaas ExportAccessRequestsLockboxPartnerEnum = "FAAAS" + ExportAccessRequestsLockboxPartnerCanary ExportAccessRequestsLockboxPartnerEnum = "CANARY" +) + +var mappingExportAccessRequestsLockboxPartnerEnum = map[string]ExportAccessRequestsLockboxPartnerEnum{ + "FAAAS": ExportAccessRequestsLockboxPartnerFaaas, + "CANARY": ExportAccessRequestsLockboxPartnerCanary, +} + +var mappingExportAccessRequestsLockboxPartnerEnumLowerCase = map[string]ExportAccessRequestsLockboxPartnerEnum{ + "faaas": ExportAccessRequestsLockboxPartnerFaaas, + "canary": ExportAccessRequestsLockboxPartnerCanary, +} + +// GetExportAccessRequestsLockboxPartnerEnumValues Enumerates the set of values for ExportAccessRequestsLockboxPartnerEnum +func GetExportAccessRequestsLockboxPartnerEnumValues() []ExportAccessRequestsLockboxPartnerEnum { + values := make([]ExportAccessRequestsLockboxPartnerEnum, 0) + for _, v := range mappingExportAccessRequestsLockboxPartnerEnum { + values = append(values, v) + } + return values +} + +// GetExportAccessRequestsLockboxPartnerEnumStringValues Enumerates the set of values in String for ExportAccessRequestsLockboxPartnerEnum +func GetExportAccessRequestsLockboxPartnerEnumStringValues() []string { + return []string{ + "FAAAS", + "CANARY", + } +} + +// GetMappingExportAccessRequestsLockboxPartnerEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExportAccessRequestsLockboxPartnerEnum(val string) (ExportAccessRequestsLockboxPartnerEnum, bool) { + enum, ok := mappingExportAccessRequestsLockboxPartnerEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExportAccessRequestsSortOrderEnum Enum with underlying type: string +type ExportAccessRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ExportAccessRequestsSortOrderEnum +const ( + ExportAccessRequestsSortOrderAsc ExportAccessRequestsSortOrderEnum = "ASC" + ExportAccessRequestsSortOrderDesc ExportAccessRequestsSortOrderEnum = "DESC" +) + +var mappingExportAccessRequestsSortOrderEnum = map[string]ExportAccessRequestsSortOrderEnum{ + "ASC": ExportAccessRequestsSortOrderAsc, + "DESC": ExportAccessRequestsSortOrderDesc, +} + +var mappingExportAccessRequestsSortOrderEnumLowerCase = map[string]ExportAccessRequestsSortOrderEnum{ + "asc": ExportAccessRequestsSortOrderAsc, + "desc": ExportAccessRequestsSortOrderDesc, +} + +// GetExportAccessRequestsSortOrderEnumValues Enumerates the set of values for ExportAccessRequestsSortOrderEnum +func GetExportAccessRequestsSortOrderEnumValues() []ExportAccessRequestsSortOrderEnum { + values := make([]ExportAccessRequestsSortOrderEnum, 0) + for _, v := range mappingExportAccessRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetExportAccessRequestsSortOrderEnumStringValues Enumerates the set of values in String for ExportAccessRequestsSortOrderEnum +func GetExportAccessRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingExportAccessRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExportAccessRequestsSortOrderEnum(val string) (ExportAccessRequestsSortOrderEnum, bool) { + enum, ok := mappingExportAccessRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExportAccessRequestsSortByEnum Enum with underlying type: string +type ExportAccessRequestsSortByEnum string + +// Set of constants representing the allowable values for ExportAccessRequestsSortByEnum +const ( + ExportAccessRequestsSortByTimecreated ExportAccessRequestsSortByEnum = "timeCreated" + ExportAccessRequestsSortByDisplayname ExportAccessRequestsSortByEnum = "displayName" + ExportAccessRequestsSortById ExportAccessRequestsSortByEnum = "id" +) + +var mappingExportAccessRequestsSortByEnum = map[string]ExportAccessRequestsSortByEnum{ + "timeCreated": ExportAccessRequestsSortByTimecreated, + "displayName": ExportAccessRequestsSortByDisplayname, + "id": ExportAccessRequestsSortById, +} + +var mappingExportAccessRequestsSortByEnumLowerCase = map[string]ExportAccessRequestsSortByEnum{ + "timecreated": ExportAccessRequestsSortByTimecreated, + "displayname": ExportAccessRequestsSortByDisplayname, + "id": ExportAccessRequestsSortById, +} + +// GetExportAccessRequestsSortByEnumValues Enumerates the set of values for ExportAccessRequestsSortByEnum +func GetExportAccessRequestsSortByEnumValues() []ExportAccessRequestsSortByEnum { + values := make([]ExportAccessRequestsSortByEnum, 0) + for _, v := range mappingExportAccessRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetExportAccessRequestsSortByEnumStringValues Enumerates the set of values in String for ExportAccessRequestsSortByEnum +func GetExportAccessRequestsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + "id", + } +} + +// GetMappingExportAccessRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExportAccessRequestsSortByEnum(val string) (ExportAccessRequestsSortByEnum, bool) { + enum, ok := mappingExportAccessRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/lockbox/handle_access_request_details.go b/lockbox/handle_access_request_details.go index 9ff9bbffdf..bdaa852f7f 100644 --- a/lockbox/handle_access_request_details.go +++ b/lockbox/handle_access_request_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/list_access_requests_request_response.go b/lockbox/list_access_requests_request_response.go index 18393826b3..07a9fd1a32 100644 --- a/lockbox/list_access_requests_request_response.go +++ b/lockbox/list_access_requests_request_response.go @@ -36,6 +36,9 @@ type ListAccessRequestsRequest struct { // The name of the lockbox partner. LockboxPartner ListAccessRequestsLockboxPartnerEnum `mandatory:"false" contributesTo:"query" name:"lockboxPartner" omitEmpty:"true"` + // The ID of the partner. + PartnerId *string `mandatory:"false" contributesTo:"query" name:"partnerId"` + // The unique identifier (OCID) of the requestor in which to list resources. RequestorId *string `mandatory:"false" contributesTo:"query" name:"requestorId"` @@ -51,6 +54,12 @@ type ListAccessRequestsRequest struct { // 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 ListAccessRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + // Date and time on or after which Access Requests were created, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) + TimeCreatedAfter *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedAfter"` + + // Date and time on or before which Access requests were created, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) + TimeCreatedBefore *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedBefore"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/lockbox/list_lockboxes_request_response.go b/lockbox/list_lockboxes_request_response.go index 9444842ebb..eebc8a4cf2 100644 --- a/lockbox/list_lockboxes_request_response.go +++ b/lockbox/list_lockboxes_request_response.go @@ -36,6 +36,9 @@ type ListLockboxesRequest struct { // The name of the lockbox partner. LockboxPartner ListLockboxesLockboxPartnerEnum `mandatory:"false" contributesTo:"query" name:"lockboxPartner" omitEmpty:"true"` + // The ID of the partner. + PartnerId *string `mandatory:"false" contributesTo:"query" name:"partnerId"` + // The maximum number of items to return. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` diff --git a/lockbox/list_work_requests_request_response.go b/lockbox/list_work_requests_request_response.go index 69faa35165..f1b8611111 100644 --- a/lockbox/list_work_requests_request_response.go +++ b/lockbox/list_work_requests_request_response.go @@ -129,33 +129,36 @@ type ListWorkRequestsStatusEnum string // Set of constants representing the allowable values for ListWorkRequestsStatusEnum const ( - ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" - ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" - ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" - ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" - ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" - ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" - ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" ) var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ - "ACCEPTED": ListWorkRequestsStatusAccepted, - "IN_PROGRESS": ListWorkRequestsStatusInProgress, - "WAITING": ListWorkRequestsStatusWaiting, - "FAILED": ListWorkRequestsStatusFailed, - "SUCCEEDED": ListWorkRequestsStatusSucceeded, - "CANCELING": ListWorkRequestsStatusCanceling, - "CANCELED": ListWorkRequestsStatusCanceled, + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, } var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ - "accepted": ListWorkRequestsStatusAccepted, - "in_progress": ListWorkRequestsStatusInProgress, - "waiting": ListWorkRequestsStatusWaiting, - "failed": ListWorkRequestsStatusFailed, - "succeeded": ListWorkRequestsStatusSucceeded, - "canceling": ListWorkRequestsStatusCanceling, - "canceled": ListWorkRequestsStatusCanceled, + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, + "needs_attention": ListWorkRequestsStatusNeedsAttention, } // GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum @@ -177,6 +180,7 @@ func GetListWorkRequestsStatusEnumStringValues() []string { "SUCCEEDED", "CANCELING", "CANCELED", + "NEEDS_ATTENTION", } } diff --git a/lockbox/lockbox.go b/lockbox/lockbox.go index 817539ad7b..3b40296f66 100644 --- a/lockbox/lockbox.go +++ b/lockbox/lockbox.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -28,15 +28,9 @@ type Lockbox struct { // Compartment Identifier CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Compartment Identifier - PartnerCompartmentId *string `mandatory:"true" json:"partnerCompartmentId"` - // The unique identifier (OCID) of associated resource that the lockbox is created for. ResourceId *string `mandatory:"true" json:"resourceId"` - // The partner using this lockbox to lock a resource. - LockboxPartner LockboxPartnerEnum `mandatory:"true" json:"lockboxPartner"` - // The time the the Lockbox was created. An RFC3339 formatted datetime string TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` @@ -51,6 +45,18 @@ type Lockbox struct { // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + // The unique identifier (OCID) of partner resource using this lockbox to lock a resource + PartnerId *string `mandatory:"false" json:"partnerId"` + + // The unique identifier (OCID) of lockbox resource using to reference parent lockbox in hybrid oma setup + ParentLockboxId *string `mandatory:"false" json:"parentLockboxId"` + + // Compartment Identifier + PartnerCompartmentId *string `mandatory:"false" json:"partnerCompartmentId"` + + // The partner using this lockbox to lock a resource. + LockboxPartner LockboxPartnerEnum `mandatory:"false" json:"lockboxPartner,omitempty"` + // The time the Lockbox was updated. An RFC3339 formatted datetime string TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` @@ -79,13 +85,13 @@ func (m Lockbox) String() string { // Not recommended for calling this function directly func (m Lockbox) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingLockboxPartnerEnum(string(m.LockboxPartner)); !ok && m.LockboxPartner != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LockboxPartner: %s. Supported values are: %s.", m.LockboxPartner, strings.Join(GetLockboxPartnerEnumStringValues(), ","))) - } if _, ok := GetMappingLockboxLifecycleStateEnum(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(GetLockboxLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingLockboxPartnerEnum(string(m.LockboxPartner)); !ok && m.LockboxPartner != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LockboxPartner: %s. Supported values are: %s.", m.LockboxPartner, strings.Join(GetLockboxPartnerEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/lockbox/lockbox_auto_approval_state.go b/lockbox/lockbox_auto_approval_state.go index 1554513730..53f7bd58e4 100644 --- a/lockbox/lockbox_auto_approval_state.go +++ b/lockbox/lockbox_auto_approval_state.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/lockbox_client.go b/lockbox/lockbox_client.go index d94b27fdb7..8488015c7d 100644 --- a/lockbox/lockbox_client.go +++ b/lockbox/lockbox_client.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -578,6 +578,62 @@ func (client LockboxClient) deleteLockbox(ctx context.Context, request common.OC return response, err } +// ExportAccessRequests Exports a list of AccessRequestSummary objects within a compartment and during a specified time range in text format. You can filter the results by problem severity. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/lockbox/ExportAccessRequests.go.html to see an example of how to use ExportAccessRequests API. +func (client LockboxClient) ExportAccessRequests(ctx context.Context, request ExportAccessRequestsRequest) (response ExportAccessRequestsResponse, 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.exportAccessRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ExportAccessRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ExportAccessRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ExportAccessRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ExportAccessRequestsResponse") + } + return +} + +// exportAccessRequests implements the OCIOperation interface (enables retrying operations) +func (client LockboxClient) exportAccessRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/accessRequests/actions/export", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ExportAccessRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/managed-access/20220126/AccessRequestCollection/ExportAccessRequests" + err = common.PostProcessServiceError(err, "Lockbox", "ExportAccessRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetAccessMaterials Retrieves the access credential/material associated with the access request. // // # See also diff --git a/lockbox/lockbox_collection.go b/lockbox/lockbox_collection.go index 56c314e921..791306aeee 100644 --- a/lockbox/lockbox_collection.go +++ b/lockbox/lockbox_collection.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/lockbox_partner.go b/lockbox/lockbox_partner.go index 55fd9c8fef..d16646536d 100644 --- a/lockbox/lockbox_partner.go +++ b/lockbox/lockbox_partner.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/lockbox_summary.go b/lockbox/lockbox_summary.go index a8884f20f0..0c078ababd 100644 --- a/lockbox/lockbox_summary.go +++ b/lockbox/lockbox_summary.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -25,15 +25,9 @@ type LockboxSummary struct { // Lockbox Identifier, can be renamed DisplayName *string `mandatory:"true" json:"displayName"` - // The partner using this lockbox to lock a resource. - LockboxPartner LockboxPartnerEnum `mandatory:"true" json:"lockboxPartner"` - // Compartment Identifier CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Compartment Identifier - PartnerCompartmentId *string `mandatory:"true" json:"partnerCompartmentId"` - // The unique identifier (OCID) of associated resource that the lockbox is created for. ResourceId *string `mandatory:"true" json:"resourceId"` @@ -51,6 +45,15 @@ type LockboxSummary struct { // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + // The partner using this lockbox to lock a resource. + LockboxPartner LockboxPartnerEnum `mandatory:"false" json:"lockboxPartner,omitempty"` + + // The unique identifier (OCID) of partner resource using this lockbox to lock a resource + PartnerId *string `mandatory:"false" json:"partnerId"` + + // Compartment Identifier + PartnerCompartmentId *string `mandatory:"false" json:"partnerCompartmentId"` + // Approval template ID ApprovalTemplateId *string `mandatory:"false" json:"approvalTemplateId"` @@ -77,13 +80,13 @@ func (m LockboxSummary) String() string { // Not recommended for calling this function directly func (m LockboxSummary) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingLockboxPartnerEnum(string(m.LockboxPartner)); !ok && m.LockboxPartner != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LockboxPartner: %s. Supported values are: %s.", m.LockboxPartner, strings.Join(GetLockboxPartnerEnumStringValues(), ","))) - } if _, ok := GetMappingLockboxLifecycleStateEnum(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(GetLockboxLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingLockboxPartnerEnum(string(m.LockboxPartner)); !ok && m.LockboxPartner != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LockboxPartner: %s. Supported values are: %s.", m.LockboxPartner, strings.Join(GetLockboxPartnerEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/lockbox/operation_status.go b/lockbox/operation_status.go index 165c4ee72c..2b9ee47734 100644 --- a/lockbox/operation_status.go +++ b/lockbox/operation_status.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -19,33 +19,36 @@ type OperationStatusEnum string // Set of constants representing the allowable values for OperationStatusEnum const ( - OperationStatusAccepted OperationStatusEnum = "ACCEPTED" - OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" - OperationStatusWaiting OperationStatusEnum = "WAITING" - OperationStatusFailed OperationStatusEnum = "FAILED" - OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" - OperationStatusCanceling OperationStatusEnum = "CANCELING" - OperationStatusCanceled OperationStatusEnum = "CANCELED" + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" ) var mappingOperationStatusEnum = map[string]OperationStatusEnum{ - "ACCEPTED": OperationStatusAccepted, - "IN_PROGRESS": OperationStatusInProgress, - "WAITING": OperationStatusWaiting, - "FAILED": OperationStatusFailed, - "SUCCEEDED": OperationStatusSucceeded, - "CANCELING": OperationStatusCanceling, - "CANCELED": OperationStatusCanceled, + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, } var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ - "accepted": OperationStatusAccepted, - "in_progress": OperationStatusInProgress, - "waiting": OperationStatusWaiting, - "failed": OperationStatusFailed, - "succeeded": OperationStatusSucceeded, - "canceling": OperationStatusCanceling, - "canceled": OperationStatusCanceled, + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, + "needs_attention": OperationStatusNeedsAttention, } // GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum @@ -67,6 +70,7 @@ func GetOperationStatusEnumStringValues() []string { "SUCCEEDED", "CANCELING", "CANCELED", + "NEEDS_ATTENTION", } } diff --git a/lockbox/operation_type.go b/lockbox/operation_type.go index 7e1c168ff8..9181defec7 100644 --- a/lockbox/operation_type.go +++ b/lockbox/operation_type.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // @@ -19,45 +19,54 @@ type OperationTypeEnum string // Set of constants representing the allowable values for OperationTypeEnum const ( - OperationTypeCreateLockbox OperationTypeEnum = "CREATE_LOCKBOX" - OperationTypeUpdateLockbox OperationTypeEnum = "UPDATE_LOCKBOX" - OperationTypeDeleteLockbox OperationTypeEnum = "DELETE_LOCKBOX" - OperationTypeMoveLockbox OperationTypeEnum = "MOVE_LOCKBOX" - OperationTypeCreateAccessRequest OperationTypeEnum = "CREATE_ACCESS_REQUEST" - OperationTypeApproveAccessRequest OperationTypeEnum = "APPROVE_ACCESS_REQUEST" - OperationTypeRevokeAccessRequest OperationTypeEnum = "REVOKE_ACCESS_REQUEST" - OperationTypeCreateApprovalTemplate OperationTypeEnum = "CREATE_APPROVAL_TEMPLATE" - OperationTypeMoveApprovalTemplate OperationTypeEnum = "MOVE_APPROVAL_TEMPLATE" - OperationTypeUpdateApprovalTemplate OperationTypeEnum = "UPDATE_APPROVAL_TEMPLATE" - OperationTypeDeleteApprovalTemplate OperationTypeEnum = "DELETE_APPROVAL_TEMPLATE" + OperationTypeCreateLockbox OperationTypeEnum = "CREATE_LOCKBOX" + OperationTypeUpdateLockbox OperationTypeEnum = "UPDATE_LOCKBOX" + OperationTypeDeleteLockbox OperationTypeEnum = "DELETE_LOCKBOX" + OperationTypeMoveLockbox OperationTypeEnum = "MOVE_LOCKBOX" + OperationTypeCreateAccessRequest OperationTypeEnum = "CREATE_ACCESS_REQUEST" + OperationTypeApproveAccessRequest OperationTypeEnum = "APPROVE_ACCESS_REQUEST" + OperationTypeRevokeAccessRequest OperationTypeEnum = "REVOKE_ACCESS_REQUEST" + OperationTypeCreateApprovalTemplate OperationTypeEnum = "CREATE_APPROVAL_TEMPLATE" + OperationTypeMoveApprovalTemplate OperationTypeEnum = "MOVE_APPROVAL_TEMPLATE" + OperationTypeUpdateApprovalTemplate OperationTypeEnum = "UPDATE_APPROVAL_TEMPLATE" + OperationTypeDeleteApprovalTemplate OperationTypeEnum = "DELETE_APPROVAL_TEMPLATE" + OperationTypeCreatePartner OperationTypeEnum = "CREATE_PARTNER" + OperationTypeRemindAccessRequest OperationTypeEnum = "REMIND_ACCESS_REQUEST" + OperationTypeCreateAccesscontextattribute OperationTypeEnum = "CREATE_ACCESSCONTEXTATTRIBUTE" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ - "CREATE_LOCKBOX": OperationTypeCreateLockbox, - "UPDATE_LOCKBOX": OperationTypeUpdateLockbox, - "DELETE_LOCKBOX": OperationTypeDeleteLockbox, - "MOVE_LOCKBOX": OperationTypeMoveLockbox, - "CREATE_ACCESS_REQUEST": OperationTypeCreateAccessRequest, - "APPROVE_ACCESS_REQUEST": OperationTypeApproveAccessRequest, - "REVOKE_ACCESS_REQUEST": OperationTypeRevokeAccessRequest, - "CREATE_APPROVAL_TEMPLATE": OperationTypeCreateApprovalTemplate, - "MOVE_APPROVAL_TEMPLATE": OperationTypeMoveApprovalTemplate, - "UPDATE_APPROVAL_TEMPLATE": OperationTypeUpdateApprovalTemplate, - "DELETE_APPROVAL_TEMPLATE": OperationTypeDeleteApprovalTemplate, + "CREATE_LOCKBOX": OperationTypeCreateLockbox, + "UPDATE_LOCKBOX": OperationTypeUpdateLockbox, + "DELETE_LOCKBOX": OperationTypeDeleteLockbox, + "MOVE_LOCKBOX": OperationTypeMoveLockbox, + "CREATE_ACCESS_REQUEST": OperationTypeCreateAccessRequest, + "APPROVE_ACCESS_REQUEST": OperationTypeApproveAccessRequest, + "REVOKE_ACCESS_REQUEST": OperationTypeRevokeAccessRequest, + "CREATE_APPROVAL_TEMPLATE": OperationTypeCreateApprovalTemplate, + "MOVE_APPROVAL_TEMPLATE": OperationTypeMoveApprovalTemplate, + "UPDATE_APPROVAL_TEMPLATE": OperationTypeUpdateApprovalTemplate, + "DELETE_APPROVAL_TEMPLATE": OperationTypeDeleteApprovalTemplate, + "CREATE_PARTNER": OperationTypeCreatePartner, + "REMIND_ACCESS_REQUEST": OperationTypeRemindAccessRequest, + "CREATE_ACCESSCONTEXTATTRIBUTE": OperationTypeCreateAccesscontextattribute, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ - "create_lockbox": OperationTypeCreateLockbox, - "update_lockbox": OperationTypeUpdateLockbox, - "delete_lockbox": OperationTypeDeleteLockbox, - "move_lockbox": OperationTypeMoveLockbox, - "create_access_request": OperationTypeCreateAccessRequest, - "approve_access_request": OperationTypeApproveAccessRequest, - "revoke_access_request": OperationTypeRevokeAccessRequest, - "create_approval_template": OperationTypeCreateApprovalTemplate, - "move_approval_template": OperationTypeMoveApprovalTemplate, - "update_approval_template": OperationTypeUpdateApprovalTemplate, - "delete_approval_template": OperationTypeDeleteApprovalTemplate, + "create_lockbox": OperationTypeCreateLockbox, + "update_lockbox": OperationTypeUpdateLockbox, + "delete_lockbox": OperationTypeDeleteLockbox, + "move_lockbox": OperationTypeMoveLockbox, + "create_access_request": OperationTypeCreateAccessRequest, + "approve_access_request": OperationTypeApproveAccessRequest, + "revoke_access_request": OperationTypeRevokeAccessRequest, + "create_approval_template": OperationTypeCreateApprovalTemplate, + "move_approval_template": OperationTypeMoveApprovalTemplate, + "update_approval_template": OperationTypeUpdateApprovalTemplate, + "delete_approval_template": OperationTypeDeleteApprovalTemplate, + "create_partner": OperationTypeCreatePartner, + "remind_access_request": OperationTypeRemindAccessRequest, + "create_accesscontextattribute": OperationTypeCreateAccesscontextattribute, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -83,6 +92,9 @@ func GetOperationTypeEnumStringValues() []string { "MOVE_APPROVAL_TEMPLATE", "UPDATE_APPROVAL_TEMPLATE", "DELETE_APPROVAL_TEMPLATE", + "CREATE_PARTNER", + "REMIND_ACCESS_REQUEST", + "CREATE_ACCESSCONTEXTATTRIBUTE", } } diff --git a/lockbox/persona_level.go b/lockbox/persona_level.go index 4d0ea65ef2..4b7859fb0d 100644 --- a/lockbox/persona_level.go +++ b/lockbox/persona_level.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/sort_order.go b/lockbox/sort_order.go index 0d8cde7940..ad6292813e 100644 --- a/lockbox/sort_order.go +++ b/lockbox/sort_order.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/update_approval_template_details.go b/lockbox/update_approval_template_details.go index b148ac4117..4808c0159b 100644 --- a/lockbox/update_approval_template_details.go +++ b/lockbox/update_approval_template_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/update_lockbox_details.go b/lockbox/update_lockbox_details.go index db8fe21ded..f9550b9c38 100644 --- a/lockbox/update_lockbox_details.go +++ b/lockbox/update_lockbox_details.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request.go b/lockbox/work_request.go index d0a80c4729..4c8d9d266a 100644 --- a/lockbox/work_request.go +++ b/lockbox/work_request.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_error.go b/lockbox/work_request_error.go index 2053d7f508..d2ae2e5fff 100644 --- a/lockbox/work_request_error.go +++ b/lockbox/work_request_error.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_error_collection.go b/lockbox/work_request_error_collection.go index b9397653ac..dafee67be5 100644 --- a/lockbox/work_request_error_collection.go +++ b/lockbox/work_request_error_collection.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_log_entry.go b/lockbox/work_request_log_entry.go index b5e04ef2ee..791957f5d2 100644 --- a/lockbox/work_request_log_entry.go +++ b/lockbox/work_request_log_entry.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_log_entry_collection.go b/lockbox/work_request_log_entry_collection.go index 88d93aeb9b..65a3c7f84d 100644 --- a/lockbox/work_request_log_entry_collection.go +++ b/lockbox/work_request_log_entry_collection.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_resource.go b/lockbox/work_request_resource.go index 3b346a03f9..a2e67f94eb 100644 --- a/lockbox/work_request_resource.go +++ b/lockbox/work_request_resource.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_resource_metadata_key.go b/lockbox/work_request_resource_metadata_key.go index efaa35bdf9..c09c06a1ae 100644 --- a/lockbox/work_request_resource_metadata_key.go +++ b/lockbox/work_request_resource_metadata_key.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_summary.go b/lockbox/work_request_summary.go index ac7c6e6c17..d36dd72641 100644 --- a/lockbox/work_request_summary.go +++ b/lockbox/work_request_summary.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/lockbox/work_request_summary_collection.go b/lockbox/work_request_summary_collection.go index 010bd24cac..507adb709f 100644 --- a/lockbox/work_request_summary_collection.go +++ b/lockbox/work_request_summary_collection.go @@ -4,7 +4,7 @@ // Managed Access API // -// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/en-us/iaas/managed-access/overview.htm). +// Use the Managed Access API to approve access requests, create and manage templates, and manage resource approval settings. For more information, see Managed Access Overview (https://docs.oracle.com/iaas/Content/managed-access/home.htm). // Use the table of contents and search tool to explore the Managed Access API. // diff --git a/logging/action_types.go b/logging/action_types.go index e47b757d01..8900306fdb 100644 --- a/logging/action_types.go +++ b/logging/action_types.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/archiving.go b/logging/archiving.go index 97436de8a7..8672e3ef1a 100644 --- a/logging/archiving.go +++ b/logging/archiving.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/category.go b/logging/category.go index 2926c6e513..f4f1a9f580 100644 --- a/logging/category.go +++ b/logging/category.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/change_log_group_compartment_details.go b/logging/change_log_group_compartment_details.go index 8acc24edc0..4403d12282 100644 --- a/logging/change_log_group_compartment_details.go +++ b/logging/change_log_group_compartment_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/change_log_log_group_details.go b/logging/change_log_log_group_details.go index 4ba295260d..1f88ba6bfa 100644 --- a/logging/change_log_log_group_details.go +++ b/logging/change_log_log_group_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/change_log_saved_search_compartment_details.go b/logging/change_log_saved_search_compartment_details.go index f3caec042f..ccc9190097 100644 --- a/logging/change_log_saved_search_compartment_details.go +++ b/logging/change_log_saved_search_compartment_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/change_unified_agent_configuration_compartment_details.go b/logging/change_unified_agent_configuration_compartment_details.go index 568219df50..66a7c0a57d 100644 --- a/logging/change_unified_agent_configuration_compartment_details.go +++ b/logging/change_unified_agent_configuration_compartment_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/configuration.go b/logging/configuration.go index 7b10acaaa3..4a629dadb5 100644 --- a/logging/configuration.go +++ b/logging/configuration.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/create_log_details.go b/logging/create_log_details.go index 01e0ab919a..850817e85e 100644 --- a/logging/create_log_details.go +++ b/logging/create_log_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/create_log_group_details.go b/logging/create_log_group_details.go index 30a5c0f2ec..665b04c53f 100644 --- a/logging/create_log_group_details.go +++ b/logging/create_log_group_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/create_log_saved_search_details.go b/logging/create_log_saved_search_details.go index b6e5dceb35..6d0b2ef6c6 100644 --- a/logging/create_log_saved_search_details.go +++ b/logging/create_log_saved_search_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/create_unified_agent_configuration_details.go b/logging/create_unified_agent_configuration_details.go index a55ebd685e..542ed3a27f 100644 --- a/logging/create_unified_agent_configuration_details.go +++ b/logging/create_unified_agent_configuration_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/grok_pattern.go b/logging/grok_pattern.go index 6815dd8823..26aa712749 100644 --- a/logging/grok_pattern.go +++ b/logging/grok_pattern.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -18,13 +17,13 @@ import ( "strings" ) -// GrokPattern grok pattern object. +// GrokPattern Grok pattern object. type GrokPattern struct { - // The grok pattern. + // The Grok pattern. Pattern *string `mandatory:"true" json:"pattern"` - // The name key to tag this grok pattern. + // The name key to tag this Grok pattern. Name *string `mandatory:"false" json:"name"` // Specify the time field for the event time. If the event doesn't have this field, the current time is used. diff --git a/logging/group_association_details.go b/logging/group_association_details.go index 4903a3301a..2484c90aab 100644 --- a/logging/group_association_details.go +++ b/logging/group_association_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/list_services_request_response.go b/logging/list_services_request_response.go index a64696547c..1f9c7d9fe5 100644 --- a/logging/list_services_request_response.go +++ b/logging/list_services_request_response.go @@ -18,9 +18,6 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/ListServices.go.html to see an example of how to use ListServicesRequest. type ListServicesRequest struct { - // Service stage of a service. The allowed values are "ProductionStage", "DevStage" and "LAStage". - ServiceStage *string `mandatory:"false" contributesTo:"query" name:"serviceStage"` - // 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"` diff --git a/logging/log.go b/logging/log.go index 74bd32ccd1..a230bea190 100644 --- a/logging/log.go +++ b/logging/log.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_group.go b/logging/log_group.go index 2c1d5c9c3a..4eb15a8e55 100644 --- a/logging/log_group.go +++ b/logging/log_group.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_group_lifecycle_state.go b/logging/log_group_lifecycle_state.go index 946c6e4e63..027033b105 100644 --- a/logging/log_group_lifecycle_state.go +++ b/logging/log_group_lifecycle_state.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_group_summary.go b/logging/log_group_summary.go index bf6924f7c1..c69d9eccdd 100644 --- a/logging/log_group_summary.go +++ b/logging/log_group_summary.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_lifecycle_state.go b/logging/log_lifecycle_state.go index 8573c878eb..9ea577131b 100644 --- a/logging/log_lifecycle_state.go +++ b/logging/log_lifecycle_state.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_saved_search.go b/logging/log_saved_search.go index 126a77440c..31cd8caad0 100644 --- a/logging/log_saved_search.go +++ b/logging/log_saved_search.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_saved_search_lifecycle_state.go b/logging/log_saved_search_lifecycle_state.go index d3a2586ead..2f1ce25b4e 100644 --- a/logging/log_saved_search_lifecycle_state.go +++ b/logging/log_saved_search_lifecycle_state.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_saved_search_summary.go b/logging/log_saved_search_summary.go index e57d0bfe71..933b6dc020 100644 --- a/logging/log_saved_search_summary.go +++ b/logging/log_saved_search_summary.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_saved_search_summary_collection.go b/logging/log_saved_search_summary_collection.go index bf9cc83f49..49283cfee0 100644 --- a/logging/log_saved_search_summary_collection.go +++ b/logging/log_saved_search_summary_collection.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/log_summary.go b/logging/log_summary.go index a01e711220..0a6d7544da 100644 --- a/logging/log_summary.go +++ b/logging/log_summary.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/logging_loggingmanagement_client.go b/logging/logging_loggingmanagement_client.go index 2f1c3adb9e..5b514ddf9c 100644 --- a/logging/logging_loggingmanagement_client.go +++ b/logging/logging_loggingmanagement_client.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/oci_service.go b/logging/oci_service.go index bacad7a319..608cb2f511 100644 --- a/logging/oci_service.go +++ b/logging/oci_service.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/operation_status.go b/logging/operation_status.go index d128d1c5ad..2ff1a516a9 100644 --- a/logging/operation_status.go +++ b/logging/operation_status.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/operation_types.go b/logging/operation_types.go index c890ee4e47..9da030cfb7 100644 --- a/logging/operation_types.go +++ b/logging/operation_types.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/operational_metrics_configuration.go b/logging/operational_metrics_configuration.go new file mode 100644 index 0000000000..2a26c5f95e --- /dev/null +++ b/logging/operational_metrics_configuration.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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OperationalMetricsConfiguration Unified monitoring agent operational metrics configuration object. +type OperationalMetricsConfiguration struct { + Source *OperationalMetricsSource `mandatory:"true" json:"source"` + + Destination *OperationalMetricsDestination `mandatory:"true" json:"destination"` +} + +func (m OperationalMetricsConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OperationalMetricsConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/operational_metrics_destination.go b/logging/operational_metrics_destination.go new file mode 100644 index 0000000000..f604d926ee --- /dev/null +++ b/logging/operational_metrics_destination.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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OperationalMetricsDestination Unified monitoring agent operational metrics destination object. +type OperationalMetricsDestination struct { + + // The OCID of the compartment that the resource belongs to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m OperationalMetricsDestination) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OperationalMetricsDestination) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/operational_metrics_record_input.go b/logging/operational_metrics_record_input.go new file mode 100644 index 0000000000..7ca49ff1a5 --- /dev/null +++ b/logging/operational_metrics_record_input.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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OperationalMetricsRecordInput Record section of OperationalMetricsSource object. +type OperationalMetricsRecordInput struct { + + // Namespace to emit the operational metrics. + Namespace *string `mandatory:"true" json:"namespace"` + + // Resource group to emit the operational metrics. + ResourceGroup *string `mandatory:"false" json:"resourceGroup"` +} + +func (m OperationalMetricsRecordInput) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OperationalMetricsRecordInput) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/operational_metrics_source.go b/logging/operational_metrics_source.go new file mode 100644 index 0000000000..7dae918abe --- /dev/null +++ b/logging/operational_metrics_source.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OperationalMetricsSource Unified monitoring agent operational metrics source object. +type OperationalMetricsSource struct { + + // Type of the unified monitoring agent operational metrics source object. + Type OperationalMetricsSourceTypeEnum `mandatory:"true" json:"type"` + + // List of unified monitoring agent operational metrics. + Metrics []string `mandatory:"false" json:"metrics"` + + RecordInput *OperationalMetricsRecordInput `mandatory:"false" json:"recordInput"` +} + +func (m OperationalMetricsSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OperationalMetricsSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationalMetricsSourceTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetOperationalMetricsSourceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OperationalMetricsSourceTypeEnum Enum with underlying type: string +type OperationalMetricsSourceTypeEnum string + +// Set of constants representing the allowable values for OperationalMetricsSourceTypeEnum +const ( + OperationalMetricsSourceTypeUmaMetrics OperationalMetricsSourceTypeEnum = "UMA_METRICS" +) + +var mappingOperationalMetricsSourceTypeEnum = map[string]OperationalMetricsSourceTypeEnum{ + "UMA_METRICS": OperationalMetricsSourceTypeUmaMetrics, +} + +var mappingOperationalMetricsSourceTypeEnumLowerCase = map[string]OperationalMetricsSourceTypeEnum{ + "uma_metrics": OperationalMetricsSourceTypeUmaMetrics, +} + +// GetOperationalMetricsSourceTypeEnumValues Enumerates the set of values for OperationalMetricsSourceTypeEnum +func GetOperationalMetricsSourceTypeEnumValues() []OperationalMetricsSourceTypeEnum { + values := make([]OperationalMetricsSourceTypeEnum, 0) + for _, v := range mappingOperationalMetricsSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationalMetricsSourceTypeEnumStringValues Enumerates the set of values in String for OperationalMetricsSourceTypeEnum +func GetOperationalMetricsSourceTypeEnumStringValues() []string { + return []string{ + "UMA_METRICS", + } +} + +// GetMappingOperationalMetricsSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationalMetricsSourceTypeEnum(val string) (OperationalMetricsSourceTypeEnum, bool) { + enum, ok := mappingOperationalMetricsSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/logging/parameter.go b/logging/parameter.go index 1d514fe88f..f0d99f3e6f 100644 --- a/logging/parameter.go +++ b/logging/parameter.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -24,16 +23,8 @@ type Parameter struct { // Parameter name. Name *string `mandatory:"true" json:"name"` - // Parameter type. Type ParameterTypeEnum `mandatory:"true" json:"type"` - // The user-friendly display name. This must be unique within the enclosing resource, - // and it's changeable. Avoid entering confidential information. - DisplayName *string `mandatory:"false" json:"displayName"` - - // Parameter rqsType if applicable. - RqsType *string `mandatory:"false" json:"rqsType"` - // Java regex pattern to validate a parameter value. Pattern *string `mandatory:"false" json:"pattern"` } @@ -62,27 +53,21 @@ type ParameterTypeEnum string // Set of constants representing the allowable values for ParameterTypeEnum const ( - ParameterTypeInteger ParameterTypeEnum = "integer" - ParameterTypeString ParameterTypeEnum = "string" - ParameterTypeBoolean ParameterTypeEnum = "boolean" - ParameterTypeEnumString ParameterTypeEnum = "ENUM_STRING" - ParameterTypeRqsFilter ParameterTypeEnum = "RQS_FILTER" + ParameterTypeInteger ParameterTypeEnum = "integer" + ParameterTypeString ParameterTypeEnum = "string" + ParameterTypeBoolean ParameterTypeEnum = "boolean" ) var mappingParameterTypeEnum = map[string]ParameterTypeEnum{ - "integer": ParameterTypeInteger, - "string": ParameterTypeString, - "boolean": ParameterTypeBoolean, - "ENUM_STRING": ParameterTypeEnumString, - "RQS_FILTER": ParameterTypeRqsFilter, + "integer": ParameterTypeInteger, + "string": ParameterTypeString, + "boolean": ParameterTypeBoolean, } var mappingParameterTypeEnumLowerCase = map[string]ParameterTypeEnum{ - "integer": ParameterTypeInteger, - "string": ParameterTypeString, - "boolean": ParameterTypeBoolean, - "enum_string": ParameterTypeEnumString, - "rqs_filter": ParameterTypeRqsFilter, + "integer": ParameterTypeInteger, + "string": ParameterTypeString, + "boolean": ParameterTypeBoolean, } // GetParameterTypeEnumValues Enumerates the set of values for ParameterTypeEnum @@ -100,8 +85,6 @@ func GetParameterTypeEnumStringValues() []string { "integer", "string", "boolean", - "ENUM_STRING", - "RQS_FILTER", } } diff --git a/logging/resource_type.go b/logging/resource_type.go index e6992f1b9c..a7cc2df13b 100644 --- a/logging/resource_type.go +++ b/logging/resource_type.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/service_summary.go b/logging/service_summary.go index 1344c64ff3..ff0437c3bd 100644 --- a/logging/service_summary.go +++ b/logging/service_summary.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/source.go b/logging/source.go index e24f52d464..81619d8f6e 100644 --- a/logging/source.go +++ b/logging/source.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/source_update_details.go b/logging/source_update_details.go index 97b348092d..136786bd80 100644 --- a/logging/source_update_details.go +++ b/logging/source_update_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_apache2_parser.go b/logging/unified_agent_apache2_parser.go index 393ef65c2b..332636839b 100644 --- a/logging/unified_agent_apache2_parser.go +++ b/logging/unified_agent_apache2_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentApache2Parser Apache 2 log parser. type UnifiedAgentApache2Parser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedAgentApache2Parser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_apache_error_parser.go b/logging/unified_agent_apache_error_parser.go index 5e8b5edf85..0b3bd89fc4 100644 --- a/logging/unified_agent_apache_error_parser.go +++ b/logging/unified_agent_apache_error_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentApacheErrorParser Apache error log parser. type UnifiedAgentApacheErrorParser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedAgentApacheErrorParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_auditd_parser.go b/logging/unified_agent_auditd_parser.go index d79208db58..a7cd2f3919 100644 --- a/logging/unified_agent_auditd_parser.go +++ b/logging/unified_agent_auditd_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentAuditdParser auditd parser. type UnifiedAgentAuditdParser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedAgentAuditdParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_configuration.go b/logging/unified_agent_configuration.go index 5f3ed2100e..c76e834468 100644 --- a/logging/unified_agent_configuration.go +++ b/logging/unified_agent_configuration.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_configuration_collection.go b/logging/unified_agent_configuration_collection.go index 18235f3a55..5788b8069e 100644 --- a/logging/unified_agent_configuration_collection.go +++ b/logging/unified_agent_configuration_collection.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_configuration_summary.go b/logging/unified_agent_configuration_summary.go index 660d1e751a..e261e039d7 100644 --- a/logging/unified_agent_configuration_summary.go +++ b/logging/unified_agent_configuration_summary.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_cri_parser.go b/logging/unified_agent_cri_parser.go index af845ca1e0..34d52021cd 100644 --- a/logging/unified_agent_cri_parser.go +++ b/logging/unified_agent_cri_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentCriParser CRI parser. type UnifiedAgentCriParser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,22 +47,22 @@ type UnifiedAgentCriParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` - // If you don't need stream/logtag fields, set this to false. + // If you don't need stream or logtag fields, set this to false. IsMergeCriFields *bool `mandatory:"false" json:"isMergeCriFields"` - // Optional nested JSON Parser for CRI Parser. Supported fields are fieldTimeKey, timeFormat, and isKeepTimeKey. + // Optional nested JSON Parser for CRI. Supported fields are fieldTimeKey, timeFormat, and isKeepTimeKey. NestedParser *UnifiedJsonParser `mandatory:"false" json:"nestedParser"` } diff --git a/logging/unified_agent_csv_parser.go b/logging/unified_agent_csv_parser.go index 2d7788cbef..03bccbc129 100644 --- a/logging/unified_agent_csv_parser.go +++ b/logging/unified_agent_csv_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,10 +21,10 @@ import ( // UnifiedAgentCsvParser CSV Parser. type UnifiedAgentCsvParser struct { - // csv keys. + // CSV keys. Keys []string `mandatory:"true" json:"keys"` - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -51,19 +50,19 @@ type UnifiedAgentCsvParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` - // csv delimiter. + // CSV delimiter. Delimiter *string `mandatory:"false" json:"delimiter"` } diff --git a/logging/unified_agent_grok_parser.go b/logging/unified_agent_grok_parser.go index 9ddf01c331..da64971eae 100644 --- a/logging/unified_agent_grok_parser.go +++ b/logging/unified_agent_grok_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -19,13 +18,13 @@ import ( "strings" ) -// UnifiedAgentGrokParser grok parser. +// UnifiedAgentGrokParser Grok parser. type UnifiedAgentGrokParser struct { - // grok pattern object. + // Grok pattern object. Patterns []GrokPattern `mandatory:"true" json:"patterns"` - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -51,22 +50,22 @@ type UnifiedAgentGrokParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` - // grok name key. + // Grok name key. GrokNameKey *string `mandatory:"false" json:"grokNameKey"` - // grok failure key. + // Grok failure key. GrokFailureKey *string `mandatory:"false" json:"grokFailureKey"` } diff --git a/logging/unified_agent_logging_configuration.go b/logging/unified_agent_logging_configuration.go index 3b458bb77a..add0d8968e 100644 --- a/logging/unified_agent_logging_configuration.go +++ b/logging/unified_agent_logging_configuration.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_logging_destination.go b/logging/unified_agent_logging_destination.go index f693309168..a2c1a837be 100644 --- a/logging/unified_agent_logging_destination.go +++ b/logging/unified_agent_logging_destination.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -23,6 +22,8 @@ type UnifiedAgentLoggingDestination struct { // The OCID of the resource. LogObjectId *string `mandatory:"true" json:"logObjectId"` + + OperationalMetricsConfiguration *OperationalMetricsConfiguration `mandatory:"false" json:"operationalMetricsConfiguration"` } func (m UnifiedAgentLoggingDestination) String() string { diff --git a/logging/unified_agent_logging_source.go b/logging/unified_agent_logging_source.go index fee85bde38..ab6dc8a669 100644 --- a/logging/unified_agent_logging_source.go +++ b/logging/unified_agent_logging_source.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentLoggingSource Logging source object. type UnifiedAgentLoggingSource interface { - // unique name for the source + // Unique name for the source. GetName() *string } diff --git a/logging/unified_agent_msgpack_parser.go b/logging/unified_agent_msgpack_parser.go index 57440d1caf..0aa2fc7f39 100644 --- a/logging/unified_agent_msgpack_parser.go +++ b/logging/unified_agent_msgpack_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -19,10 +18,10 @@ import ( "strings" ) -// UnifiedAgentMsgpackParser msgpack parser. +// UnifiedAgentMsgpackParser Msgpack parser. type UnifiedAgentMsgpackParser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedAgentMsgpackParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_multiline_grok_parser.go b/logging/unified_agent_multiline_grok_parser.go index 8c9c830b9d..5e8dcd7782 100644 --- a/logging/unified_agent_multiline_grok_parser.go +++ b/logging/unified_agent_multiline_grok_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,10 +21,10 @@ import ( // UnifiedAgentMultilineGrokParser Multiline grok parser. type UnifiedAgentMultilineGrokParser struct { - // grok pattern object. + // Grok pattern object. Patterns []GrokPattern `mandatory:"true" json:"patterns"` - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -51,22 +50,22 @@ type UnifiedAgentMultilineGrokParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` - // grok name key. + // Grok name key. GrokNameKey *string `mandatory:"false" json:"grokNameKey"` - // grok failure key. + // Grok failure key. GrokFailureKey *string `mandatory:"false" json:"grokFailureKey"` // Multiline start regexp pattern. diff --git a/logging/unified_agent_multiline_parser.go b/logging/unified_agent_multiline_parser.go index eab858a24f..5d3dd5a055 100644 --- a/logging/unified_agent_multiline_parser.go +++ b/logging/unified_agent_multiline_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -25,7 +24,7 @@ type UnifiedAgentMultilineParser struct { // Mutiline pattern format. Format []string `mandatory:"true" json:"format"` - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -51,13 +50,13 @@ type UnifiedAgentMultilineParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_none_parser.go b/logging/unified_agent_none_parser.go index baa58f90af..b090b2a57e 100644 --- a/logging/unified_agent_none_parser.go +++ b/logging/unified_agent_none_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentNoneParser This parser signifies a non-parser, and puts the entire log line in a message_key. type UnifiedAgentNoneParser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedAgentNoneParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_parser.go b/logging/unified_agent_parser.go index 6811ae58cf..a2a4801bad 100644 --- a/logging/unified_agent_parser.go +++ b/logging/unified_agent_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -19,10 +18,10 @@ import ( "strings" ) -// UnifiedAgentParser source parser object. +// UnifiedAgentParser Source parser object. type UnifiedAgentParser interface { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. GetFieldTimeKey() *string // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedAgentParser interface { // Specify the null value pattern. GetNullValuePattern() *string - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. GetIsNullEmptyString() *bool - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. GetIsEstimateCurrentEvent() *bool - // If true, keep time field in the record. + // If true, keep the time field in the record. GetIsKeepTimeKey() *bool // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_regex_parser.go b/logging/unified_agent_regex_parser.go index 7e72c1eea8..f5aea81672 100644 --- a/logging/unified_agent_regex_parser.go +++ b/logging/unified_agent_regex_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -19,13 +18,13 @@ import ( "strings" ) -// UnifiedAgentRegexParser regexp parser. +// UnifiedAgentRegexParser Regexp parser. type UnifiedAgentRegexParser struct { // Regex pattern. Expression *string `mandatory:"true" json:"expression"` - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -51,13 +50,13 @@ type UnifiedAgentRegexParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. diff --git a/logging/unified_agent_service_configuration_details.go b/logging/unified_agent_service_configuration_details.go index 8d7f765f02..d0e67b3422 100644 --- a/logging/unified_agent_service_configuration_details.go +++ b/logging/unified_agent_service_configuration_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_service_configuration_states.go b/logging/unified_agent_service_configuration_states.go index 297d862812..a12b481643 100644 --- a/logging/unified_agent_service_configuration_states.go +++ b/logging/unified_agent_service_configuration_states.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_service_configuration_types.go b/logging/unified_agent_service_configuration_types.go index dbacf868f4..e840a66993 100644 --- a/logging/unified_agent_service_configuration_types.go +++ b/logging/unified_agent_service_configuration_types.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/unified_agent_syslog_parser.go b/logging/unified_agent_syslog_parser.go index b8f51f1fb8..8386f92013 100644 --- a/logging/unified_agent_syslog_parser.go +++ b/logging/unified_agent_syslog_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentSyslogParser Syslog Parser. type UnifiedAgentSyslogParser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedAgentSyslogParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. @@ -63,16 +62,16 @@ type UnifiedAgentSyslogParser struct { // Time format. TimeFormat *string `mandatory:"false" json:"timeFormat"` - // rfc5424 time format. + // RFC 5424 time format. Rfc5424TimeFormat *string `mandatory:"false" json:"rfc5424TimeFormat"` - // With priority or not. + // Specifies with priority or not. Corresponds to the Fluentd with_priority parameter. IsWithPriority *bool `mandatory:"false" json:"isWithPriority"` - // Support colonless ident or not. + // Specifies whether or not to support colonless ident. Corresponds to the Fluentd support_colonless_ident parameter. IsSupportColonlessIdent *bool `mandatory:"false" json:"isSupportColonlessIdent"` - // Message format of syslog. + // Syslog message format. MessageFormat UnifiedAgentSyslogParserMessageFormatEnum `mandatory:"false" json:"messageFormat,omitempty"` // Syslog parser type. diff --git a/logging/unified_agent_tail_log_source.go b/logging/unified_agent_tail_log_source.go index 110a816d26..397d5e4596 100644 --- a/logging/unified_agent_tail_log_source.go +++ b/logging/unified_agent_tail_log_source.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,10 +21,10 @@ import ( // UnifiedAgentTailLogSource Tail log source object. type UnifiedAgentTailLogSource struct { - // unique name for the source + // Unique name for the source. Name *string `mandatory:"true" json:"name"` - // Absolute paths for log source files. Wildcard can be used. + // Absolute paths for log source files. Wildcards can be used. Paths []string `mandatory:"true" json:"paths"` Parser UnifiedAgentParser `mandatory:"false" json:"parser"` diff --git a/logging/unified_agent_tsv_parser.go b/logging/unified_agent_tsv_parser.go index 78497acd42..ef928976a6 100644 --- a/logging/unified_agent_tsv_parser.go +++ b/logging/unified_agent_tsv_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,10 +21,10 @@ import ( // UnifiedAgentTsvParser TSV Parser. type UnifiedAgentTsvParser struct { - // tsv keys. + // TSV keys. Keys []string `mandatory:"true" json:"keys"` - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -51,19 +50,19 @@ type UnifiedAgentTsvParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` - // tsv delimiter. + // TSV delimiter. Delimiter *string `mandatory:"false" json:"delimiter"` } diff --git a/logging/unified_agent_windows_event_source.go b/logging/unified_agent_windows_event_source.go index 4a607a671a..4494377246 100644 --- a/logging/unified_agent_windows_event_source.go +++ b/logging/unified_agent_windows_event_source.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedAgentWindowsEventSource Windows events log source object. type UnifiedAgentWindowsEventSource struct { - // unique name for the source + // Unique name for the source. Name *string `mandatory:"true" json:"name"` // Windows event log channels. diff --git a/logging/unified_json_parser.go b/logging/unified_json_parser.go index bad2a1806d..09957e01ae 100644 --- a/logging/unified_json_parser.go +++ b/logging/unified_json_parser.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // @@ -22,7 +21,7 @@ import ( // UnifiedJsonParser JSON parser. type UnifiedJsonParser struct { - // Specify time field for the event time. If the event doesn't have this field, the current time is used. + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. @@ -48,13 +47,13 @@ type UnifiedJsonParser struct { // Specify the null value pattern. NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` - // If true, an empty string field is replaced with nil. + // If true, an empty string field is replaced with a null value. IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` - // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` - // If true, keep time field in the record. + // If true, keep the time field in the record. IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. @@ -63,7 +62,7 @@ type UnifiedJsonParser struct { // Process time value using the specified format. TimeFormat *string `mandatory:"false" json:"timeFormat"` - // Time type of JSON parser. + // JSON parser time type. TimeType UnifiedJsonParserTimeTypeEnum `mandatory:"false" json:"timeType,omitempty"` } diff --git a/logging/update_configuration_details.go b/logging/update_configuration_details.go index a4ee0e999f..ed58f6be3e 100644 --- a/logging/update_configuration_details.go +++ b/logging/update_configuration_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/update_log_details.go b/logging/update_log_details.go index c06e6f5a28..8adff862b5 100644 --- a/logging/update_log_details.go +++ b/logging/update_log_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/update_log_group_details.go b/logging/update_log_group_details.go index e7376a54fc..b090d8afad 100644 --- a/logging/update_log_group_details.go +++ b/logging/update_log_group_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/update_log_saved_search_details.go b/logging/update_log_saved_search_details.go index e9c54430d5..fee4e3a734 100644 --- a/logging/update_log_saved_search_details.go +++ b/logging/update_log_saved_search_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/update_unified_agent_configuration_details.go b/logging/update_unified_agent_configuration_details.go index 36f624d55f..ede55ef75f 100644 --- a/logging/update_unified_agent_configuration_details.go +++ b/logging/update_unified_agent_configuration_details.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/work_request.go b/logging/work_request.go index 02e1bcc8b0..0665314b1d 100644 --- a/logging/work_request.go +++ b/logging/work_request.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/work_request_error.go b/logging/work_request_error.go index 86f554dc96..a968d6eb00 100644 --- a/logging/work_request_error.go +++ b/logging/work_request_error.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/work_request_log.go b/logging/work_request_log.go index b8844ffdb0..065ef91ca0 100644 --- a/logging/work_request_log.go +++ b/logging/work_request_log.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/work_request_resource.go b/logging/work_request_resource.go index b016c299cb..c9f7483ba6 100644 --- a/logging/work_request_resource.go +++ b/logging/work_request_resource.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/logging/work_request_summary.go b/logging/work_request_summary.go index c14d2b6723..695f2ee513 100644 --- a/logging/work_request_summary.go +++ b/logging/work_request_summary.go @@ -5,8 +5,7 @@ // Logging Management API // // Use the Logging Management API to create, read, list, update, move and delete -// log groups, log objects, log saved searches, agent configurations, log data models, -// continuous queries, and managed continuous queries. +// log groups, log objects, log saved searches, and agent configurations. // For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // diff --git a/marketplacepublisher/action_type.go b/marketplacepublisher/action_type.go new file mode 100644 index 0000000000..d577ac7aeb --- /dev/null +++ b/marketplacepublisher/action_type.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeCreated ActionTypeEnum = "CREATED" + ActionTypeUpdated ActionTypeEnum = "UPDATED" + ActionTypeDeleted ActionTypeEnum = "DELETED" + ActionTypeInProgress ActionTypeEnum = "IN_PROGRESS" + ActionTypeRelated ActionTypeEnum = "RELATED" + ActionTypeFailed ActionTypeEnum = "FAILED" +) + +var mappingActionTypeEnum = map[string]ActionTypeEnum{ + "CREATED": ActionTypeCreated, + "UPDATED": ActionTypeUpdated, + "DELETED": ActionTypeDeleted, + "IN_PROGRESS": ActionTypeInProgress, + "RELATED": ActionTypeRelated, + "FAILED": ActionTypeFailed, +} + +var mappingActionTypeEnumLowerCase = map[string]ActionTypeEnum{ + "created": ActionTypeCreated, + "updated": ActionTypeUpdated, + "deleted": ActionTypeDeleted, + "in_progress": ActionTypeInProgress, + "related": ActionTypeRelated, + "failed": ActionTypeFailed, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionTypeEnumStringValues Enumerates the set of values in String for ActionTypeEnum +func GetActionTypeEnumStringValues() []string { + return []string{ + "CREATED", + "UPDATED", + "DELETED", + "IN_PROGRESS", + "RELATED", + "FAILED", + } +} + +// GetMappingActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionTypeEnum(val string) (ActionTypeEnum, bool) { + enum, ok := mappingActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/activate_term_version_request_response.go b/marketplacepublisher/activate_term_version_request_response.go new file mode 100644 index 0000000000..b953a7f197 --- /dev/null +++ b/marketplacepublisher/activate_term_version_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ActivateTermVersionRequest wrapper for the ActivateTermVersion operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ActivateTermVersion.go.html to see an example of how to use ActivateTermVersionRequest. +type ActivateTermVersionRequest struct { + + // term version OCID + TermVersionId *string `mandatory:"true" contributesTo:"path" name:"termVersionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ActivateTermVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ActivateTermVersionRequest) 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 ActivateTermVersionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ActivateTermVersionRequest) 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 ActivateTermVersionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ActivateTermVersionResponse wrapper for the ActivateTermVersion operation +type ActivateTermVersionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TermVersion instance + TermVersion `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 ActivateTermVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ActivateTermVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/artifact.go b/marketplacepublisher/artifact.go new file mode 100644 index 0000000000..c3ec27d392 --- /dev/null +++ b/marketplacepublisher/artifact.go @@ -0,0 +1,316 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Artifact Base model object for the artifacts. +type Artifact interface { + + // Unique OCID identifier for the artifact. + GetId() *string + + // A display name for the artifact. + GetDisplayName() *string + + // The current status for the Artifact. + GetStatus() ArtifactStatusEnum + + // The current state for the Artifact. + GetLifecycleState() ArtifactLifecycleStateEnum + + // The date and time the artifact was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + GetTimeCreated() *common.SDKTime + + // The unique identifier for the compartment. + GetCompartmentId() *string + + // The unique identifier for the publisher. + GetPublisherId() *string + + // The date and time the artifact was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + GetTimeUpdated() *common.SDKTime + + // Status notes for the Artifact. + GetStatusNotes() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type artifact struct { + JsonData []byte + StatusNotes *string `mandatory:"false" json:"statusNotes"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + Id *string `mandatory:"true" json:"id"` + DisplayName *string `mandatory:"true" json:"displayName"` + Status ArtifactStatusEnum `mandatory:"true" json:"status"` + LifecycleState ArtifactLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + PublisherId *string `mandatory:"true" json:"publisherId"` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + ArtifactType string `json:"artifactType"` +} + +// UnmarshalJSON unmarshals json +func (m *artifact) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerartifact artifact + s := struct { + Model Unmarshalerartifact + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Id = s.Model.Id + m.DisplayName = s.Model.DisplayName + m.Status = s.Model.Status + m.LifecycleState = s.Model.LifecycleState + m.TimeCreated = s.Model.TimeCreated + m.CompartmentId = s.Model.CompartmentId + m.PublisherId = s.Model.PublisherId + m.TimeUpdated = s.Model.TimeUpdated + m.StatusNotes = s.Model.StatusNotes + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.ArtifactType = s.Model.ArtifactType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *artifact) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ArtifactType { + case "CONTAINER_IMAGE": + mm := ContainerImageArtifact{} + err = json.Unmarshal(data, &mm) + return mm, err + case "HELM_CHART": + mm := KubernetesImageArtifact{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for Artifact: %s.", m.ArtifactType) + return *m, nil + } +} + +// GetStatusNotes returns StatusNotes +func (m artifact) GetStatusNotes() *string { + return m.StatusNotes +} + +// GetFreeformTags returns FreeformTags +func (m artifact) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m artifact) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m artifact) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +// GetId returns Id +func (m artifact) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m artifact) GetDisplayName() *string { + return m.DisplayName +} + +// GetStatus returns Status +func (m artifact) GetStatus() ArtifactStatusEnum { + return m.Status +} + +// GetLifecycleState returns LifecycleState +func (m artifact) GetLifecycleState() ArtifactLifecycleStateEnum { + return m.LifecycleState +} + +// GetTimeCreated returns TimeCreated +func (m artifact) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetCompartmentId returns CompartmentId +func (m artifact) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetPublisherId returns PublisherId +func (m artifact) GetPublisherId() *string { + return m.PublisherId +} + +// GetTimeUpdated returns TimeUpdated +func (m artifact) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m artifact) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m artifact) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingArtifactStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetArtifactStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingArtifactLifecycleStateEnum(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(GetArtifactLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ArtifactStatusEnum Enum with underlying type: string +type ArtifactStatusEnum string + +// Set of constants representing the allowable values for ArtifactStatusEnum +const ( + ArtifactStatusInProgress ArtifactStatusEnum = "IN_PROGRESS" + ArtifactStatusAvailable ArtifactStatusEnum = "AVAILABLE" + ArtifactStatusUnavailable ArtifactStatusEnum = "UNAVAILABLE" +) + +var mappingArtifactStatusEnum = map[string]ArtifactStatusEnum{ + "IN_PROGRESS": ArtifactStatusInProgress, + "AVAILABLE": ArtifactStatusAvailable, + "UNAVAILABLE": ArtifactStatusUnavailable, +} + +var mappingArtifactStatusEnumLowerCase = map[string]ArtifactStatusEnum{ + "in_progress": ArtifactStatusInProgress, + "available": ArtifactStatusAvailable, + "unavailable": ArtifactStatusUnavailable, +} + +// GetArtifactStatusEnumValues Enumerates the set of values for ArtifactStatusEnum +func GetArtifactStatusEnumValues() []ArtifactStatusEnum { + values := make([]ArtifactStatusEnum, 0) + for _, v := range mappingArtifactStatusEnum { + values = append(values, v) + } + return values +} + +// GetArtifactStatusEnumStringValues Enumerates the set of values in String for ArtifactStatusEnum +func GetArtifactStatusEnumStringValues() []string { + return []string{ + "IN_PROGRESS", + "AVAILABLE", + "UNAVAILABLE", + } +} + +// GetMappingArtifactStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingArtifactStatusEnum(val string) (ArtifactStatusEnum, bool) { + enum, ok := mappingArtifactStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ArtifactLifecycleStateEnum Enum with underlying type: string +type ArtifactLifecycleStateEnum string + +// Set of constants representing the allowable values for ArtifactLifecycleStateEnum +const ( + ArtifactLifecycleStateCreating ArtifactLifecycleStateEnum = "CREATING" + ArtifactLifecycleStateUpdating ArtifactLifecycleStateEnum = "UPDATING" + ArtifactLifecycleStateActive ArtifactLifecycleStateEnum = "ACTIVE" + ArtifactLifecycleStateDeleting ArtifactLifecycleStateEnum = "DELETING" + ArtifactLifecycleStateDeleted ArtifactLifecycleStateEnum = "DELETED" + ArtifactLifecycleStateFailed ArtifactLifecycleStateEnum = "FAILED" +) + +var mappingArtifactLifecycleStateEnum = map[string]ArtifactLifecycleStateEnum{ + "CREATING": ArtifactLifecycleStateCreating, + "UPDATING": ArtifactLifecycleStateUpdating, + "ACTIVE": ArtifactLifecycleStateActive, + "DELETING": ArtifactLifecycleStateDeleting, + "DELETED": ArtifactLifecycleStateDeleted, + "FAILED": ArtifactLifecycleStateFailed, +} + +var mappingArtifactLifecycleStateEnumLowerCase = map[string]ArtifactLifecycleStateEnum{ + "creating": ArtifactLifecycleStateCreating, + "updating": ArtifactLifecycleStateUpdating, + "active": ArtifactLifecycleStateActive, + "deleting": ArtifactLifecycleStateDeleting, + "deleted": ArtifactLifecycleStateDeleted, + "failed": ArtifactLifecycleStateFailed, +} + +// GetArtifactLifecycleStateEnumValues Enumerates the set of values for ArtifactLifecycleStateEnum +func GetArtifactLifecycleStateEnumValues() []ArtifactLifecycleStateEnum { + values := make([]ArtifactLifecycleStateEnum, 0) + for _, v := range mappingArtifactLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetArtifactLifecycleStateEnumStringValues Enumerates the set of values in String for ArtifactLifecycleStateEnum +func GetArtifactLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingArtifactLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingArtifactLifecycleStateEnum(val string) (ArtifactLifecycleStateEnum, bool) { + enum, ok := mappingArtifactLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/artifact_collection.go b/marketplacepublisher/artifact_collection.go new file mode 100644 index 0000000000..7f40c5f398 --- /dev/null +++ b/marketplacepublisher/artifact_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ArtifactCollection Results of the artifact search. Contains the artifact items. +type ArtifactCollection struct { + + // List of artifact summary. + Items []ArtifactSummary `mandatory:"true" json:"items"` +} + +func (m ArtifactCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ArtifactCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/artifact_summary.go b/marketplacepublisher/artifact_summary.go new file mode 100644 index 0000000000..48f7b9856c --- /dev/null +++ b/marketplacepublisher/artifact_summary.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ArtifactSummary The model for the artifact summary. +type ArtifactSummary struct { + + // Unique identifier for the artifact. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The display name for the artifact. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Artifact Type for the artifact. + ArtifactType ArtifactTypeEnumEnum `mandatory:"true" json:"artifactType"` + + // The current state for the Artifact. + LifecycleState ArtifactLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The current status for the Artifact. + Status ArtifactStatusEnum `mandatory:"true" json:"status"` + + // The date and time the artifact was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2023-03-27T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the artifact was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2023-03-27T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // 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 ArtifactSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ArtifactSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingArtifactTypeEnumEnum(string(m.ArtifactType)); !ok && m.ArtifactType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArtifactType: %s. Supported values are: %s.", m.ArtifactType, strings.Join(GetArtifactTypeEnumEnumStringValues(), ","))) + } + if _, ok := GetMappingArtifactLifecycleStateEnum(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(GetArtifactLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingArtifactStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetArtifactStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/artifact_type_enum.go b/marketplacepublisher/artifact_type_enum.go new file mode 100644 index 0000000000..d0cee78f52 --- /dev/null +++ b/marketplacepublisher/artifact_type_enum.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// ArtifactTypeEnumEnum Enum with underlying type: string +type ArtifactTypeEnumEnum string + +// Set of constants representing the allowable values for ArtifactTypeEnumEnum +const ( + ArtifactTypeEnumContainerImage ArtifactTypeEnumEnum = "CONTAINER_IMAGE" + ArtifactTypeEnumHelmChart ArtifactTypeEnumEnum = "HELM_CHART" +) + +var mappingArtifactTypeEnumEnum = map[string]ArtifactTypeEnumEnum{ + "CONTAINER_IMAGE": ArtifactTypeEnumContainerImage, + "HELM_CHART": ArtifactTypeEnumHelmChart, +} + +var mappingArtifactTypeEnumEnumLowerCase = map[string]ArtifactTypeEnumEnum{ + "container_image": ArtifactTypeEnumContainerImage, + "helm_chart": ArtifactTypeEnumHelmChart, +} + +// GetArtifactTypeEnumEnumValues Enumerates the set of values for ArtifactTypeEnumEnum +func GetArtifactTypeEnumEnumValues() []ArtifactTypeEnumEnum { + values := make([]ArtifactTypeEnumEnum, 0) + for _, v := range mappingArtifactTypeEnumEnum { + values = append(values, v) + } + return values +} + +// GetArtifactTypeEnumEnumStringValues Enumerates the set of values in String for ArtifactTypeEnumEnum +func GetArtifactTypeEnumEnumStringValues() []string { + return []string{ + "CONTAINER_IMAGE", + "HELM_CHART", + } +} + +// GetMappingArtifactTypeEnumEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingArtifactTypeEnumEnum(val string) (ArtifactTypeEnumEnum, bool) { + enum, ok := mappingArtifactTypeEnumEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/cancel_work_request_request_response.go b/marketplacepublisher/cancel_work_request_request_response.go new file mode 100644 index 0000000000..4b198ca7a1 --- /dev/null +++ b/marketplacepublisher/cancel_work_request_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelWorkRequestRequest wrapper for the CancelWorkRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequestRequest. +type CancelWorkRequestRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelWorkRequestResponse wrapper for the CancelWorkRequest operation +type CancelWorkRequestResponse 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 CancelWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/cascading_delete_listing_request_response.go b/marketplacepublisher/cascading_delete_listing_request_response.go new file mode 100644 index 0000000000..31fe8450ae --- /dev/null +++ b/marketplacepublisher/cascading_delete_listing_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CascadingDeleteListingRequest wrapper for the CascadingDeleteListing operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CascadingDeleteListing.go.html to see an example of how to use CascadingDeleteListingRequest. +type CascadingDeleteListingRequest struct { + + // listing OCID + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CascadingDeleteListingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CascadingDeleteListingRequest) 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 CascadingDeleteListingRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CascadingDeleteListingRequest) 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 CascadingDeleteListingRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CascadingDeleteListingResponse wrapper for the CascadingDeleteListing operation +type CascadingDeleteListingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CascadingDeleteListingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CascadingDeleteListingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/cascading_delete_listing_revision_request_response.go b/marketplacepublisher/cascading_delete_listing_revision_request_response.go new file mode 100644 index 0000000000..0018b037e5 --- /dev/null +++ b/marketplacepublisher/cascading_delete_listing_revision_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CascadingDeleteListingRevisionRequest wrapper for the CascadingDeleteListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CascadingDeleteListingRevision.go.html to see an example of how to use CascadingDeleteListingRevisionRequest. +type CascadingDeleteListingRevisionRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CascadingDeleteListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CascadingDeleteListingRevisionRequest) 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 CascadingDeleteListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CascadingDeleteListingRevisionRequest) 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 CascadingDeleteListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CascadingDeleteListingRevisionResponse wrapper for the CascadingDeleteListingRevision operation +type CascadingDeleteListingRevisionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CascadingDeleteListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CascadingDeleteListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/category.go b/marketplacepublisher/category.go new file mode 100644 index 0000000000..541657aba6 --- /dev/null +++ b/marketplacepublisher/category.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Category The model for the category details. +type Category struct { + + // The name for the category. + Name *string `mandatory:"true" json:"name"` + + // The code of the category. + Code *string `mandatory:"true" json:"code"` + + // The product that the category belongs to. + ProductCode *string `mandatory:"true" json:"productCode"` + + // The current state for the category. + LifecycleState CategoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the category was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the category was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m Category) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Category) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCategoryLifecycleStateEnum(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(GetCategoryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CategoryLifecycleStateEnum Enum with underlying type: string +type CategoryLifecycleStateEnum string + +// Set of constants representing the allowable values for CategoryLifecycleStateEnum +const ( + CategoryLifecycleStateActive CategoryLifecycleStateEnum = "ACTIVE" + CategoryLifecycleStateInactive CategoryLifecycleStateEnum = "INACTIVE" +) + +var mappingCategoryLifecycleStateEnum = map[string]CategoryLifecycleStateEnum{ + "ACTIVE": CategoryLifecycleStateActive, + "INACTIVE": CategoryLifecycleStateInactive, +} + +var mappingCategoryLifecycleStateEnumLowerCase = map[string]CategoryLifecycleStateEnum{ + "active": CategoryLifecycleStateActive, + "inactive": CategoryLifecycleStateInactive, +} + +// GetCategoryLifecycleStateEnumValues Enumerates the set of values for CategoryLifecycleStateEnum +func GetCategoryLifecycleStateEnumValues() []CategoryLifecycleStateEnum { + values := make([]CategoryLifecycleStateEnum, 0) + for _, v := range mappingCategoryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetCategoryLifecycleStateEnumStringValues Enumerates the set of values in String for CategoryLifecycleStateEnum +func GetCategoryLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + } +} + +// GetMappingCategoryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCategoryLifecycleStateEnum(val string) (CategoryLifecycleStateEnum, bool) { + enum, ok := mappingCategoryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/category_collection.go b/marketplacepublisher/category_collection.go new file mode 100644 index 0000000000..23d2a39097 --- /dev/null +++ b/marketplacepublisher/category_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CategoryCollection Results of a category search. Contains the category items. +type CategoryCollection struct { + + // List of category summary. + Items []CategorySummary `mandatory:"true" json:"items"` +} + +func (m CategoryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CategoryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/category_summary.go b/marketplacepublisher/category_summary.go new file mode 100644 index 0000000000..68e83ea0e2 --- /dev/null +++ b/marketplacepublisher/category_summary.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CategorySummary The model for the category summary. +type CategorySummary struct { + + // The name of the category. + Name *string `mandatory:"true" json:"name"` + + // The code of the category. + Code *string `mandatory:"true" json:"code"` + + // The product that the category belongs. + ProductCode *string `mandatory:"true" json:"productCode"` + + // The current state of the category. + LifecycleState CategoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the category was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the category was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m CategorySummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CategorySummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCategoryLifecycleStateEnum(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(GetCategoryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/change_artifact_compartment_details.go b/marketplacepublisher/change_artifact_compartment_details.go new file mode 100644 index 0000000000..f54b127c0f --- /dev/null +++ b/marketplacepublisher/change_artifact_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeArtifactCompartmentDetails Contains details indicating which compartment the artifact should move to. +type ChangeArtifactCompartmentDetails struct { + + // The unique identifier of the compartment for the artifact. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeArtifactCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeArtifactCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/change_artifact_compartment_request_response.go b/marketplacepublisher/change_artifact_compartment_request_response.go new file mode 100644 index 0000000000..2dd070ba7a --- /dev/null +++ b/marketplacepublisher/change_artifact_compartment_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeArtifactCompartmentRequest wrapper for the ChangeArtifactCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeArtifactCompartment.go.html to see an example of how to use ChangeArtifactCompartmentRequest. +type ChangeArtifactCompartmentRequest struct { + + // artifact OCID + ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` + + // Request to change the compartment of a given artifact. + ChangeArtifactCompartmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeArtifactCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeArtifactCompartmentRequest) 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 ChangeArtifactCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeArtifactCompartmentRequest) 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 ChangeArtifactCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeArtifactCompartmentResponse wrapper for the ChangeArtifactCompartment operation +type ChangeArtifactCompartmentResponse 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 ChangeArtifactCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeArtifactCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/change_listing_compartment_details.go b/marketplacepublisher/change_listing_compartment_details.go new file mode 100644 index 0000000000..a79df01fae --- /dev/null +++ b/marketplacepublisher/change_listing_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeListingCompartmentDetails Contains details indicating which compartment the listing should move to. +type ChangeListingCompartmentDetails struct { + + // The id of the compartment which the listing should be moved. + CompartmentId *string `mandatory:"false" json:"compartmentId"` +} + +func (m ChangeListingCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeListingCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/change_listing_compartment_request_response.go b/marketplacepublisher/change_listing_compartment_request_response.go new file mode 100644 index 0000000000..442bc32ec2 --- /dev/null +++ b/marketplacepublisher/change_listing_compartment_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeListingCompartmentRequest wrapper for the ChangeListingCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeListingCompartment.go.html to see an example of how to use ChangeListingCompartmentRequest. +type ChangeListingCompartmentRequest struct { + + // listing OCID + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // Request to change the compartment of a given listing. + ChangeListingCompartmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeListingCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeListingCompartmentRequest) 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 ChangeListingCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeListingCompartmentRequest) 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 ChangeListingCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeListingCompartmentResponse wrapper for the ChangeListingCompartment operation +type ChangeListingCompartmentResponse 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 ChangeListingCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeListingCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/change_listing_revision_to_new_status_request_response.go b/marketplacepublisher/change_listing_revision_to_new_status_request_response.go new file mode 100644 index 0000000000..e11fc1b1c5 --- /dev/null +++ b/marketplacepublisher/change_listing_revision_to_new_status_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeListingRevisionToNewStatusRequest wrapper for the ChangeListingRevisionToNewStatus operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeListingRevisionToNewStatus.go.html to see an example of how to use ChangeListingRevisionToNewStatusRequest. +type ChangeListingRevisionToNewStatusRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeListingRevisionToNewStatusRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeListingRevisionToNewStatusRequest) 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 ChangeListingRevisionToNewStatusRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeListingRevisionToNewStatusRequest) 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 ChangeListingRevisionToNewStatusRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeListingRevisionToNewStatusResponse wrapper for the ChangeListingRevisionToNewStatus operation +type ChangeListingRevisionToNewStatusResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevision instance + ListingRevision `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 ChangeListingRevisionToNewStatusResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeListingRevisionToNewStatusResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/change_term_compartment_details.go b/marketplacepublisher/change_term_compartment_details.go new file mode 100644 index 0000000000..97061efa49 --- /dev/null +++ b/marketplacepublisher/change_term_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeTermCompartmentDetails Contains details indicating which compartment the term should move to +type ChangeTermCompartmentDetails struct { + + // The id of the compartment which the term should be moved. + CompartmentId *string `mandatory:"false" json:"compartmentId"` +} + +func (m ChangeTermCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeTermCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/change_term_compartment_request_response.go b/marketplacepublisher/change_term_compartment_request_response.go new file mode 100644 index 0000000000..63737facc7 --- /dev/null +++ b/marketplacepublisher/change_term_compartment_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeTermCompartmentRequest wrapper for the ChangeTermCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeTermCompartment.go.html to see an example of how to use ChangeTermCompartmentRequest. +type ChangeTermCompartmentRequest struct { + + // term OCID + TermId *string `mandatory:"true" contributesTo:"path" name:"termId"` + + // Request to change the compartment of a given term. + ChangeTermCompartmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeTermCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeTermCompartmentRequest) 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 ChangeTermCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeTermCompartmentRequest) 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 ChangeTermCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeTermCompartmentResponse wrapper for the ChangeTermCompartment operation +type ChangeTermCompartmentResponse 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 ChangeTermCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeTermCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/clone_listing_revision_request_response.go b/marketplacepublisher/clone_listing_revision_request_response.go new file mode 100644 index 0000000000..23185b965c --- /dev/null +++ b/marketplacepublisher/clone_listing_revision_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CloneListingRevisionRequest wrapper for the CloneListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CloneListingRevision.go.html to see an example of how to use CloneListingRevisionRequest. +type CloneListingRevisionRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CloneListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CloneListingRevisionRequest) 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 CloneListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CloneListingRevisionRequest) 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 CloneListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CloneListingRevisionResponse wrapper for the CloneListingRevision operation +type CloneListingRevisionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CloneListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CloneListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/container_image_artifact.go b/marketplacepublisher/container_image_artifact.go new file mode 100644 index 0000000000..f5b0cbdd09 --- /dev/null +++ b/marketplacepublisher/container_image_artifact.go @@ -0,0 +1,160 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerImageArtifact Container Image artifact details. +type ContainerImageArtifact struct { + + // Unique OCID identifier for the artifact. + Id *string `mandatory:"true" json:"id"` + + // A display name for the artifact. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time the artifact was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier for the publisher. + PublisherId *string `mandatory:"true" json:"publisherId"` + + // The date and time the artifact was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + ContainerImage *ContainerImageDetails `mandatory:"true" json:"containerImage"` + + // Status notes for the Artifact. + StatusNotes *string `mandatory:"false" json:"statusNotes"` + + // 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"` + + // The current status for the Artifact. + Status ArtifactStatusEnum `mandatory:"true" json:"status"` + + // The current state for the Artifact. + LifecycleState ArtifactLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m ContainerImageArtifact) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m ContainerImageArtifact) GetDisplayName() *string { + return m.DisplayName +} + +// GetStatus returns Status +func (m ContainerImageArtifact) GetStatus() ArtifactStatusEnum { + return m.Status +} + +// GetStatusNotes returns StatusNotes +func (m ContainerImageArtifact) GetStatusNotes() *string { + return m.StatusNotes +} + +// GetLifecycleState returns LifecycleState +func (m ContainerImageArtifact) GetLifecycleState() ArtifactLifecycleStateEnum { + return m.LifecycleState +} + +// GetTimeCreated returns TimeCreated +func (m ContainerImageArtifact) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetCompartmentId returns CompartmentId +func (m ContainerImageArtifact) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetPublisherId returns PublisherId +func (m ContainerImageArtifact) GetPublisherId() *string { + return m.PublisherId +} + +// GetTimeUpdated returns TimeUpdated +func (m ContainerImageArtifact) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetFreeformTags returns FreeformTags +func (m ContainerImageArtifact) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m ContainerImageArtifact) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m ContainerImageArtifact) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m ContainerImageArtifact) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerImageArtifact) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArtifactStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetArtifactStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingArtifactLifecycleStateEnum(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(GetArtifactLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ContainerImageArtifact) MarshalJSON() (buff []byte, e error) { + type MarshalTypeContainerImageArtifact ContainerImageArtifact + s := struct { + DiscriminatorParam string `json:"artifactType"` + MarshalTypeContainerImageArtifact + }{ + "CONTAINER_IMAGE", + (MarshalTypeContainerImageArtifact)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/container_image_details.go b/marketplacepublisher/container_image_details.go new file mode 100644 index 0000000000..7e4ee5a49b --- /dev/null +++ b/marketplacepublisher/container_image_details.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerImageDetails Container Image details. +type ContainerImageDetails struct { + + // The source registry url of the container image. + SourceRegistryUrl *string `mandatory:"true" json:"sourceRegistryUrl"` + + // image validation status + ValidationStatus ValidationStatusEnum `mandatory:"true" json:"validationStatus"` + + // image publication status + PublicationStatus PublicationStatusEnum `mandatory:"true" json:"publicationStatus"` + + // The source registry OCID of the container image. + SourceRegistryId *string `mandatory:"false" json:"sourceRegistryId"` + + // image validation failure errors + ValidationError *string `mandatory:"false" json:"validationError"` + + // image publication failure errors + PublicationError *string `mandatory:"false" json:"publicationError"` +} + +func (m ContainerImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingValidationStatusEnum(string(m.ValidationStatus)); !ok && m.ValidationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ValidationStatus: %s. Supported values are: %s.", m.ValidationStatus, strings.Join(GetValidationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingPublicationStatusEnum(string(m.PublicationStatus)); !ok && m.PublicationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PublicationStatus: %s. Supported values are: %s.", m.PublicationStatus, strings.Join(GetPublicationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/container_package.go b/marketplacepublisher/container_package.go new file mode 100644 index 0000000000..0ac2cdd89d --- /dev/null +++ b/marketplacepublisher/container_package.go @@ -0,0 +1,210 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerPackage A package for container image listings. +type ContainerPackage struct { + + // The name of the listing revision package. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The unique identifier for the listing revision. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier for the artifact. + ArtifactId *string `mandatory:"true" json:"artifactId"` + + // The unique identifier for the term. + TermId *string `mandatory:"true" json:"termId"` + + // The version for the package. + PackageVersion *string `mandatory:"true" json:"packageVersion"` + + // Identifies whether security upgrades will be provided for this package. + AreSecurityUpgradesProvided *bool `mandatory:"true" json:"areSecurityUpgradesProvided"` + + // Identifies that this will be default package for the listing revision. + IsDefault *bool `mandatory:"true" json:"isDefault"` + + // The date and time this listing revision package was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time this listing revision package was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The OCID for the listing revision package in Marketplace Publisher. + Id *string `mandatory:"false" json:"id"` + + // The description of this package. + Description *string `mandatory:"false" json:"description"` + + // Additional metadata key/value pairs for the listing revision package summary. + // For example: + // `{"partnerListingRevisionPackageStatus": "Published","parentListingRevisionPackageId": "1" }` + ExtendedMetadata map[string]string `mandatory:"false" json:"extendedMetadata"` + + // 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"` + + // The current state for the listing revision package. + LifecycleState ListingRevisionPackageLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The current status for the listing revision package. + Status ListingRevisionPackageStatusEnum `mandatory:"true" json:"status"` +} + +// GetId returns Id +func (m ContainerPackage) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m ContainerPackage) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m ContainerPackage) GetDescription() *string { + return m.Description +} + +// GetListingRevisionId returns ListingRevisionId +func (m ContainerPackage) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetCompartmentId returns CompartmentId +func (m ContainerPackage) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetArtifactId returns ArtifactId +func (m ContainerPackage) GetArtifactId() *string { + return m.ArtifactId +} + +// GetTermId returns TermId +func (m ContainerPackage) GetTermId() *string { + return m.TermId +} + +// GetPackageVersion returns PackageVersion +func (m ContainerPackage) GetPackageVersion() *string { + return m.PackageVersion +} + +// GetLifecycleState returns LifecycleState +func (m ContainerPackage) GetLifecycleState() ListingRevisionPackageLifecycleStateEnum { + return m.LifecycleState +} + +// GetStatus returns Status +func (m ContainerPackage) GetStatus() ListingRevisionPackageStatusEnum { + return m.Status +} + +// GetAreSecurityUpgradesProvided returns AreSecurityUpgradesProvided +func (m ContainerPackage) GetAreSecurityUpgradesProvided() *bool { + return m.AreSecurityUpgradesProvided +} + +// GetIsDefault returns IsDefault +func (m ContainerPackage) GetIsDefault() *bool { + return m.IsDefault +} + +// GetTimeCreated returns TimeCreated +func (m ContainerPackage) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m ContainerPackage) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetExtendedMetadata returns ExtendedMetadata +func (m ContainerPackage) GetExtendedMetadata() map[string]string { + return m.ExtendedMetadata +} + +// GetFreeformTags returns FreeformTags +func (m ContainerPackage) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m ContainerPackage) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m ContainerPackage) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m ContainerPackage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerPackage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingListingRevisionPackageLifecycleStateEnum(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(GetListingRevisionPackageLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionPackageStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetListingRevisionPackageStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ContainerPackage) MarshalJSON() (buff []byte, e error) { + type MarshalTypeContainerPackage ContainerPackage + s := struct { + DiscriminatorParam string `json:"packageType"` + MarshalTypeContainerPackage + }{ + "CONTAINER_IMAGE", + (MarshalTypeContainerPackage)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/create_artifact_details.go b/marketplacepublisher/create_artifact_details.go new file mode 100644 index 0000000000..13faec77b3 --- /dev/null +++ b/marketplacepublisher/create_artifact_details.go @@ -0,0 +1,123 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateArtifactDetails Common Details to create Marketplace Publisher artifact. +type CreateArtifactDetails interface { + + // The unique identifier for the compartment. + GetCompartmentId() *string + + // The display name for the artifact. + GetDisplayName() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type createartifactdetails struct { + JsonData []byte + DisplayName *string `mandatory:"false" json:"displayName"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + ArtifactType string `json:"artifactType"` +} + +// UnmarshalJSON unmarshals json +func (m *createartifactdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateartifactdetails createartifactdetails + s := struct { + Model Unmarshalercreateartifactdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.DisplayName = s.Model.DisplayName + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.ArtifactType = s.Model.ArtifactType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createartifactdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ArtifactType { + case "HELM_CHART": + mm := CreateKubernetesImageArtifactDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CONTAINER_IMAGE": + mm := CreateContainerImageArtifactDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateArtifactDetails: %s.", m.ArtifactType) + return *m, nil + } +} + +// GetDisplayName returns DisplayName +func (m createartifactdetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetFreeformTags returns FreeformTags +func (m createartifactdetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m createartifactdetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetCompartmentId returns CompartmentId +func (m createartifactdetails) GetCompartmentId() *string { + return m.CompartmentId +} + +func (m createartifactdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createartifactdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_artifact_request_response.go b/marketplacepublisher/create_artifact_request_response.go new file mode 100644 index 0000000000..ac1566421e --- /dev/null +++ b/marketplacepublisher/create_artifact_request_response.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. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateArtifactRequest wrapper for the CreateArtifact operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateArtifact.go.html to see an example of how to use CreateArtifactRequest. +type CreateArtifactRequest struct { + + // Request object for creating a new artifact. + CreateArtifactDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateArtifactRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateArtifactRequest) 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 CreateArtifactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateArtifactRequest) 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 CreateArtifactRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateArtifactResponse wrapper for the CreateArtifact operation +type CreateArtifactResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateArtifactResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateArtifactResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_container_image_artifact_details.go b/marketplacepublisher/create_container_image_artifact_details.go new file mode 100644 index 0000000000..68b2333ba6 --- /dev/null +++ b/marketplacepublisher/create_container_image_artifact_details.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerImageArtifactDetails Details to create a new container image artifact. +type CreateContainerImageArtifactDetails struct { + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + ContainerImage *CreateContainerImageDetails `mandatory:"true" json:"containerImage"` + + // The display name for the artifact. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +// GetCompartmentId returns CompartmentId +func (m CreateContainerImageArtifactDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m CreateContainerImageArtifactDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetFreeformTags returns FreeformTags +func (m CreateContainerImageArtifactDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateContainerImageArtifactDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateContainerImageArtifactDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerImageArtifactDetails) 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 CreateContainerImageArtifactDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateContainerImageArtifactDetails CreateContainerImageArtifactDetails + s := struct { + DiscriminatorParam string `json:"artifactType"` + MarshalTypeCreateContainerImageArtifactDetails + }{ + "CONTAINER_IMAGE", + (MarshalTypeCreateContainerImageArtifactDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/create_container_image_details.go b/marketplacepublisher/create_container_image_details.go new file mode 100644 index 0000000000..4bb021bf66 --- /dev/null +++ b/marketplacepublisher/create_container_image_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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerImageDetails Container image details required to create a container artifact. +type CreateContainerImageDetails struct { + + // The source registry id of the container image. + SourceRegistryId *string `mandatory:"true" json:"sourceRegistryId"` + + // The source registry url of the container image. + SourceRegistryUrl *string `mandatory:"true" json:"sourceRegistryUrl"` +} + +func (m CreateContainerImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_helm_chart_image_details.go b/marketplacepublisher/create_helm_chart_image_details.go new file mode 100644 index 0000000000..4533dbabf7 --- /dev/null +++ b/marketplacepublisher/create_helm_chart_image_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateHelmChartImageDetails Helmchart image details required to create an helmchart artifact. +type CreateHelmChartImageDetails struct { + + // The source registry OCID of the container image. + SourceRegistryId *string `mandatory:"true" json:"sourceRegistryId"` + + // The source registry url of the helmchart image. + SourceRegistryUrl *string `mandatory:"true" json:"sourceRegistryUrl"` + + // The Supported Versions of Kubernetes + SupportedKubernetesVersions []string `mandatory:"false" json:"supportedKubernetesVersions"` +} + +func (m CreateHelmChartImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateHelmChartImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_kubernetes_image_artifact_details.go b/marketplacepublisher/create_kubernetes_image_artifact_details.go new file mode 100644 index 0000000000..0a3dddaa29 --- /dev/null +++ b/marketplacepublisher/create_kubernetes_image_artifact_details.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateKubernetesImageArtifactDetails Details to create a new helm chart image artifact. +type CreateKubernetesImageArtifactDetails struct { + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + HelmChart *CreateHelmChartImageDetails `mandatory:"true" json:"helmChart"` + + // The display name for the artifact. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // List of container image artifact uniquie identifiers included in the helm chart. + ContainerImageArtifactIds []string `mandatory:"false" json:"containerImageArtifactIds"` +} + +// GetCompartmentId returns CompartmentId +func (m CreateKubernetesImageArtifactDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m CreateKubernetesImageArtifactDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetFreeformTags returns FreeformTags +func (m CreateKubernetesImageArtifactDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateKubernetesImageArtifactDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateKubernetesImageArtifactDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateKubernetesImageArtifactDetails) 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 CreateKubernetesImageArtifactDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateKubernetesImageArtifactDetails CreateKubernetesImageArtifactDetails + s := struct { + DiscriminatorParam string `json:"artifactType"` + MarshalTypeCreateKubernetesImageArtifactDetails + }{ + "HELM_CHART", + (MarshalTypeCreateKubernetesImageArtifactDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/create_listing_details.go b/marketplacepublisher/create_listing_details.go new file mode 100644 index 0000000000..01dcc313a0 --- /dev/null +++ b/marketplacepublisher/create_listing_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateListingDetails Details to create a new listing. +type CreateListingDetails struct { + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name for the listing. + Name *string `mandatory:"true" json:"name"` + + // The listing type for the listing. + ListingType ListingTypeEnum `mandatory:"true" json:"listingType"` + + // The package type for the listing. + PackageType PackageTypeEnum `mandatory:"true" json:"packageType"` + + // 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 CreateListingDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateListingDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingTypeEnum(string(m.ListingType)); !ok && m.ListingType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ListingType: %s. Supported values are: %s.", m.ListingType, strings.Join(GetListingTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingPackageTypeEnum(string(m.PackageType)); !ok && m.PackageType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PackageType: %s. Supported values are: %s.", m.PackageType, strings.Join(GetPackageTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_listing_request_response.go b/marketplacepublisher/create_listing_request_response.go new file mode 100644 index 0000000000..a08e687069 --- /dev/null +++ b/marketplacepublisher/create_listing_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateListingRequest wrapper for the CreateListing operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListing.go.html to see an example of how to use CreateListingRequest. +type CreateListingRequest struct { + + // Details for the new Listing. + CreateListingDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateListingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateListingRequest) 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 CreateListingRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateListingRequest) 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 CreateListingRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateListingResponse wrapper for the CreateListing operation +type CreateListingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Listing instance + Listing `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 CreateListingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateListingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_listing_revision_attachment_details.go b/marketplacepublisher/create_listing_revision_attachment_details.go new file mode 100644 index 0000000000..20ba1bfeb2 --- /dev/null +++ b/marketplacepublisher/create_listing_revision_attachment_details.go @@ -0,0 +1,137 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateListingRevisionAttachmentDetails Attachment uploaded by the publisher for the listing revision. +type CreateListingRevisionAttachmentDetails interface { + + // The OCID for the listing revision in Marketplace Publisher. + GetListingRevisionId() *string + + // The name for the listing revision attachment. + GetDisplayName() *string + + // Description for this specified attachment. + GetDescription() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type createlistingrevisionattachmentdetails struct { + JsonData []byte + DisplayName *string `mandatory:"false" json:"displayName"` + Description *string `mandatory:"false" json:"description"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + AttachmentType string `json:"attachmentType"` +} + +// UnmarshalJSON unmarshals json +func (m *createlistingrevisionattachmentdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatelistingrevisionattachmentdetails createlistingrevisionattachmentdetails + s := struct { + Model Unmarshalercreatelistingrevisionattachmentdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ListingRevisionId = s.Model.ListingRevisionId + m.DisplayName = s.Model.DisplayName + m.Description = s.Model.Description + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.AttachmentType = s.Model.AttachmentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createlistingrevisionattachmentdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.AttachmentType { + case "SCREENSHOT": + mm := CreateScreenShotAttachmentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VIDEO": + mm := CreateVideoAttachmentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "RELATED_DOCUMENT": + mm := CreateRelatedDocumentAttachmentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateListingRevisionAttachmentDetails: %s.", m.AttachmentType) + return *m, nil + } +} + +// GetDisplayName returns DisplayName +func (m createlistingrevisionattachmentdetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m createlistingrevisionattachmentdetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m createlistingrevisionattachmentdetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m createlistingrevisionattachmentdetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetListingRevisionId returns ListingRevisionId +func (m createlistingrevisionattachmentdetails) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +func (m createlistingrevisionattachmentdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createlistingrevisionattachmentdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_listing_revision_attachment_request_response.go b/marketplacepublisher/create_listing_revision_attachment_request_response.go new file mode 100644 index 0000000000..fb1e50fe5f --- /dev/null +++ b/marketplacepublisher/create_listing_revision_attachment_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateListingRevisionAttachmentRequest wrapper for the CreateListingRevisionAttachment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevisionAttachment.go.html to see an example of how to use CreateListingRevisionAttachmentRequest. +type CreateListingRevisionAttachmentRequest struct { + + // Details for the new Listing Revision Attachment. + CreateListingRevisionAttachmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateListingRevisionAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateListingRevisionAttachmentRequest) 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 CreateListingRevisionAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateListingRevisionAttachmentRequest) 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 CreateListingRevisionAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateListingRevisionAttachmentResponse wrapper for the CreateListingRevisionAttachment operation +type CreateListingRevisionAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionAttachment instance + ListingRevisionAttachment `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateListingRevisionAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateListingRevisionAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_listing_revision_details.go b/marketplacepublisher/create_listing_revision_details.go new file mode 100644 index 0000000000..f6f5585027 --- /dev/null +++ b/marketplacepublisher/create_listing_revision_details.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateListingRevisionDetails The model for an Oracle Cloud Infrastructure Marketplace Publisher listing revision. +type CreateListingRevisionDetails struct { + + // The unique identifier for the listing this revision belongs to. + ListingId *string `mandatory:"true" json:"listingId"` + + // Single line introduction for the listing revision. + Headline *string `mandatory:"true" json:"headline"` + + // The categories for the listing revision. + Categories []string `mandatory:"true" json:"categories"` + + // The pricing model for the listing revision. + PricingType ListingRevisionPricingTypeEnum `mandatory:"true" json:"pricingType"` + + // The name for the listing revision. + DisplayName *string `mandatory:"false" json:"displayName"` + + VersionDetails *VersionDetails `mandatory:"false" json:"versionDetails"` + + // The tagline for the listing revision. + Tagline *string `mandatory:"false" json:"tagline"` + + // Keywords associated with the listing revision. + Keywords *string `mandatory:"false" json:"keywords"` + + // A short description for the listing revision. + ShortDescription *string `mandatory:"false" json:"shortDescription"` + + // Usage information for the listing revision. + UsageInformation *string `mandatory:"false" json:"usageInformation"` + + // A long description for the listing revision. + LongDescription *string `mandatory:"false" json:"longDescription"` + + // System requirements for the listing revision. + SystemRequirements *string `mandatory:"false" json:"systemRequirements"` + + // The markets supported by the listing revision. + Markets []string `mandatory:"false" json:"markets"` + + ContentLanguage *LanguageItem `mandatory:"false" json:"contentLanguage"` + + // Languages supported by the publisher for the listing revision. + Supportedlanguages []LanguageItem `mandatory:"false" json:"supportedlanguages"` + + // Contact information to use to get support from the publisher for the listing revision. + SupportContacts []SupportContact `mandatory:"false" json:"supportContacts"` + + // Links to support resources for the listing revision. + SupportLinks []NamedLink `mandatory:"false" json:"supportLinks"` + + // The current status of the Listing revision. + Status ListingRevisionStatusEnum `mandatory:"false" json:"status,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"` +} + +func (m CreateListingRevisionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateListingRevisionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionPricingTypeEnum(string(m.PricingType)); !ok && m.PricingType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PricingType: %s. Supported values are: %s.", m.PricingType, strings.Join(GetListingRevisionPricingTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingListingRevisionStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetListingRevisionStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_listing_revision_note_details.go b/marketplacepublisher/create_listing_revision_note_details.go new file mode 100644 index 0000000000..ca54350843 --- /dev/null +++ b/marketplacepublisher/create_listing_revision_note_details.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateListingRevisionNoteDetails The model for an Oracle Cloud Infrastructure Marketplace Publisher listing revision note. +type CreateListingRevisionNoteDetails struct { + + // The unique identifier of the listing revision that the specified note belongs to. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // Notes provided for the listing revision. + NoteDetails *string `mandatory:"true" json:"noteDetails"` + + // 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 CreateListingRevisionNoteDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateListingRevisionNoteDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_listing_revision_note_request_response.go b/marketplacepublisher/create_listing_revision_note_request_response.go new file mode 100644 index 0000000000..2b3ebf16b3 --- /dev/null +++ b/marketplacepublisher/create_listing_revision_note_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateListingRevisionNoteRequest wrapper for the CreateListingRevisionNote operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevisionNote.go.html to see an example of how to use CreateListingRevisionNoteRequest. +type CreateListingRevisionNoteRequest struct { + + // Details for the new Listing Revision Note. + CreateListingRevisionNoteDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateListingRevisionNoteRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateListingRevisionNoteRequest) 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 CreateListingRevisionNoteRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateListingRevisionNoteRequest) 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 CreateListingRevisionNoteRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateListingRevisionNoteResponse wrapper for the CreateListingRevisionNote operation +type CreateListingRevisionNoteResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionNote instance + ListingRevisionNote `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateListingRevisionNoteResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateListingRevisionNoteResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_listing_revision_package_details.go b/marketplacepublisher/create_listing_revision_package_details.go new file mode 100644 index 0000000000..b0742fd4e9 --- /dev/null +++ b/marketplacepublisher/create_listing_revision_package_details.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateListingRevisionPackageDetails The model for an Oracle Cloud Infrastructure Marketplace Publisher listing revision package. +type CreateListingRevisionPackageDetails struct { + + // The OCID for the listing revision in Marketplace Publisher. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The version for the package. + PackageVersion *string `mandatory:"true" json:"packageVersion"` + + // The unique identifier for the artifact. + ArtifactId *string `mandatory:"true" json:"artifactId"` + + // The unique identifier for the term. + TermId *string `mandatory:"true" json:"termId"` + + // Identifies whether security upgrades will be provided for this package. + AreSecurityUpgradesProvided *bool `mandatory:"true" json:"areSecurityUpgradesProvided"` + + // The name for the listing revision package. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description for this package. + Description *string `mandatory:"false" json:"description"` + + // Identifies that this will be default package for the listing revision. + IsDefault *bool `mandatory:"false" json:"isDefault"` + + // 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 CreateListingRevisionPackageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateListingRevisionPackageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_listing_revision_package_request_response.go b/marketplacepublisher/create_listing_revision_package_request_response.go new file mode 100644 index 0000000000..267941d286 --- /dev/null +++ b/marketplacepublisher/create_listing_revision_package_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateListingRevisionPackageRequest wrapper for the CreateListingRevisionPackage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevisionPackage.go.html to see an example of how to use CreateListingRevisionPackageRequest. +type CreateListingRevisionPackageRequest struct { + + // Details for the new Listing Revision Package. + CreateListingRevisionPackageDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateListingRevisionPackageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateListingRevisionPackageRequest) 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 CreateListingRevisionPackageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateListingRevisionPackageRequest) 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 CreateListingRevisionPackageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateListingRevisionPackageResponse wrapper for the CreateListingRevisionPackage operation +type CreateListingRevisionPackageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionPackage instance + ListingRevisionPackage `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateListingRevisionPackageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateListingRevisionPackageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_listing_revision_request_response.go b/marketplacepublisher/create_listing_revision_request_response.go new file mode 100644 index 0000000000..718168ead5 --- /dev/null +++ b/marketplacepublisher/create_listing_revision_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateListingRevisionRequest wrapper for the CreateListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevision.go.html to see an example of how to use CreateListingRevisionRequest. +type CreateListingRevisionRequest struct { + + // Details for the new Listing Revision. + CreateListingRevisionDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateListingRevisionRequest) 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 CreateListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateListingRevisionRequest) 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 CreateListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateListingRevisionResponse wrapper for the CreateListingRevision operation +type CreateListingRevisionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevision instance + ListingRevision `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 CreateListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_related_document_attachment_details.go b/marketplacepublisher/create_related_document_attachment_details.go new file mode 100644 index 0000000000..cd47cd303a --- /dev/null +++ b/marketplacepublisher/create_related_document_attachment_details.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateRelatedDocumentAttachmentDetails Create Details of the related document attachment. +type CreateRelatedDocumentAttachmentDetails struct { + + // The OCID for the listing revision in Marketplace Publisher. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The name for the listing revision attachment. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description for this specified attachment. + 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"` + + // The document category of the listing revision attachment. + DocumentCategory RelatedDocumentAttachmentDocumentCategoryEnum `mandatory:"true" json:"documentCategory"` +} + +// GetListingRevisionId returns ListingRevisionId +func (m CreateRelatedDocumentAttachmentDetails) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetDisplayName returns DisplayName +func (m CreateRelatedDocumentAttachmentDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m CreateRelatedDocumentAttachmentDetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m CreateRelatedDocumentAttachmentDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateRelatedDocumentAttachmentDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateRelatedDocumentAttachmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateRelatedDocumentAttachmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingRelatedDocumentAttachmentDocumentCategoryEnum(string(m.DocumentCategory)); !ok && m.DocumentCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DocumentCategory: %s. Supported values are: %s.", m.DocumentCategory, strings.Join(GetRelatedDocumentAttachmentDocumentCategoryEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateRelatedDocumentAttachmentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateRelatedDocumentAttachmentDetails CreateRelatedDocumentAttachmentDetails + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeCreateRelatedDocumentAttachmentDetails + }{ + "RELATED_DOCUMENT", + (MarshalTypeCreateRelatedDocumentAttachmentDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/create_screen_shot_attachment_details.go b/marketplacepublisher/create_screen_shot_attachment_details.go new file mode 100644 index 0000000000..769fb2f7a6 --- /dev/null +++ b/marketplacepublisher/create_screen_shot_attachment_details.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateScreenShotAttachmentDetails Create Details of the screenshot attachment. +type CreateScreenShotAttachmentDetails struct { + + // The OCID for the listing revision in Marketplace Publisher. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The name for the listing revision attachment. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description for this specified attachment. + 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"` +} + +// GetListingRevisionId returns ListingRevisionId +func (m CreateScreenShotAttachmentDetails) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetDisplayName returns DisplayName +func (m CreateScreenShotAttachmentDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m CreateScreenShotAttachmentDetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m CreateScreenShotAttachmentDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateScreenShotAttachmentDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateScreenShotAttachmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateScreenShotAttachmentDetails) 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 CreateScreenShotAttachmentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateScreenShotAttachmentDetails CreateScreenShotAttachmentDetails + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeCreateScreenShotAttachmentDetails + }{ + "SCREENSHOT", + (MarshalTypeCreateScreenShotAttachmentDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/create_term_details.go b/marketplacepublisher/create_term_details.go new file mode 100644 index 0000000000..8ca4cadc2f --- /dev/null +++ b/marketplacepublisher/create_term_details.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateTermDetails Details to create Marketplace Publisher term. +type CreateTermDetails struct { + + // The OCID of the publisher's compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the term. + Name *string `mandatory:"true" json:"name"` + + // 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 CreateTermDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateTermDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/create_term_request_response.go b/marketplacepublisher/create_term_request_response.go new file mode 100644 index 0000000000..ecf6df35a1 --- /dev/null +++ b/marketplacepublisher/create_term_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateTermRequest wrapper for the CreateTerm operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateTerm.go.html to see an example of how to use CreateTermRequest. +type CreateTermRequest struct { + + // Details for the new Term. + CreateTermDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateTermRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateTermRequest) 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 CreateTermRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateTermRequest) 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 CreateTermRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateTermResponse wrapper for the CreateTerm operation +type CreateTermResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Term instance + Term `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 CreateTermResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateTermResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_term_version_request_response.go b/marketplacepublisher/create_term_version_request_response.go new file mode 100644 index 0000000000..31dab02f22 --- /dev/null +++ b/marketplacepublisher/create_term_version_request_response.go @@ -0,0 +1,109 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// CreateTermVersionRequest wrapper for the CreateTermVersion operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateTermVersion.go.html to see an example of how to use CreateTermVersionRequest. +type CreateTermVersionRequest struct { + + // The term version file to upload. + CreateTermVersionContent io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // Unique OCID identifier for the term. + TermId *string `mandatory:"true" contributesTo:"header" name:"term-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The name of the resource. + DisplayName *string `mandatory:"false" contributesTo:"header" name:"display-name"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateTermVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateTermVersionRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateTermVersionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.CreateTermVersionContent) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateTermVersionRequest) 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 CreateTermVersionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateTermVersionResponse wrapper for the CreateTermVersion operation +type CreateTermVersionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TermVersion instance + TermVersion `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 CreateTermVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateTermVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/create_video_attachment_details.go b/marketplacepublisher/create_video_attachment_details.go new file mode 100644 index 0000000000..a99f19576d --- /dev/null +++ b/marketplacepublisher/create_video_attachment_details.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateVideoAttachmentDetails Create Details of the video attachment. +type CreateVideoAttachmentDetails struct { + + // The OCID for the listing revision in Marketplace Publisher. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + VideoAttachmentDetails *CreateVideoDetails `mandatory:"true" json:"videoAttachmentDetails"` + + // The name for the listing revision attachment. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description for this specified attachment. + 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"` +} + +// GetListingRevisionId returns ListingRevisionId +func (m CreateVideoAttachmentDetails) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetDisplayName returns DisplayName +func (m CreateVideoAttachmentDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m CreateVideoAttachmentDetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m CreateVideoAttachmentDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateVideoAttachmentDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateVideoAttachmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateVideoAttachmentDetails) 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 CreateVideoAttachmentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateVideoAttachmentDetails CreateVideoAttachmentDetails + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeCreateVideoAttachmentDetails + }{ + "VIDEO", + (MarshalTypeCreateVideoAttachmentDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/create_video_details.go b/marketplacepublisher/create_video_details.go new file mode 100644 index 0000000000..420754b4e0 --- /dev/null +++ b/marketplacepublisher/create_video_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateVideoDetails A link to a video on the internet. +type CreateVideoDetails struct { + + // The URL of the video. + ContentUrl *string `mandatory:"true" json:"contentUrl"` +} + +func (m CreateVideoDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateVideoDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/delete_artifact_request_response.go b/marketplacepublisher/delete_artifact_request_response.go new file mode 100644 index 0000000000..b4daffb187 --- /dev/null +++ b/marketplacepublisher/delete_artifact_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteArtifactRequest wrapper for the DeleteArtifact operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteArtifact.go.html to see an example of how to use DeleteArtifactRequest. +type DeleteArtifactRequest struct { + + // artifact OCID + ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteArtifactRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteArtifactRequest) 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 DeleteArtifactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteArtifactRequest) 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 DeleteArtifactRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteArtifactResponse wrapper for the DeleteArtifact operation +type DeleteArtifactResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteArtifactResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteArtifactResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/delete_listing_request_response.go b/marketplacepublisher/delete_listing_request_response.go new file mode 100644 index 0000000000..cc8c17fd66 --- /dev/null +++ b/marketplacepublisher/delete_listing_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteListingRequest wrapper for the DeleteListing operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListing.go.html to see an example of how to use DeleteListingRequest. +type DeleteListingRequest struct { + + // listing OCID + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteListingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteListingRequest) 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 DeleteListingRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteListingRequest) 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 DeleteListingRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteListingResponse wrapper for the DeleteListing operation +type DeleteListingResponse 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 DeleteListingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteListingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/delete_listing_revision_attachment_request_response.go b/marketplacepublisher/delete_listing_revision_attachment_request_response.go new file mode 100644 index 0000000000..bef1413346 --- /dev/null +++ b/marketplacepublisher/delete_listing_revision_attachment_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteListingRevisionAttachmentRequest wrapper for the DeleteListingRevisionAttachment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevisionAttachment.go.html to see an example of how to use DeleteListingRevisionAttachmentRequest. +type DeleteListingRevisionAttachmentRequest struct { + + // attachment OCID + ListingRevisionAttachmentId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionAttachmentId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteListingRevisionAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteListingRevisionAttachmentRequest) 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 DeleteListingRevisionAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteListingRevisionAttachmentRequest) 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 DeleteListingRevisionAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteListingRevisionAttachmentResponse wrapper for the DeleteListingRevisionAttachment operation +type DeleteListingRevisionAttachmentResponse 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 DeleteListingRevisionAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteListingRevisionAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/delete_listing_revision_note_request_response.go b/marketplacepublisher/delete_listing_revision_note_request_response.go new file mode 100644 index 0000000000..cf370fdb0b --- /dev/null +++ b/marketplacepublisher/delete_listing_revision_note_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteListingRevisionNoteRequest wrapper for the DeleteListingRevisionNote operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevisionNote.go.html to see an example of how to use DeleteListingRevisionNoteRequest. +type DeleteListingRevisionNoteRequest struct { + + // Unique listing revision note identifier. + ListingRevisionNoteId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionNoteId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteListingRevisionNoteRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteListingRevisionNoteRequest) 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 DeleteListingRevisionNoteRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteListingRevisionNoteRequest) 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 DeleteListingRevisionNoteRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteListingRevisionNoteResponse wrapper for the DeleteListingRevisionNote operation +type DeleteListingRevisionNoteResponse 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 DeleteListingRevisionNoteResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteListingRevisionNoteResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/delete_listing_revision_package_request_response.go b/marketplacepublisher/delete_listing_revision_package_request_response.go new file mode 100644 index 0000000000..9ab2724839 --- /dev/null +++ b/marketplacepublisher/delete_listing_revision_package_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteListingRevisionPackageRequest wrapper for the DeleteListingRevisionPackage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevisionPackage.go.html to see an example of how to use DeleteListingRevisionPackageRequest. +type DeleteListingRevisionPackageRequest struct { + + // Unique listing revision package identifier. + ListingRevisionPackageId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionPackageId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteListingRevisionPackageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteListingRevisionPackageRequest) 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 DeleteListingRevisionPackageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteListingRevisionPackageRequest) 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 DeleteListingRevisionPackageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteListingRevisionPackageResponse wrapper for the DeleteListingRevisionPackage operation +type DeleteListingRevisionPackageResponse 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 DeleteListingRevisionPackageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteListingRevisionPackageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/delete_listing_revision_request_response.go b/marketplacepublisher/delete_listing_revision_request_response.go new file mode 100644 index 0000000000..10e474eaa3 --- /dev/null +++ b/marketplacepublisher/delete_listing_revision_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteListingRevisionRequest wrapper for the DeleteListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevision.go.html to see an example of how to use DeleteListingRevisionRequest. +type DeleteListingRevisionRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteListingRevisionRequest) 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 DeleteListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteListingRevisionRequest) 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 DeleteListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteListingRevisionResponse wrapper for the DeleteListingRevision operation +type DeleteListingRevisionResponse 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 DeleteListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/delete_term_request_response.go b/marketplacepublisher/delete_term_request_response.go new file mode 100644 index 0000000000..fbd0b7695e --- /dev/null +++ b/marketplacepublisher/delete_term_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteTermRequest wrapper for the DeleteTerm operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteTerm.go.html to see an example of how to use DeleteTermRequest. +type DeleteTermRequest struct { + + // term OCID + TermId *string `mandatory:"true" contributesTo:"path" name:"termId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteTermRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteTermRequest) 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 DeleteTermRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteTermRequest) 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 DeleteTermRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteTermResponse wrapper for the DeleteTerm operation +type DeleteTermResponse 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 DeleteTermResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteTermResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/delete_term_version_request_response.go b/marketplacepublisher/delete_term_version_request_response.go new file mode 100644 index 0000000000..9979e6c026 --- /dev/null +++ b/marketplacepublisher/delete_term_version_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteTermVersionRequest wrapper for the DeleteTermVersion operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteTermVersion.go.html to see an example of how to use DeleteTermVersionRequest. +type DeleteTermVersionRequest struct { + + // term version OCID + TermVersionId *string `mandatory:"true" contributesTo:"path" name:"termVersionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteTermVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteTermVersionRequest) 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 DeleteTermVersionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteTermVersionRequest) 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 DeleteTermVersionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteTermVersionResponse wrapper for the DeleteTermVersion operation +type DeleteTermVersionResponse 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 DeleteTermVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteTermVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_artifact_request_response.go b/marketplacepublisher/get_artifact_request_response.go new file mode 100644 index 0000000000..c16502bba9 --- /dev/null +++ b/marketplacepublisher/get_artifact_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetArtifactRequest wrapper for the GetArtifact operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetArtifact.go.html to see an example of how to use GetArtifactRequest. +type GetArtifactRequest struct { + + // artifact OCID + ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetArtifactRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetArtifactRequest) 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 GetArtifactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetArtifactRequest) 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 GetArtifactRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetArtifactResponse wrapper for the GetArtifact operation +type GetArtifactResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Artifact instance + Artifact `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 GetArtifactResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetArtifactResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_category_request_response.go b/marketplacepublisher/get_category_request_response.go new file mode 100644 index 0000000000..c2862b6f57 --- /dev/null +++ b/marketplacepublisher/get_category_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCategoryRequest wrapper for the GetCategory operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetCategory.go.html to see an example of how to use GetCategoryRequest. +type GetCategoryRequest struct { + + // Category Code + CategoryCode *string `mandatory:"true" contributesTo:"path" name:"categoryCode"` + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetCategoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCategoryRequest) 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 GetCategoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCategoryRequest) 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 GetCategoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCategoryResponse wrapper for the GetCategory operation +type GetCategoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Category instance + Category `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 GetCategoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCategoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_listing_request_response.go b/marketplacepublisher/get_listing_request_response.go new file mode 100644 index 0000000000..e0e1e35a9e --- /dev/null +++ b/marketplacepublisher/get_listing_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetListingRequest wrapper for the GetListing operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListing.go.html to see an example of how to use GetListingRequest. +type GetListingRequest struct { + + // listing OCID + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetListingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetListingRequest) 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 GetListingRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetListingRequest) 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 GetListingRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetListingResponse wrapper for the GetListing operation +type GetListingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Listing instance + Listing `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 GetListingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetListingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_listing_revision_attachment_request_response.go b/marketplacepublisher/get_listing_revision_attachment_request_response.go new file mode 100644 index 0000000000..4465a6c195 --- /dev/null +++ b/marketplacepublisher/get_listing_revision_attachment_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetListingRevisionAttachmentRequest wrapper for the GetListingRevisionAttachment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevisionAttachment.go.html to see an example of how to use GetListingRevisionAttachmentRequest. +type GetListingRevisionAttachmentRequest struct { + + // attachment OCID + ListingRevisionAttachmentId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionAttachmentId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetListingRevisionAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetListingRevisionAttachmentRequest) 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 GetListingRevisionAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetListingRevisionAttachmentRequest) 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 GetListingRevisionAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetListingRevisionAttachmentResponse wrapper for the GetListingRevisionAttachment operation +type GetListingRevisionAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionAttachment instance + ListingRevisionAttachment `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetListingRevisionAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetListingRevisionAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_listing_revision_note_request_response.go b/marketplacepublisher/get_listing_revision_note_request_response.go new file mode 100644 index 0000000000..73060be866 --- /dev/null +++ b/marketplacepublisher/get_listing_revision_note_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetListingRevisionNoteRequest wrapper for the GetListingRevisionNote operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevisionNote.go.html to see an example of how to use GetListingRevisionNoteRequest. +type GetListingRevisionNoteRequest struct { + + // Unique listing revision note identifier. + ListingRevisionNoteId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionNoteId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetListingRevisionNoteRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetListingRevisionNoteRequest) 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 GetListingRevisionNoteRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetListingRevisionNoteRequest) 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 GetListingRevisionNoteRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetListingRevisionNoteResponse wrapper for the GetListingRevisionNote operation +type GetListingRevisionNoteResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionNote instance + ListingRevisionNote `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetListingRevisionNoteResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetListingRevisionNoteResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_listing_revision_package_request_response.go b/marketplacepublisher/get_listing_revision_package_request_response.go new file mode 100644 index 0000000000..c63d1c7f1b --- /dev/null +++ b/marketplacepublisher/get_listing_revision_package_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetListingRevisionPackageRequest wrapper for the GetListingRevisionPackage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevisionPackage.go.html to see an example of how to use GetListingRevisionPackageRequest. +type GetListingRevisionPackageRequest struct { + + // Unique listing revision package identifier. + ListingRevisionPackageId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionPackageId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetListingRevisionPackageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetListingRevisionPackageRequest) 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 GetListingRevisionPackageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetListingRevisionPackageRequest) 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 GetListingRevisionPackageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetListingRevisionPackageResponse wrapper for the GetListingRevisionPackage operation +type GetListingRevisionPackageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionPackage instance + ListingRevisionPackage `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetListingRevisionPackageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetListingRevisionPackageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_listing_revision_request_response.go b/marketplacepublisher/get_listing_revision_request_response.go new file mode 100644 index 0000000000..11d0efcbde --- /dev/null +++ b/marketplacepublisher/get_listing_revision_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetListingRevisionRequest wrapper for the GetListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevision.go.html to see an example of how to use GetListingRevisionRequest. +type GetListingRevisionRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetListingRevisionRequest) 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 GetListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetListingRevisionRequest) 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 GetListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetListingRevisionResponse wrapper for the GetListingRevision operation +type GetListingRevisionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevision instance + ListingRevision `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 GetListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_market_request_response.go b/marketplacepublisher/get_market_request_response.go new file mode 100644 index 0000000000..942939683f --- /dev/null +++ b/marketplacepublisher/get_market_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetMarketRequest wrapper for the GetMarket operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetMarket.go.html to see an example of how to use GetMarketRequest. +type GetMarketRequest struct { + + // Market Code + MarketCode *string `mandatory:"true" contributesTo:"path" name:"marketCode"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetMarketRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetMarketRequest) 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 GetMarketRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMarketRequest) 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 GetMarketRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetMarketResponse wrapper for the GetMarket operation +type GetMarketResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Market instance + Market `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 GetMarketResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetMarketResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_product_request_response.go b/marketplacepublisher/get_product_request_response.go new file mode 100644 index 0000000000..06c3fc2c6c --- /dev/null +++ b/marketplacepublisher/get_product_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetProductRequest wrapper for the GetProduct operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetProduct.go.html to see an example of how to use GetProductRequest. +type GetProductRequest struct { + + // Product Code + ProductCode *string `mandatory:"true" contributesTo:"path" name:"productCode"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetProductRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetProductRequest) 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 GetProductRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetProductRequest) 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 GetProductRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetProductResponse wrapper for the GetProduct operation +type GetProductResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Product instance + Product `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 GetProductResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetProductResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_publisher_request_response.go b/marketplacepublisher/get_publisher_request_response.go new file mode 100644 index 0000000000..2a9eb75156 --- /dev/null +++ b/marketplacepublisher/get_publisher_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetPublisherRequest wrapper for the GetPublisher operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetPublisher.go.html to see an example of how to use GetPublisherRequest. +type GetPublisherRequest struct { + + // Publisher OCID + PublisherId *string `mandatory:"true" contributesTo:"path" name:"publisherId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetPublisherRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPublisherRequest) 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 GetPublisherRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPublisherRequest) 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 GetPublisherRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetPublisherResponse wrapper for the GetPublisher operation +type GetPublisherResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Publisher instance + Publisher `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 GetPublisherResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPublisherResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_term_request_response.go b/marketplacepublisher/get_term_request_response.go new file mode 100644 index 0000000000..83fc50a3fd --- /dev/null +++ b/marketplacepublisher/get_term_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetTermRequest wrapper for the GetTerm operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetTerm.go.html to see an example of how to use GetTermRequest. +type GetTermRequest struct { + + // term OCID + TermId *string `mandatory:"true" contributesTo:"path" name:"termId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetTermRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetTermRequest) 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 GetTermRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTermRequest) 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 GetTermRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetTermResponse wrapper for the GetTerm operation +type GetTermResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Term instance + Term `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 GetTermResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetTermResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_term_version_request_response.go b/marketplacepublisher/get_term_version_request_response.go new file mode 100644 index 0000000000..a6823d242e --- /dev/null +++ b/marketplacepublisher/get_term_version_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetTermVersionRequest wrapper for the GetTermVersion operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetTermVersion.go.html to see an example of how to use GetTermVersionRequest. +type GetTermVersionRequest struct { + + // term version OCID + TermVersionId *string `mandatory:"true" contributesTo:"path" name:"termVersionId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetTermVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetTermVersionRequest) 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 GetTermVersionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTermVersionRequest) 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 GetTermVersionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetTermVersionResponse wrapper for the GetTermVersion operation +type GetTermVersionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TermVersion instance + TermVersion `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 GetTermVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetTermVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/get_work_request_request_response.go b/marketplacepublisher/get_work_request_request_response.go new file mode 100644 index 0000000000..1d743be048 --- /dev/null +++ b/marketplacepublisher/get_work_request_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/helm_chart_image_details.go b/marketplacepublisher/helm_chart_image_details.go new file mode 100644 index 0000000000..db576829ee --- /dev/null +++ b/marketplacepublisher/helm_chart_image_details.go @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HelmChartImageDetails Helmchart image details. +type HelmChartImageDetails struct { + + // source registry url of the helmchart image. + SourceRegistryUrl *string `mandatory:"true" json:"sourceRegistryUrl"` + + // image validation status. + ValidationStatus ValidationStatusEnum `mandatory:"true" json:"validationStatus"` + + // image publication status + PublicationStatus PublicationStatusEnum `mandatory:"true" json:"publicationStatus"` + + // The source registry OCID of the helmchart image. + SourceRegistryId *string `mandatory:"false" json:"sourceRegistryId"` + + // The supported versions of Kubernetes + SupportedKubernetesVersions []string `mandatory:"false" json:"supportedKubernetesVersions"` + + // image validation failure errors + ValidationError *string `mandatory:"false" json:"validationError"` + + // image validation failure errors + PublicationError *string `mandatory:"false" json:"publicationError"` +} + +func (m HelmChartImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HelmChartImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingValidationStatusEnum(string(m.ValidationStatus)); !ok && m.ValidationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ValidationStatus: %s. Supported values are: %s.", m.ValidationStatus, strings.Join(GetValidationStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingPublicationStatusEnum(string(m.PublicationStatus)); !ok && m.PublicationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PublicationStatus: %s. Supported values are: %s.", m.PublicationStatus, strings.Join(GetPublicationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/helm_chart_package.go b/marketplacepublisher/helm_chart_package.go new file mode 100644 index 0000000000..e2f2438d4f --- /dev/null +++ b/marketplacepublisher/helm_chart_package.go @@ -0,0 +1,210 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HelmChartPackage A package for container image listings. +type HelmChartPackage struct { + + // The name of the listing revision package. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The unique identifier for the listing revision. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier for the artifact. + ArtifactId *string `mandatory:"true" json:"artifactId"` + + // The unique identifier for the term. + TermId *string `mandatory:"true" json:"termId"` + + // The version for the package. + PackageVersion *string `mandatory:"true" json:"packageVersion"` + + // Identifies whether security upgrades will be provided for this package. + AreSecurityUpgradesProvided *bool `mandatory:"true" json:"areSecurityUpgradesProvided"` + + // Identifies that this will be default package for the listing revision. + IsDefault *bool `mandatory:"true" json:"isDefault"` + + // The date and time this listing revision package was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time this listing revision package was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The OCID for the listing revision package in Marketplace Publisher. + Id *string `mandatory:"false" json:"id"` + + // The description of this package. + Description *string `mandatory:"false" json:"description"` + + // Additional metadata key/value pairs for the listing revision package summary. + // For example: + // `{"partnerListingRevisionPackageStatus": "Published","parentListingRevisionPackageId": "1" }` + ExtendedMetadata map[string]string `mandatory:"false" json:"extendedMetadata"` + + // 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"` + + // The current state for the listing revision package. + LifecycleState ListingRevisionPackageLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The current status for the listing revision package. + Status ListingRevisionPackageStatusEnum `mandatory:"true" json:"status"` +} + +// GetId returns Id +func (m HelmChartPackage) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m HelmChartPackage) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m HelmChartPackage) GetDescription() *string { + return m.Description +} + +// GetListingRevisionId returns ListingRevisionId +func (m HelmChartPackage) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetCompartmentId returns CompartmentId +func (m HelmChartPackage) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetArtifactId returns ArtifactId +func (m HelmChartPackage) GetArtifactId() *string { + return m.ArtifactId +} + +// GetTermId returns TermId +func (m HelmChartPackage) GetTermId() *string { + return m.TermId +} + +// GetPackageVersion returns PackageVersion +func (m HelmChartPackage) GetPackageVersion() *string { + return m.PackageVersion +} + +// GetLifecycleState returns LifecycleState +func (m HelmChartPackage) GetLifecycleState() ListingRevisionPackageLifecycleStateEnum { + return m.LifecycleState +} + +// GetStatus returns Status +func (m HelmChartPackage) GetStatus() ListingRevisionPackageStatusEnum { + return m.Status +} + +// GetAreSecurityUpgradesProvided returns AreSecurityUpgradesProvided +func (m HelmChartPackage) GetAreSecurityUpgradesProvided() *bool { + return m.AreSecurityUpgradesProvided +} + +// GetIsDefault returns IsDefault +func (m HelmChartPackage) GetIsDefault() *bool { + return m.IsDefault +} + +// GetTimeCreated returns TimeCreated +func (m HelmChartPackage) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m HelmChartPackage) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetExtendedMetadata returns ExtendedMetadata +func (m HelmChartPackage) GetExtendedMetadata() map[string]string { + return m.ExtendedMetadata +} + +// GetFreeformTags returns FreeformTags +func (m HelmChartPackage) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m HelmChartPackage) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m HelmChartPackage) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m HelmChartPackage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HelmChartPackage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingListingRevisionPackageLifecycleStateEnum(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(GetListingRevisionPackageLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionPackageStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetListingRevisionPackageStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m HelmChartPackage) MarshalJSON() (buff []byte, e error) { + type MarshalTypeHelmChartPackage HelmChartPackage + s := struct { + DiscriminatorParam string `json:"packageType"` + MarshalTypeHelmChartPackage + }{ + "HELM_CHART", + (MarshalTypeHelmChartPackage)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/kubernetes_image_artifact.go b/marketplacepublisher/kubernetes_image_artifact.go new file mode 100644 index 0000000000..a2f918dc2b --- /dev/null +++ b/marketplacepublisher/kubernetes_image_artifact.go @@ -0,0 +1,163 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// KubernetesImageArtifact Kubernetes HelmChart Image artifact details. +type KubernetesImageArtifact struct { + + // Unique OCID identifier for the artifact. + Id *string `mandatory:"true" json:"id"` + + // A display name for the artifact. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time the artifact was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier for the publisher. + PublisherId *string `mandatory:"true" json:"publisherId"` + + // The date and time the artifact was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + HelmChart *HelmChartImageDetails `mandatory:"true" json:"helmChart"` + + // Status notes for the Artifact. + StatusNotes *string `mandatory:"false" json:"statusNotes"` + + // 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"` + + // List of container image artifact unique identifiers included in the helm chart. + ContainerImageArtifactIds []string `mandatory:"false" json:"containerImageArtifactIds"` + + // The current status for the Artifact. + Status ArtifactStatusEnum `mandatory:"true" json:"status"` + + // The current state for the Artifact. + LifecycleState ArtifactLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m KubernetesImageArtifact) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m KubernetesImageArtifact) GetDisplayName() *string { + return m.DisplayName +} + +// GetStatus returns Status +func (m KubernetesImageArtifact) GetStatus() ArtifactStatusEnum { + return m.Status +} + +// GetStatusNotes returns StatusNotes +func (m KubernetesImageArtifact) GetStatusNotes() *string { + return m.StatusNotes +} + +// GetLifecycleState returns LifecycleState +func (m KubernetesImageArtifact) GetLifecycleState() ArtifactLifecycleStateEnum { + return m.LifecycleState +} + +// GetTimeCreated returns TimeCreated +func (m KubernetesImageArtifact) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetCompartmentId returns CompartmentId +func (m KubernetesImageArtifact) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetPublisherId returns PublisherId +func (m KubernetesImageArtifact) GetPublisherId() *string { + return m.PublisherId +} + +// GetTimeUpdated returns TimeUpdated +func (m KubernetesImageArtifact) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetFreeformTags returns FreeformTags +func (m KubernetesImageArtifact) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m KubernetesImageArtifact) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m KubernetesImageArtifact) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m KubernetesImageArtifact) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m KubernetesImageArtifact) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingArtifactStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetArtifactStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingArtifactLifecycleStateEnum(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(GetArtifactLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m KubernetesImageArtifact) MarshalJSON() (buff []byte, e error) { + type MarshalTypeKubernetesImageArtifact KubernetesImageArtifact + s := struct { + DiscriminatorParam string `json:"artifactType"` + MarshalTypeKubernetesImageArtifact + }{ + "HELM_CHART", + (MarshalTypeKubernetesImageArtifact)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/language_item.go b/marketplacepublisher/language_item.go new file mode 100644 index 0000000000..2deebd6c81 --- /dev/null +++ b/marketplacepublisher/language_item.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LanguageItem The model for a language item within an array of filter values. +type LanguageItem struct { + + // The name of the item. + Name *string `mandatory:"true" json:"name"` + + // A code assigned to the item. + Code *string `mandatory:"true" json:"code"` +} + +func (m LanguageItem) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LanguageItem) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/list_artifacts_request_response.go b/marketplacepublisher/list_artifacts_request_response.go new file mode 100644 index 0000000000..42ae7a6194 --- /dev/null +++ b/marketplacepublisher/list_artifacts_request_response.go @@ -0,0 +1,212 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListArtifactsRequest wrapper for the ListArtifacts operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListArtifacts.go.html to see an example of how to use ListArtifactsRequest. +type ListArtifactsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only artifacts with their lifecycleState matches the given lifecycleState. + LifecycleState ArtifactLifecycleStateEnum `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 artifacts with specific status. + Status ArtifactStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListArtifactsSortOrderEnum `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 ListArtifactsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListArtifactsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListArtifactsRequest) 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 ListArtifactsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListArtifactsRequest) 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 ListArtifactsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingArtifactLifecycleStateEnum(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(GetArtifactLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingArtifactStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetArtifactStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListArtifactsSortOrderEnum(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(GetListArtifactsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListArtifactsSortByEnum(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(GetListArtifactsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListArtifactsResponse wrapper for the ListArtifacts operation +type ListArtifactsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ArtifactCollection instances + ArtifactCollection `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 ListArtifactsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListArtifactsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListArtifactsSortOrderEnum Enum with underlying type: string +type ListArtifactsSortOrderEnum string + +// Set of constants representing the allowable values for ListArtifactsSortOrderEnum +const ( + ListArtifactsSortOrderAsc ListArtifactsSortOrderEnum = "ASC" + ListArtifactsSortOrderDesc ListArtifactsSortOrderEnum = "DESC" +) + +var mappingListArtifactsSortOrderEnum = map[string]ListArtifactsSortOrderEnum{ + "ASC": ListArtifactsSortOrderAsc, + "DESC": ListArtifactsSortOrderDesc, +} + +var mappingListArtifactsSortOrderEnumLowerCase = map[string]ListArtifactsSortOrderEnum{ + "asc": ListArtifactsSortOrderAsc, + "desc": ListArtifactsSortOrderDesc, +} + +// GetListArtifactsSortOrderEnumValues Enumerates the set of values for ListArtifactsSortOrderEnum +func GetListArtifactsSortOrderEnumValues() []ListArtifactsSortOrderEnum { + values := make([]ListArtifactsSortOrderEnum, 0) + for _, v := range mappingListArtifactsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListArtifactsSortOrderEnumStringValues Enumerates the set of values in String for ListArtifactsSortOrderEnum +func GetListArtifactsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListArtifactsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListArtifactsSortOrderEnum(val string) (ListArtifactsSortOrderEnum, bool) { + enum, ok := mappingListArtifactsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListArtifactsSortByEnum Enum with underlying type: string +type ListArtifactsSortByEnum string + +// Set of constants representing the allowable values for ListArtifactsSortByEnum +const ( + ListArtifactsSortByTimecreated ListArtifactsSortByEnum = "timeCreated" + ListArtifactsSortByDisplayname ListArtifactsSortByEnum = "displayName" +) + +var mappingListArtifactsSortByEnum = map[string]ListArtifactsSortByEnum{ + "timeCreated": ListArtifactsSortByTimecreated, + "displayName": ListArtifactsSortByDisplayname, +} + +var mappingListArtifactsSortByEnumLowerCase = map[string]ListArtifactsSortByEnum{ + "timecreated": ListArtifactsSortByTimecreated, + "displayname": ListArtifactsSortByDisplayname, +} + +// GetListArtifactsSortByEnumValues Enumerates the set of values for ListArtifactsSortByEnum +func GetListArtifactsSortByEnumValues() []ListArtifactsSortByEnum { + values := make([]ListArtifactsSortByEnum, 0) + for _, v := range mappingListArtifactsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListArtifactsSortByEnumStringValues Enumerates the set of values in String for ListArtifactsSortByEnum +func GetListArtifactsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListArtifactsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListArtifactsSortByEnum(val string) (ListArtifactsSortByEnum, bool) { + enum, ok := mappingListArtifactsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_categories_request_response.go b/marketplacepublisher/list_categories_request_response.go new file mode 100644 index 0000000000..68828e76ff --- /dev/null +++ b/marketplacepublisher/list_categories_request_response.go @@ -0,0 +1,203 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCategoriesRequest wrapper for the ListCategories operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListCategories.go.html to see an example of how to use ListCategoriesRequest. +type ListCategoriesRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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"` + + // product code to filter + ProductCode *string `mandatory:"false" contributesTo:"query" name:"productCode"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListCategoriesSortOrderEnum `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 ListCategoriesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire name given. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCategoriesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCategoriesRequest) 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 ListCategoriesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCategoriesRequest) 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 ListCategoriesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCategoriesSortOrderEnum(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(GetListCategoriesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListCategoriesSortByEnum(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(GetListCategoriesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCategoriesResponse wrapper for the ListCategories operation +type ListCategoriesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CategoryCollection instances + CategoryCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListCategoriesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCategoriesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCategoriesSortOrderEnum Enum with underlying type: string +type ListCategoriesSortOrderEnum string + +// Set of constants representing the allowable values for ListCategoriesSortOrderEnum +const ( + ListCategoriesSortOrderAsc ListCategoriesSortOrderEnum = "ASC" + ListCategoriesSortOrderDesc ListCategoriesSortOrderEnum = "DESC" +) + +var mappingListCategoriesSortOrderEnum = map[string]ListCategoriesSortOrderEnum{ + "ASC": ListCategoriesSortOrderAsc, + "DESC": ListCategoriesSortOrderDesc, +} + +var mappingListCategoriesSortOrderEnumLowerCase = map[string]ListCategoriesSortOrderEnum{ + "asc": ListCategoriesSortOrderAsc, + "desc": ListCategoriesSortOrderDesc, +} + +// GetListCategoriesSortOrderEnumValues Enumerates the set of values for ListCategoriesSortOrderEnum +func GetListCategoriesSortOrderEnumValues() []ListCategoriesSortOrderEnum { + values := make([]ListCategoriesSortOrderEnum, 0) + for _, v := range mappingListCategoriesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCategoriesSortOrderEnumStringValues Enumerates the set of values in String for ListCategoriesSortOrderEnum +func GetListCategoriesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCategoriesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCategoriesSortOrderEnum(val string) (ListCategoriesSortOrderEnum, bool) { + enum, ok := mappingListCategoriesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCategoriesSortByEnum Enum with underlying type: string +type ListCategoriesSortByEnum string + +// Set of constants representing the allowable values for ListCategoriesSortByEnum +const ( + ListCategoriesSortByTimecreated ListCategoriesSortByEnum = "timeCreated" + ListCategoriesSortByDisplayname ListCategoriesSortByEnum = "displayName" +) + +var mappingListCategoriesSortByEnum = map[string]ListCategoriesSortByEnum{ + "timeCreated": ListCategoriesSortByTimecreated, + "displayName": ListCategoriesSortByDisplayname, +} + +var mappingListCategoriesSortByEnumLowerCase = map[string]ListCategoriesSortByEnum{ + "timecreated": ListCategoriesSortByTimecreated, + "displayname": ListCategoriesSortByDisplayname, +} + +// GetListCategoriesSortByEnumValues Enumerates the set of values for ListCategoriesSortByEnum +func GetListCategoriesSortByEnumValues() []ListCategoriesSortByEnum { + values := make([]ListCategoriesSortByEnum, 0) + for _, v := range mappingListCategoriesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCategoriesSortByEnumStringValues Enumerates the set of values in String for ListCategoriesSortByEnum +func GetListCategoriesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListCategoriesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCategoriesSortByEnum(val string) (ListCategoriesSortByEnum, bool) { + enum, ok := mappingListCategoriesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_listing_revision_attachments_request_response.go b/marketplacepublisher/list_listing_revision_attachments_request_response.go new file mode 100644 index 0000000000..56ca92b71a --- /dev/null +++ b/marketplacepublisher/list_listing_revision_attachments_request_response.go @@ -0,0 +1,209 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListListingRevisionAttachmentsRequest wrapper for the ListListingRevisionAttachments operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisionAttachments.go.html to see an example of how to use ListListingRevisionAttachmentsRequest. +type ListListingRevisionAttachmentsRequest struct { + + // OCID of the listing revision. + ListingRevisionId *string `mandatory:"true" contributesTo:"query" name:"listingRevisionId"` + + // 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 attachments their lifecycleState matches the given lifecycleState. + LifecycleState ListingRevisionAttachmentLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // 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 ListListingRevisionAttachmentsSortOrderEnum `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 ListListingRevisionAttachmentsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListListingRevisionAttachmentsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListListingRevisionAttachmentsRequest) 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 ListListingRevisionAttachmentsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListListingRevisionAttachmentsRequest) 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 ListListingRevisionAttachmentsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionAttachmentLifecycleStateEnum(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(GetListingRevisionAttachmentLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingRevisionAttachmentsSortOrderEnum(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(GetListListingRevisionAttachmentsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingRevisionAttachmentsSortByEnum(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(GetListListingRevisionAttachmentsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListListingRevisionAttachmentsResponse wrapper for the ListListingRevisionAttachments operation +type ListListingRevisionAttachmentsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ListingRevisionAttachmentCollection instances + ListingRevisionAttachmentCollection `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 ListListingRevisionAttachmentsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListListingRevisionAttachmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListListingRevisionAttachmentsSortOrderEnum Enum with underlying type: string +type ListListingRevisionAttachmentsSortOrderEnum string + +// Set of constants representing the allowable values for ListListingRevisionAttachmentsSortOrderEnum +const ( + ListListingRevisionAttachmentsSortOrderAsc ListListingRevisionAttachmentsSortOrderEnum = "ASC" + ListListingRevisionAttachmentsSortOrderDesc ListListingRevisionAttachmentsSortOrderEnum = "DESC" +) + +var mappingListListingRevisionAttachmentsSortOrderEnum = map[string]ListListingRevisionAttachmentsSortOrderEnum{ + "ASC": ListListingRevisionAttachmentsSortOrderAsc, + "DESC": ListListingRevisionAttachmentsSortOrderDesc, +} + +var mappingListListingRevisionAttachmentsSortOrderEnumLowerCase = map[string]ListListingRevisionAttachmentsSortOrderEnum{ + "asc": ListListingRevisionAttachmentsSortOrderAsc, + "desc": ListListingRevisionAttachmentsSortOrderDesc, +} + +// GetListListingRevisionAttachmentsSortOrderEnumValues Enumerates the set of values for ListListingRevisionAttachmentsSortOrderEnum +func GetListListingRevisionAttachmentsSortOrderEnumValues() []ListListingRevisionAttachmentsSortOrderEnum { + values := make([]ListListingRevisionAttachmentsSortOrderEnum, 0) + for _, v := range mappingListListingRevisionAttachmentsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionAttachmentsSortOrderEnumStringValues Enumerates the set of values in String for ListListingRevisionAttachmentsSortOrderEnum +func GetListListingRevisionAttachmentsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListListingRevisionAttachmentsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionAttachmentsSortOrderEnum(val string) (ListListingRevisionAttachmentsSortOrderEnum, bool) { + enum, ok := mappingListListingRevisionAttachmentsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListListingRevisionAttachmentsSortByEnum Enum with underlying type: string +type ListListingRevisionAttachmentsSortByEnum string + +// Set of constants representing the allowable values for ListListingRevisionAttachmentsSortByEnum +const ( + ListListingRevisionAttachmentsSortByTimecreated ListListingRevisionAttachmentsSortByEnum = "timeCreated" + ListListingRevisionAttachmentsSortByDisplayname ListListingRevisionAttachmentsSortByEnum = "displayName" +) + +var mappingListListingRevisionAttachmentsSortByEnum = map[string]ListListingRevisionAttachmentsSortByEnum{ + "timeCreated": ListListingRevisionAttachmentsSortByTimecreated, + "displayName": ListListingRevisionAttachmentsSortByDisplayname, +} + +var mappingListListingRevisionAttachmentsSortByEnumLowerCase = map[string]ListListingRevisionAttachmentsSortByEnum{ + "timecreated": ListListingRevisionAttachmentsSortByTimecreated, + "displayname": ListListingRevisionAttachmentsSortByDisplayname, +} + +// GetListListingRevisionAttachmentsSortByEnumValues Enumerates the set of values for ListListingRevisionAttachmentsSortByEnum +func GetListListingRevisionAttachmentsSortByEnumValues() []ListListingRevisionAttachmentsSortByEnum { + values := make([]ListListingRevisionAttachmentsSortByEnum, 0) + for _, v := range mappingListListingRevisionAttachmentsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionAttachmentsSortByEnumStringValues Enumerates the set of values in String for ListListingRevisionAttachmentsSortByEnum +func GetListListingRevisionAttachmentsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListListingRevisionAttachmentsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionAttachmentsSortByEnum(val string) (ListListingRevisionAttachmentsSortByEnum, bool) { + enum, ok := mappingListListingRevisionAttachmentsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_listing_revision_notes_request_response.go b/marketplacepublisher/list_listing_revision_notes_request_response.go new file mode 100644 index 0000000000..893ee0b27b --- /dev/null +++ b/marketplacepublisher/list_listing_revision_notes_request_response.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListListingRevisionNotesRequest wrapper for the ListListingRevisionNotes operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisionNotes.go.html to see an example of how to use ListListingRevisionNotesRequest. +type ListListingRevisionNotesRequest struct { + + // OCID of the listing revision. + ListingRevisionId *string `mandatory:"true" contributesTo:"query" name:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // 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 ListListingRevisionNotesSortOrderEnum `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 ListListingRevisionNotesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListListingRevisionNotesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListListingRevisionNotesRequest) 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 ListListingRevisionNotesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListListingRevisionNotesRequest) 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 ListListingRevisionNotesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListListingRevisionNotesSortOrderEnum(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(GetListListingRevisionNotesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingRevisionNotesSortByEnum(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(GetListListingRevisionNotesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListListingRevisionNotesResponse wrapper for the ListListingRevisionNotes operation +type ListListingRevisionNotesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ListingRevisionNoteCollection instances + ListingRevisionNoteCollection `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 ListListingRevisionNotesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListListingRevisionNotesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListListingRevisionNotesSortOrderEnum Enum with underlying type: string +type ListListingRevisionNotesSortOrderEnum string + +// Set of constants representing the allowable values for ListListingRevisionNotesSortOrderEnum +const ( + ListListingRevisionNotesSortOrderAsc ListListingRevisionNotesSortOrderEnum = "ASC" + ListListingRevisionNotesSortOrderDesc ListListingRevisionNotesSortOrderEnum = "DESC" +) + +var mappingListListingRevisionNotesSortOrderEnum = map[string]ListListingRevisionNotesSortOrderEnum{ + "ASC": ListListingRevisionNotesSortOrderAsc, + "DESC": ListListingRevisionNotesSortOrderDesc, +} + +var mappingListListingRevisionNotesSortOrderEnumLowerCase = map[string]ListListingRevisionNotesSortOrderEnum{ + "asc": ListListingRevisionNotesSortOrderAsc, + "desc": ListListingRevisionNotesSortOrderDesc, +} + +// GetListListingRevisionNotesSortOrderEnumValues Enumerates the set of values for ListListingRevisionNotesSortOrderEnum +func GetListListingRevisionNotesSortOrderEnumValues() []ListListingRevisionNotesSortOrderEnum { + values := make([]ListListingRevisionNotesSortOrderEnum, 0) + for _, v := range mappingListListingRevisionNotesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionNotesSortOrderEnumStringValues Enumerates the set of values in String for ListListingRevisionNotesSortOrderEnum +func GetListListingRevisionNotesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListListingRevisionNotesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionNotesSortOrderEnum(val string) (ListListingRevisionNotesSortOrderEnum, bool) { + enum, ok := mappingListListingRevisionNotesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListListingRevisionNotesSortByEnum Enum with underlying type: string +type ListListingRevisionNotesSortByEnum string + +// Set of constants representing the allowable values for ListListingRevisionNotesSortByEnum +const ( + ListListingRevisionNotesSortByTimecreated ListListingRevisionNotesSortByEnum = "timeCreated" + ListListingRevisionNotesSortByDisplayname ListListingRevisionNotesSortByEnum = "displayName" +) + +var mappingListListingRevisionNotesSortByEnum = map[string]ListListingRevisionNotesSortByEnum{ + "timeCreated": ListListingRevisionNotesSortByTimecreated, + "displayName": ListListingRevisionNotesSortByDisplayname, +} + +var mappingListListingRevisionNotesSortByEnumLowerCase = map[string]ListListingRevisionNotesSortByEnum{ + "timecreated": ListListingRevisionNotesSortByTimecreated, + "displayname": ListListingRevisionNotesSortByDisplayname, +} + +// GetListListingRevisionNotesSortByEnumValues Enumerates the set of values for ListListingRevisionNotesSortByEnum +func GetListListingRevisionNotesSortByEnumValues() []ListListingRevisionNotesSortByEnum { + values := make([]ListListingRevisionNotesSortByEnum, 0) + for _, v := range mappingListListingRevisionNotesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionNotesSortByEnumStringValues Enumerates the set of values in String for ListListingRevisionNotesSortByEnum +func GetListListingRevisionNotesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListListingRevisionNotesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionNotesSortByEnum(val string) (ListListingRevisionNotesSortByEnum, bool) { + enum, ok := mappingListListingRevisionNotesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_listing_revision_packages_request_response.go b/marketplacepublisher/list_listing_revision_packages_request_response.go new file mode 100644 index 0000000000..a394a0c90d --- /dev/null +++ b/marketplacepublisher/list_listing_revision_packages_request_response.go @@ -0,0 +1,209 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListListingRevisionPackagesRequest wrapper for the ListListingRevisionPackages operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisionPackages.go.html to see an example of how to use ListListingRevisionPackagesRequest. +type ListListingRevisionPackagesRequest struct { + + // OCID of the listing revision. + ListingRevisionId *string `mandatory:"true" contributesTo:"query" name:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // 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 packages their lifecycleState matches the given lifecycleState. + LifecycleState ListingRevisionPackageLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListListingRevisionPackagesSortOrderEnum `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 ListListingRevisionPackagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListListingRevisionPackagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListListingRevisionPackagesRequest) 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 ListListingRevisionPackagesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListListingRevisionPackagesRequest) 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 ListListingRevisionPackagesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionPackageLifecycleStateEnum(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(GetListingRevisionPackageLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingRevisionPackagesSortOrderEnum(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(GetListListingRevisionPackagesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingRevisionPackagesSortByEnum(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(GetListListingRevisionPackagesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListListingRevisionPackagesResponse wrapper for the ListListingRevisionPackages operation +type ListListingRevisionPackagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ListingRevisionPackageCollection instances + ListingRevisionPackageCollection `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 ListListingRevisionPackagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListListingRevisionPackagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListListingRevisionPackagesSortOrderEnum Enum with underlying type: string +type ListListingRevisionPackagesSortOrderEnum string + +// Set of constants representing the allowable values for ListListingRevisionPackagesSortOrderEnum +const ( + ListListingRevisionPackagesSortOrderAsc ListListingRevisionPackagesSortOrderEnum = "ASC" + ListListingRevisionPackagesSortOrderDesc ListListingRevisionPackagesSortOrderEnum = "DESC" +) + +var mappingListListingRevisionPackagesSortOrderEnum = map[string]ListListingRevisionPackagesSortOrderEnum{ + "ASC": ListListingRevisionPackagesSortOrderAsc, + "DESC": ListListingRevisionPackagesSortOrderDesc, +} + +var mappingListListingRevisionPackagesSortOrderEnumLowerCase = map[string]ListListingRevisionPackagesSortOrderEnum{ + "asc": ListListingRevisionPackagesSortOrderAsc, + "desc": ListListingRevisionPackagesSortOrderDesc, +} + +// GetListListingRevisionPackagesSortOrderEnumValues Enumerates the set of values for ListListingRevisionPackagesSortOrderEnum +func GetListListingRevisionPackagesSortOrderEnumValues() []ListListingRevisionPackagesSortOrderEnum { + values := make([]ListListingRevisionPackagesSortOrderEnum, 0) + for _, v := range mappingListListingRevisionPackagesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionPackagesSortOrderEnumStringValues Enumerates the set of values in String for ListListingRevisionPackagesSortOrderEnum +func GetListListingRevisionPackagesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListListingRevisionPackagesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionPackagesSortOrderEnum(val string) (ListListingRevisionPackagesSortOrderEnum, bool) { + enum, ok := mappingListListingRevisionPackagesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListListingRevisionPackagesSortByEnum Enum with underlying type: string +type ListListingRevisionPackagesSortByEnum string + +// Set of constants representing the allowable values for ListListingRevisionPackagesSortByEnum +const ( + ListListingRevisionPackagesSortByTimecreated ListListingRevisionPackagesSortByEnum = "timeCreated" + ListListingRevisionPackagesSortByDisplayname ListListingRevisionPackagesSortByEnum = "displayName" +) + +var mappingListListingRevisionPackagesSortByEnum = map[string]ListListingRevisionPackagesSortByEnum{ + "timeCreated": ListListingRevisionPackagesSortByTimecreated, + "displayName": ListListingRevisionPackagesSortByDisplayname, +} + +var mappingListListingRevisionPackagesSortByEnumLowerCase = map[string]ListListingRevisionPackagesSortByEnum{ + "timecreated": ListListingRevisionPackagesSortByTimecreated, + "displayname": ListListingRevisionPackagesSortByDisplayname, +} + +// GetListListingRevisionPackagesSortByEnumValues Enumerates the set of values for ListListingRevisionPackagesSortByEnum +func GetListListingRevisionPackagesSortByEnumValues() []ListListingRevisionPackagesSortByEnum { + values := make([]ListListingRevisionPackagesSortByEnum, 0) + for _, v := range mappingListListingRevisionPackagesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionPackagesSortByEnumStringValues Enumerates the set of values in String for ListListingRevisionPackagesSortByEnum +func GetListListingRevisionPackagesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListListingRevisionPackagesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionPackagesSortByEnum(val string) (ListListingRevisionPackagesSortByEnum, bool) { + enum, ok := mappingListListingRevisionPackagesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_listing_revisions_request_response.go b/marketplacepublisher/list_listing_revisions_request_response.go new file mode 100644 index 0000000000..f87567ff91 --- /dev/null +++ b/marketplacepublisher/list_listing_revisions_request_response.go @@ -0,0 +1,215 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListListingRevisionsRequest wrapper for the ListListingRevisions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisions.go.html to see an example of how to use ListListingRevisionsRequest. +type ListListingRevisionsRequest struct { + + // listing OCID + ListingId *string `mandatory:"true" contributesTo:"query" name:"listingId"` + + // 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 listing revisions their lifecycleState matches the given lifecycleState. + LifecycleState ListingRevisionLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return only listing revisions their status matches the given listing revision status. + ListingRevisionStatus ListingRevisionStatusEnum `mandatory:"false" contributesTo:"query" name:"listingRevisionStatus" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListListingRevisionsSortOrderEnum `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 ListListingRevisionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListListingRevisionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListListingRevisionsRequest) 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 ListListingRevisionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListListingRevisionsRequest) 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 ListListingRevisionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionLifecycleStateEnum(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(GetListingRevisionLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionStatusEnum(string(request.ListingRevisionStatus)); !ok && request.ListingRevisionStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ListingRevisionStatus: %s. Supported values are: %s.", request.ListingRevisionStatus, strings.Join(GetListingRevisionStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingRevisionsSortOrderEnum(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(GetListListingRevisionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingRevisionsSortByEnum(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(GetListListingRevisionsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListListingRevisionsResponse wrapper for the ListListingRevisions operation +type ListListingRevisionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ListingRevisionCollection instances + ListingRevisionCollection `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 ListListingRevisionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListListingRevisionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListListingRevisionsSortOrderEnum Enum with underlying type: string +type ListListingRevisionsSortOrderEnum string + +// Set of constants representing the allowable values for ListListingRevisionsSortOrderEnum +const ( + ListListingRevisionsSortOrderAsc ListListingRevisionsSortOrderEnum = "ASC" + ListListingRevisionsSortOrderDesc ListListingRevisionsSortOrderEnum = "DESC" +) + +var mappingListListingRevisionsSortOrderEnum = map[string]ListListingRevisionsSortOrderEnum{ + "ASC": ListListingRevisionsSortOrderAsc, + "DESC": ListListingRevisionsSortOrderDesc, +} + +var mappingListListingRevisionsSortOrderEnumLowerCase = map[string]ListListingRevisionsSortOrderEnum{ + "asc": ListListingRevisionsSortOrderAsc, + "desc": ListListingRevisionsSortOrderDesc, +} + +// GetListListingRevisionsSortOrderEnumValues Enumerates the set of values for ListListingRevisionsSortOrderEnum +func GetListListingRevisionsSortOrderEnumValues() []ListListingRevisionsSortOrderEnum { + values := make([]ListListingRevisionsSortOrderEnum, 0) + for _, v := range mappingListListingRevisionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionsSortOrderEnumStringValues Enumerates the set of values in String for ListListingRevisionsSortOrderEnum +func GetListListingRevisionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListListingRevisionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionsSortOrderEnum(val string) (ListListingRevisionsSortOrderEnum, bool) { + enum, ok := mappingListListingRevisionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListListingRevisionsSortByEnum Enum with underlying type: string +type ListListingRevisionsSortByEnum string + +// Set of constants representing the allowable values for ListListingRevisionsSortByEnum +const ( + ListListingRevisionsSortByTimecreated ListListingRevisionsSortByEnum = "timeCreated" + ListListingRevisionsSortByDisplayname ListListingRevisionsSortByEnum = "displayName" +) + +var mappingListListingRevisionsSortByEnum = map[string]ListListingRevisionsSortByEnum{ + "timeCreated": ListListingRevisionsSortByTimecreated, + "displayName": ListListingRevisionsSortByDisplayname, +} + +var mappingListListingRevisionsSortByEnumLowerCase = map[string]ListListingRevisionsSortByEnum{ + "timecreated": ListListingRevisionsSortByTimecreated, + "displayname": ListListingRevisionsSortByDisplayname, +} + +// GetListListingRevisionsSortByEnumValues Enumerates the set of values for ListListingRevisionsSortByEnum +func GetListListingRevisionsSortByEnumValues() []ListListingRevisionsSortByEnum { + values := make([]ListListingRevisionsSortByEnum, 0) + for _, v := range mappingListListingRevisionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListListingRevisionsSortByEnumStringValues Enumerates the set of values in String for ListListingRevisionsSortByEnum +func GetListListingRevisionsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListListingRevisionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingRevisionsSortByEnum(val string) (ListListingRevisionsSortByEnum, bool) { + enum, ok := mappingListListingRevisionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_listings_request_response.go b/marketplacepublisher/list_listings_request_response.go new file mode 100644 index 0000000000..69a4a10d3a --- /dev/null +++ b/marketplacepublisher/list_listings_request_response.go @@ -0,0 +1,206 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListListingsRequest wrapper for the ListListings operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListings.go.html to see an example of how to use ListListingsRequest. +type ListListingsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only listings their lifecycleState matches the given lifecycleState. + LifecycleState ListingLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire name given. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // 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 ListListingsSortOrderEnum `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 ListListingsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListListingsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListListingsRequest) 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 ListListingsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListListingsRequest) 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 ListListingsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingLifecycleStateEnum(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(GetListingLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingsSortOrderEnum(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(GetListListingsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListListingsSortByEnum(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(GetListListingsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListListingsResponse wrapper for the ListListings operation +type ListListingsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ListingCollection instances + ListingCollection `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 ListListingsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListListingsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListListingsSortOrderEnum Enum with underlying type: string +type ListListingsSortOrderEnum string + +// Set of constants representing the allowable values for ListListingsSortOrderEnum +const ( + ListListingsSortOrderAsc ListListingsSortOrderEnum = "ASC" + ListListingsSortOrderDesc ListListingsSortOrderEnum = "DESC" +) + +var mappingListListingsSortOrderEnum = map[string]ListListingsSortOrderEnum{ + "ASC": ListListingsSortOrderAsc, + "DESC": ListListingsSortOrderDesc, +} + +var mappingListListingsSortOrderEnumLowerCase = map[string]ListListingsSortOrderEnum{ + "asc": ListListingsSortOrderAsc, + "desc": ListListingsSortOrderDesc, +} + +// GetListListingsSortOrderEnumValues Enumerates the set of values for ListListingsSortOrderEnum +func GetListListingsSortOrderEnumValues() []ListListingsSortOrderEnum { + values := make([]ListListingsSortOrderEnum, 0) + for _, v := range mappingListListingsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListListingsSortOrderEnumStringValues Enumerates the set of values in String for ListListingsSortOrderEnum +func GetListListingsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListListingsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingsSortOrderEnum(val string) (ListListingsSortOrderEnum, bool) { + enum, ok := mappingListListingsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListListingsSortByEnum Enum with underlying type: string +type ListListingsSortByEnum string + +// Set of constants representing the allowable values for ListListingsSortByEnum +const ( + ListListingsSortByTimecreated ListListingsSortByEnum = "timeCreated" + ListListingsSortByDisplayname ListListingsSortByEnum = "displayName" +) + +var mappingListListingsSortByEnum = map[string]ListListingsSortByEnum{ + "timeCreated": ListListingsSortByTimecreated, + "displayName": ListListingsSortByDisplayname, +} + +var mappingListListingsSortByEnumLowerCase = map[string]ListListingsSortByEnum{ + "timecreated": ListListingsSortByTimecreated, + "displayname": ListListingsSortByDisplayname, +} + +// GetListListingsSortByEnumValues Enumerates the set of values for ListListingsSortByEnum +func GetListListingsSortByEnumValues() []ListListingsSortByEnum { + values := make([]ListListingsSortByEnum, 0) + for _, v := range mappingListListingsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListListingsSortByEnumStringValues Enumerates the set of values in String for ListListingsSortByEnum +func GetListListingsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListListingsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListListingsSortByEnum(val string) (ListListingsSortByEnum, bool) { + enum, ok := mappingListListingsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_markets_request_response.go b/marketplacepublisher/list_markets_request_response.go new file mode 100644 index 0000000000..f3db887611 --- /dev/null +++ b/marketplacepublisher/list_markets_request_response.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListMarketsRequest wrapper for the ListMarkets operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListMarkets.go.html to see an example of how to use ListMarketsRequest. +type ListMarketsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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 ListMarketsSortOrderEnum `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 ListMarketsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire name given. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListMarketsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListMarketsRequest) 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 ListMarketsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMarketsRequest) 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 ListMarketsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListMarketsSortOrderEnum(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(GetListMarketsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListMarketsSortByEnum(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(GetListMarketsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListMarketsResponse wrapper for the ListMarkets operation +type ListMarketsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of MarketCollection instances + MarketCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListMarketsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListMarketsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListMarketsSortOrderEnum Enum with underlying type: string +type ListMarketsSortOrderEnum string + +// Set of constants representing the allowable values for ListMarketsSortOrderEnum +const ( + ListMarketsSortOrderAsc ListMarketsSortOrderEnum = "ASC" + ListMarketsSortOrderDesc ListMarketsSortOrderEnum = "DESC" +) + +var mappingListMarketsSortOrderEnum = map[string]ListMarketsSortOrderEnum{ + "ASC": ListMarketsSortOrderAsc, + "DESC": ListMarketsSortOrderDesc, +} + +var mappingListMarketsSortOrderEnumLowerCase = map[string]ListMarketsSortOrderEnum{ + "asc": ListMarketsSortOrderAsc, + "desc": ListMarketsSortOrderDesc, +} + +// GetListMarketsSortOrderEnumValues Enumerates the set of values for ListMarketsSortOrderEnum +func GetListMarketsSortOrderEnumValues() []ListMarketsSortOrderEnum { + values := make([]ListMarketsSortOrderEnum, 0) + for _, v := range mappingListMarketsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListMarketsSortOrderEnumStringValues Enumerates the set of values in String for ListMarketsSortOrderEnum +func GetListMarketsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListMarketsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMarketsSortOrderEnum(val string) (ListMarketsSortOrderEnum, bool) { + enum, ok := mappingListMarketsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListMarketsSortByEnum Enum with underlying type: string +type ListMarketsSortByEnum string + +// Set of constants representing the allowable values for ListMarketsSortByEnum +const ( + ListMarketsSortByTimecreated ListMarketsSortByEnum = "timeCreated" + ListMarketsSortByDisplayname ListMarketsSortByEnum = "displayName" +) + +var mappingListMarketsSortByEnum = map[string]ListMarketsSortByEnum{ + "timeCreated": ListMarketsSortByTimecreated, + "displayName": ListMarketsSortByDisplayname, +} + +var mappingListMarketsSortByEnumLowerCase = map[string]ListMarketsSortByEnum{ + "timecreated": ListMarketsSortByTimecreated, + "displayname": ListMarketsSortByDisplayname, +} + +// GetListMarketsSortByEnumValues Enumerates the set of values for ListMarketsSortByEnum +func GetListMarketsSortByEnumValues() []ListMarketsSortByEnum { + values := make([]ListMarketsSortByEnum, 0) + for _, v := range mappingListMarketsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListMarketsSortByEnumStringValues Enumerates the set of values in String for ListMarketsSortByEnum +func GetListMarketsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListMarketsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMarketsSortByEnum(val string) (ListMarketsSortByEnum, bool) { + enum, ok := mappingListMarketsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_products_request_response.go b/marketplacepublisher/list_products_request_response.go new file mode 100644 index 0000000000..fd6ffbd64f --- /dev/null +++ b/marketplacepublisher/list_products_request_response.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListProductsRequest wrapper for the ListProducts operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListProducts.go.html to see an example of how to use ListProductsRequest. +type ListProductsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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 ListProductsSortOrderEnum `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 ListProductsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire name given. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListProductsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListProductsRequest) 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 ListProductsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListProductsRequest) 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 ListProductsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListProductsSortOrderEnum(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(GetListProductsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListProductsSortByEnum(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(GetListProductsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListProductsResponse wrapper for the ListProducts operation +type ListProductsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ProductCollection instances + ProductCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListProductsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListProductsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListProductsSortOrderEnum Enum with underlying type: string +type ListProductsSortOrderEnum string + +// Set of constants representing the allowable values for ListProductsSortOrderEnum +const ( + ListProductsSortOrderAsc ListProductsSortOrderEnum = "ASC" + ListProductsSortOrderDesc ListProductsSortOrderEnum = "DESC" +) + +var mappingListProductsSortOrderEnum = map[string]ListProductsSortOrderEnum{ + "ASC": ListProductsSortOrderAsc, + "DESC": ListProductsSortOrderDesc, +} + +var mappingListProductsSortOrderEnumLowerCase = map[string]ListProductsSortOrderEnum{ + "asc": ListProductsSortOrderAsc, + "desc": ListProductsSortOrderDesc, +} + +// GetListProductsSortOrderEnumValues Enumerates the set of values for ListProductsSortOrderEnum +func GetListProductsSortOrderEnumValues() []ListProductsSortOrderEnum { + values := make([]ListProductsSortOrderEnum, 0) + for _, v := range mappingListProductsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListProductsSortOrderEnumStringValues Enumerates the set of values in String for ListProductsSortOrderEnum +func GetListProductsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListProductsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListProductsSortOrderEnum(val string) (ListProductsSortOrderEnum, bool) { + enum, ok := mappingListProductsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListProductsSortByEnum Enum with underlying type: string +type ListProductsSortByEnum string + +// Set of constants representing the allowable values for ListProductsSortByEnum +const ( + ListProductsSortByTimecreated ListProductsSortByEnum = "timeCreated" + ListProductsSortByDisplayname ListProductsSortByEnum = "displayName" +) + +var mappingListProductsSortByEnum = map[string]ListProductsSortByEnum{ + "timeCreated": ListProductsSortByTimecreated, + "displayName": ListProductsSortByDisplayname, +} + +var mappingListProductsSortByEnumLowerCase = map[string]ListProductsSortByEnum{ + "timecreated": ListProductsSortByTimecreated, + "displayname": ListProductsSortByDisplayname, +} + +// GetListProductsSortByEnumValues Enumerates the set of values for ListProductsSortByEnum +func GetListProductsSortByEnumValues() []ListProductsSortByEnum { + values := make([]ListProductsSortByEnum, 0) + for _, v := range mappingListProductsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListProductsSortByEnumStringValues Enumerates the set of values in String for ListProductsSortByEnum +func GetListProductsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListProductsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListProductsSortByEnum(val string) (ListProductsSortByEnum, bool) { + enum, ok := mappingListProductsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_publishers_request_response.go b/marketplacepublisher/list_publishers_request_response.go new file mode 100644 index 0000000000..aa30988963 --- /dev/null +++ b/marketplacepublisher/list_publishers_request_response.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListPublishersRequest wrapper for the ListPublishers operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListPublishers.go.html to see an example of how to use ListPublishersRequest. +type ListPublishersRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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 ListPublishersSortOrderEnum `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 ListPublishersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire name given. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListPublishersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListPublishersRequest) 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 ListPublishersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPublishersRequest) 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 ListPublishersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListPublishersSortOrderEnum(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(GetListPublishersSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListPublishersSortByEnum(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(GetListPublishersSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListPublishersResponse wrapper for the ListPublishers operation +type ListPublishersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of PublisherCollection instances + PublisherCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListPublishersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListPublishersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListPublishersSortOrderEnum Enum with underlying type: string +type ListPublishersSortOrderEnum string + +// Set of constants representing the allowable values for ListPublishersSortOrderEnum +const ( + ListPublishersSortOrderAsc ListPublishersSortOrderEnum = "ASC" + ListPublishersSortOrderDesc ListPublishersSortOrderEnum = "DESC" +) + +var mappingListPublishersSortOrderEnum = map[string]ListPublishersSortOrderEnum{ + "ASC": ListPublishersSortOrderAsc, + "DESC": ListPublishersSortOrderDesc, +} + +var mappingListPublishersSortOrderEnumLowerCase = map[string]ListPublishersSortOrderEnum{ + "asc": ListPublishersSortOrderAsc, + "desc": ListPublishersSortOrderDesc, +} + +// GetListPublishersSortOrderEnumValues Enumerates the set of values for ListPublishersSortOrderEnum +func GetListPublishersSortOrderEnumValues() []ListPublishersSortOrderEnum { + values := make([]ListPublishersSortOrderEnum, 0) + for _, v := range mappingListPublishersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListPublishersSortOrderEnumStringValues Enumerates the set of values in String for ListPublishersSortOrderEnum +func GetListPublishersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListPublishersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPublishersSortOrderEnum(val string) (ListPublishersSortOrderEnum, bool) { + enum, ok := mappingListPublishersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListPublishersSortByEnum Enum with underlying type: string +type ListPublishersSortByEnum string + +// Set of constants representing the allowable values for ListPublishersSortByEnum +const ( + ListPublishersSortByTimecreated ListPublishersSortByEnum = "timeCreated" + ListPublishersSortByDisplayname ListPublishersSortByEnum = "displayName" +) + +var mappingListPublishersSortByEnum = map[string]ListPublishersSortByEnum{ + "timeCreated": ListPublishersSortByTimecreated, + "displayName": ListPublishersSortByDisplayname, +} + +var mappingListPublishersSortByEnumLowerCase = map[string]ListPublishersSortByEnum{ + "timecreated": ListPublishersSortByTimecreated, + "displayname": ListPublishersSortByDisplayname, +} + +// GetListPublishersSortByEnumValues Enumerates the set of values for ListPublishersSortByEnum +func GetListPublishersSortByEnumValues() []ListPublishersSortByEnum { + values := make([]ListPublishersSortByEnum, 0) + for _, v := range mappingListPublishersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListPublishersSortByEnumStringValues Enumerates the set of values in String for ListPublishersSortByEnum +func GetListPublishersSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListPublishersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPublishersSortByEnum(val string) (ListPublishersSortByEnum, bool) { + enum, ok := mappingListPublishersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_term_versions_request_response.go b/marketplacepublisher/list_term_versions_request_response.go new file mode 100644 index 0000000000..a3e4f826c7 --- /dev/null +++ b/marketplacepublisher/list_term_versions_request_response.go @@ -0,0 +1,203 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListTermVersionsRequest wrapper for the ListTermVersions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListTermVersions.go.html to see an example of how to use ListTermVersionsRequest. +type ListTermVersionsRequest struct { + + // term OCID + TermId *string `mandatory:"true" contributesTo:"query" name:"termId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // 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 ListTermVersionsSortOrderEnum `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 ListTermVersionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListTermVersionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListTermVersionsRequest) 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 ListTermVersionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListTermVersionsRequest) 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 ListTermVersionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListTermVersionsSortOrderEnum(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(GetListTermVersionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListTermVersionsSortByEnum(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(GetListTermVersionsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListTermVersionsResponse wrapper for the ListTermVersions operation +type ListTermVersionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of TermVersionCollection instances + TermVersionCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListTermVersionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListTermVersionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListTermVersionsSortOrderEnum Enum with underlying type: string +type ListTermVersionsSortOrderEnum string + +// Set of constants representing the allowable values for ListTermVersionsSortOrderEnum +const ( + ListTermVersionsSortOrderAsc ListTermVersionsSortOrderEnum = "ASC" + ListTermVersionsSortOrderDesc ListTermVersionsSortOrderEnum = "DESC" +) + +var mappingListTermVersionsSortOrderEnum = map[string]ListTermVersionsSortOrderEnum{ + "ASC": ListTermVersionsSortOrderAsc, + "DESC": ListTermVersionsSortOrderDesc, +} + +var mappingListTermVersionsSortOrderEnumLowerCase = map[string]ListTermVersionsSortOrderEnum{ + "asc": ListTermVersionsSortOrderAsc, + "desc": ListTermVersionsSortOrderDesc, +} + +// GetListTermVersionsSortOrderEnumValues Enumerates the set of values for ListTermVersionsSortOrderEnum +func GetListTermVersionsSortOrderEnumValues() []ListTermVersionsSortOrderEnum { + values := make([]ListTermVersionsSortOrderEnum, 0) + for _, v := range mappingListTermVersionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListTermVersionsSortOrderEnumStringValues Enumerates the set of values in String for ListTermVersionsSortOrderEnum +func GetListTermVersionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListTermVersionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListTermVersionsSortOrderEnum(val string) (ListTermVersionsSortOrderEnum, bool) { + enum, ok := mappingListTermVersionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListTermVersionsSortByEnum Enum with underlying type: string +type ListTermVersionsSortByEnum string + +// Set of constants representing the allowable values for ListTermVersionsSortByEnum +const ( + ListTermVersionsSortByTimecreated ListTermVersionsSortByEnum = "timeCreated" + ListTermVersionsSortByDisplayname ListTermVersionsSortByEnum = "displayName" +) + +var mappingListTermVersionsSortByEnum = map[string]ListTermVersionsSortByEnum{ + "timeCreated": ListTermVersionsSortByTimecreated, + "displayName": ListTermVersionsSortByDisplayname, +} + +var mappingListTermVersionsSortByEnumLowerCase = map[string]ListTermVersionsSortByEnum{ + "timecreated": ListTermVersionsSortByTimecreated, + "displayname": ListTermVersionsSortByDisplayname, +} + +// GetListTermVersionsSortByEnumValues Enumerates the set of values for ListTermVersionsSortByEnum +func GetListTermVersionsSortByEnumValues() []ListTermVersionsSortByEnum { + values := make([]ListTermVersionsSortByEnum, 0) + for _, v := range mappingListTermVersionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListTermVersionsSortByEnumStringValues Enumerates the set of values in String for ListTermVersionsSortByEnum +func GetListTermVersionsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListTermVersionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListTermVersionsSortByEnum(val string) (ListTermVersionsSortByEnum, bool) { + enum, ok := mappingListTermVersionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_terms_request_response.go b/marketplacepublisher/list_terms_request_response.go new file mode 100644 index 0000000000..a70ea45a5d --- /dev/null +++ b/marketplacepublisher/list_terms_request_response.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListTermsRequest wrapper for the ListTerms operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListTerms.go.html to see an example of how to use ListTermsRequest. +type ListTermsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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 ListTermsSortOrderEnum `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 ListTermsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire name given. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListTermsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListTermsRequest) 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 ListTermsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListTermsRequest) 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 ListTermsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListTermsSortOrderEnum(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(GetListTermsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListTermsSortByEnum(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(GetListTermsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListTermsResponse wrapper for the ListTerms operation +type ListTermsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of TermCollection instances + TermCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListTermsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListTermsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListTermsSortOrderEnum Enum with underlying type: string +type ListTermsSortOrderEnum string + +// Set of constants representing the allowable values for ListTermsSortOrderEnum +const ( + ListTermsSortOrderAsc ListTermsSortOrderEnum = "ASC" + ListTermsSortOrderDesc ListTermsSortOrderEnum = "DESC" +) + +var mappingListTermsSortOrderEnum = map[string]ListTermsSortOrderEnum{ + "ASC": ListTermsSortOrderAsc, + "DESC": ListTermsSortOrderDesc, +} + +var mappingListTermsSortOrderEnumLowerCase = map[string]ListTermsSortOrderEnum{ + "asc": ListTermsSortOrderAsc, + "desc": ListTermsSortOrderDesc, +} + +// GetListTermsSortOrderEnumValues Enumerates the set of values for ListTermsSortOrderEnum +func GetListTermsSortOrderEnumValues() []ListTermsSortOrderEnum { + values := make([]ListTermsSortOrderEnum, 0) + for _, v := range mappingListTermsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListTermsSortOrderEnumStringValues Enumerates the set of values in String for ListTermsSortOrderEnum +func GetListTermsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListTermsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListTermsSortOrderEnum(val string) (ListTermsSortOrderEnum, bool) { + enum, ok := mappingListTermsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListTermsSortByEnum Enum with underlying type: string +type ListTermsSortByEnum string + +// Set of constants representing the allowable values for ListTermsSortByEnum +const ( + ListTermsSortByTimecreated ListTermsSortByEnum = "timeCreated" + ListTermsSortByDisplayname ListTermsSortByEnum = "displayName" +) + +var mappingListTermsSortByEnum = map[string]ListTermsSortByEnum{ + "timeCreated": ListTermsSortByTimecreated, + "displayName": ListTermsSortByDisplayname, +} + +var mappingListTermsSortByEnumLowerCase = map[string]ListTermsSortByEnum{ + "timecreated": ListTermsSortByTimecreated, + "displayname": ListTermsSortByDisplayname, +} + +// GetListTermsSortByEnumValues Enumerates the set of values for ListTermsSortByEnum +func GetListTermsSortByEnumValues() []ListTermsSortByEnum { + values := make([]ListTermsSortByEnum, 0) + for _, v := range mappingListTermsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListTermsSortByEnumStringValues Enumerates the set of values in String for ListTermsSortByEnum +func GetListTermsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListTermsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListTermsSortByEnum(val string) (ListTermsSortByEnum, bool) { + enum, ok := mappingListTermsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_work_request_errors_request_response.go b/marketplacepublisher/list_work_request_errors_request_response.go new file mode 100644 index 0000000000..8bbae89471 --- /dev/null +++ b/marketplacepublisher/list_work_request_errors_request_response.go @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timestamp is descending. + SortBy ListWorkRequestErrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestErrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestErrorsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestErrorsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestErrorsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestErrorsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimestamp ListWorkRequestErrorsSortByEnum = "timestamp" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +// GetListWorkRequestErrorsSortByEnumValues Enumerates the set of values for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumValues() []ListWorkRequestErrorsSortByEnum { + values := make([]ListWorkRequestErrorsSortByEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestErrorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortByEnum(val string) (ListWorkRequestErrorsSortByEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestErrorsSortOrderEnum Enum with underlying type: string +type ListWorkRequestErrorsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortOrderEnum +const ( + ListWorkRequestErrorsSortOrderAsc ListWorkRequestErrorsSortOrderEnum = "ASC" + ListWorkRequestErrorsSortOrderDesc ListWorkRequestErrorsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestErrorsSortOrderEnum = map[string]ListWorkRequestErrorsSortOrderEnum{ + "ASC": ListWorkRequestErrorsSortOrderAsc, + "DESC": ListWorkRequestErrorsSortOrderDesc, +} + +var mappingListWorkRequestErrorsSortOrderEnumLowerCase = map[string]ListWorkRequestErrorsSortOrderEnum{ + "asc": ListWorkRequestErrorsSortOrderAsc, + "desc": ListWorkRequestErrorsSortOrderDesc, +} + +// GetListWorkRequestErrorsSortOrderEnumValues Enumerates the set of values for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumValues() []ListWorkRequestErrorsSortOrderEnum { + values := make([]ListWorkRequestErrorsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestErrorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortOrderEnum(val string) (ListWorkRequestErrorsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_work_request_logs_request_response.go b/marketplacepublisher/list_work_request_logs_request_response.go new file mode 100644 index 0000000000..db73e4d4bd --- /dev/null +++ b/marketplacepublisher/list_work_request_logs_request_response.go @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timestamp is descending. + SortBy ListWorkRequestLogsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestLogsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestLogsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestLogsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestLogsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimestamp ListWorkRequestLogsSortByEnum = "timestamp" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +// GetListWorkRequestLogsSortByEnumValues Enumerates the set of values for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumValues() []ListWorkRequestLogsSortByEnum { + values := make([]ListWorkRequestLogsSortByEnum, 0) + for _, v := range mappingListWorkRequestLogsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestLogsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortByEnum(val string) (ListWorkRequestLogsSortByEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestLogsSortOrderEnum Enum with underlying type: string +type ListWorkRequestLogsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortOrderEnum +const ( + ListWorkRequestLogsSortOrderAsc ListWorkRequestLogsSortOrderEnum = "ASC" + ListWorkRequestLogsSortOrderDesc ListWorkRequestLogsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestLogsSortOrderEnum = map[string]ListWorkRequestLogsSortOrderEnum{ + "ASC": ListWorkRequestLogsSortOrderAsc, + "DESC": ListWorkRequestLogsSortOrderDesc, +} + +var mappingListWorkRequestLogsSortOrderEnumLowerCase = map[string]ListWorkRequestLogsSortOrderEnum{ + "asc": ListWorkRequestLogsSortOrderAsc, + "desc": ListWorkRequestLogsSortOrderDesc, +} + +// GetListWorkRequestLogsSortOrderEnumValues Enumerates the set of values for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumValues() []ListWorkRequestLogsSortOrderEnum { + values := make([]ListWorkRequestLogsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestLogsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestLogsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortOrderEnum(val string) (ListWorkRequestLogsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/list_work_requests_request_response.go b/marketplacepublisher/list_work_requests_request_response.go new file mode 100644 index 0000000000..bdffd208d1 --- /dev/null +++ b/marketplacepublisher/list_work_requests_request_response.go @@ -0,0 +1,271 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The ID of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // A filter to return only resources their lifecycleState matches the given OperationStatus. + Status ListWorkRequestsStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + + // The ID of the resource affected by the work request. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestsStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetListWorkRequestsStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsStatusEnum Enum with underlying type: string +type ListWorkRequestsStatusEnum string + +// Set of constants representing the allowable values for ListWorkRequestsStatusEnum +const ( + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "needs_attention": ListWorkRequestsStatusNeedsAttention, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, +} + +// GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumValues() []ListWorkRequestsStatusEnum { + values := make([]ListWorkRequestsStatusEnum, 0) + for _, v := range mappingListWorkRequestsStatusEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsStatusEnumStringValues Enumerates the set of values in String for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingListWorkRequestsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsStatusEnum(val string) (ListWorkRequestsStatusEnum, bool) { + enum, ok := mappingListWorkRequestsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrderEnum = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +var mappingListWorkRequestsSortOrderEnumLowerCase = map[string]ListWorkRequestsSortOrderEnum{ + "asc": ListWorkRequestsSortOrderAsc, + "desc": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortOrderEnum(val string) (ListWorkRequestsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortByTimeaccepted ListWorkRequestsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestsSortByEnum = map[string]ListWorkRequestsSortByEnum{ + "timeAccepted": ListWorkRequestsSortByTimeaccepted, +} + +var mappingListWorkRequestsSortByEnumLowerCase = map[string]ListWorkRequestsSortByEnum{ + "timeaccepted": ListWorkRequestsSortByTimeaccepted, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortByEnum(val string) (ListWorkRequestsSortByEnum, bool) { + enum, ok := mappingListWorkRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/listing.go b/marketplacepublisher/listing.go new file mode 100644 index 0000000000..c97c58d045 --- /dev/null +++ b/marketplacepublisher/listing.go @@ -0,0 +1,153 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Listing The model for the Marketplace Publisher listing. +type Listing struct { + + // Unique OCID identifier for the listing. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier for the publisher. + PublisherId *string `mandatory:"true" json:"publisherId"` + + // The listing type for the listing. + ListingType ListingTypeEnum `mandatory:"true" json:"listingType"` + + // Name for the listing. + Name *string `mandatory:"true" json:"name"` + + // The package type for the listing. + PackageType PackageTypeEnum `mandatory:"true" json:"packageType"` + + // The date and time the listing was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2023-03-27T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the listing was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2023-03-27T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Additional metadata key/value pairs for the listing summary. + // For example: + // `{"listingRevisionStatus": "Published","listingRevision": "1" }` + ExtendedMetadata map[string]string `mandatory:"false" json:"extendedMetadata"` + + // The current state of the Listing. + LifecycleState ListingLifecycleStateEnum `mandatory:"false" json:"lifecycleState,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 Listing) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Listing) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingTypeEnum(string(m.ListingType)); !ok && m.ListingType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ListingType: %s. Supported values are: %s.", m.ListingType, strings.Join(GetListingTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingPackageTypeEnum(string(m.PackageType)); !ok && m.PackageType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PackageType: %s. Supported values are: %s.", m.PackageType, strings.Join(GetPackageTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingListingLifecycleStateEnum(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(GetListingLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListingLifecycleStateEnum Enum with underlying type: string +type ListingLifecycleStateEnum string + +// Set of constants representing the allowable values for ListingLifecycleStateEnum +const ( + ListingLifecycleStateCreating ListingLifecycleStateEnum = "CREATING" + ListingLifecycleStateUpdating ListingLifecycleStateEnum = "UPDATING" + ListingLifecycleStateActive ListingLifecycleStateEnum = "ACTIVE" + ListingLifecycleStateInactive ListingLifecycleStateEnum = "INACTIVE" + ListingLifecycleStateDeleting ListingLifecycleStateEnum = "DELETING" + ListingLifecycleStateDeleted ListingLifecycleStateEnum = "DELETED" + ListingLifecycleStateFailed ListingLifecycleStateEnum = "FAILED" +) + +var mappingListingLifecycleStateEnum = map[string]ListingLifecycleStateEnum{ + "CREATING": ListingLifecycleStateCreating, + "UPDATING": ListingLifecycleStateUpdating, + "ACTIVE": ListingLifecycleStateActive, + "INACTIVE": ListingLifecycleStateInactive, + "DELETING": ListingLifecycleStateDeleting, + "DELETED": ListingLifecycleStateDeleted, + "FAILED": ListingLifecycleStateFailed, +} + +var mappingListingLifecycleStateEnumLowerCase = map[string]ListingLifecycleStateEnum{ + "creating": ListingLifecycleStateCreating, + "updating": ListingLifecycleStateUpdating, + "active": ListingLifecycleStateActive, + "inactive": ListingLifecycleStateInactive, + "deleting": ListingLifecycleStateDeleting, + "deleted": ListingLifecycleStateDeleted, + "failed": ListingLifecycleStateFailed, +} + +// GetListingLifecycleStateEnumValues Enumerates the set of values for ListingLifecycleStateEnum +func GetListingLifecycleStateEnumValues() []ListingLifecycleStateEnum { + values := make([]ListingLifecycleStateEnum, 0) + for _, v := range mappingListingLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListingLifecycleStateEnumStringValues Enumerates the set of values in String for ListingLifecycleStateEnum +func GetListingLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "INACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListingLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingLifecycleStateEnum(val string) (ListingLifecycleStateEnum, bool) { + enum, ok := mappingListingLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/listing_collection.go b/marketplacepublisher/listing_collection.go new file mode 100644 index 0000000000..ed16ddb817 --- /dev/null +++ b/marketplacepublisher/listing_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingCollection Results of listing search. Contains Listing items. +type ListingCollection struct { + + // List of listing summary. + Items []ListingSummary `mandatory:"true" json:"items"` +} + +func (m ListingCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision.go b/marketplacepublisher/listing_revision.go new file mode 100644 index 0000000000..3be09c8d5b --- /dev/null +++ b/marketplacepublisher/listing_revision.go @@ -0,0 +1,337 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevision The model for an Oracle Cloud Infrastructure Marketplace Publisher listing revision. +type ListingRevision struct { + + // Unique OCID identifier for the listing revision in Marketplace Publisher. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the listing this revision belongs to. + ListingId *string `mandatory:"true" json:"listingId"` + + // The name for the listing revision. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Single line introduction for the listing revision. + Headline *string `mandatory:"true" json:"headline"` + + // The time the listing revision was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the listing revision was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The categories for the listing revsion. + Categories []string `mandatory:"true" json:"categories"` + + // The current status for the Listing revision. + Status ListingRevisionStatusEnum `mandatory:"true" json:"status"` + + // The current state of the listing revision. + LifecycleState ListingRevisionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The listing's package type. Populated from the listing. + PackageType PackageTypeEnum `mandatory:"true" json:"packageType"` + + // The pricing model for the listing revision. + PricingType ListingRevisionPricingTypeEnum `mandatory:"true" json:"pricingType"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The revision number for the listing revision. This is an internal attribute + RevisionNumber *string `mandatory:"false" json:"revisionNumber"` + + VersionDetails *VersionDetails `mandatory:"false" json:"versionDetails"` + + // The tagline of the listing revision. + Tagline *string `mandatory:"false" json:"tagline"` + + // Keywords associated with the listing revision. + Keywords *string `mandatory:"false" json:"keywords"` + + // A short description for the listing revision. + ShortDescription *string `mandatory:"false" json:"shortDescription"` + + // Usage information for the listing revision. + UsageInformation *string `mandatory:"false" json:"usageInformation"` + + // A long description for the listing revision. + LongDescription *string `mandatory:"false" json:"longDescription"` + + // System requirements for the listing revision. + SystemRequirements *string `mandatory:"false" json:"systemRequirements"` + + // The markets supported by the listing revision. + Markets []string `mandatory:"false" json:"markets"` + + ContentLanguage *LanguageItem `mandatory:"false" json:"contentLanguage"` + + // Languages supported by the publisher for the listing revision. + Supportedlanguages []LanguageItem `mandatory:"false" json:"supportedlanguages"` + + // Contact information to use to get support from the publisher for the listing revision. + SupportContacts []SupportContact `mandatory:"false" json:"supportContacts"` + + // Links to support resources for the listing revision. + SupportLinks []NamedLink `mandatory:"false" json:"supportLinks"` + + Icon *ListingRevisionIconAttachment `mandatory:"false" json:"icon"` + + // Status notes for the listing revision. + StatusNotes *string `mandatory:"false" json:"statusNotes"` + + // Allowed tenancies provided when a listing revision is published as private. + AllowedTenancies []string `mandatory:"false" json:"allowedTenancies"` + + // Identifies whether publisher allows internal tenancy launches for the listing revision. + AreInternalTenancyLaunchAllowed *bool `mandatory:"false" json:"areInternalTenancyLaunchAllowed"` + + // Additional metadata key/value pairs for the listing revision summary. + ExtendedMetadata map[string]string `mandatory:"false" json:"extendedMetadata"` + + // 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 ListingRevision) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevision) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetListingRevisionStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionLifecycleStateEnum(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(GetListingRevisionLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingPackageTypeEnum(string(m.PackageType)); !ok && m.PackageType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PackageType: %s. Supported values are: %s.", m.PackageType, strings.Join(GetPackageTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionPricingTypeEnum(string(m.PricingType)); !ok && m.PricingType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PricingType: %s. Supported values are: %s.", m.PricingType, strings.Join(GetListingRevisionPricingTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListingRevisionStatusEnum Enum with underlying type: string +type ListingRevisionStatusEnum string + +// Set of constants representing the allowable values for ListingRevisionStatusEnum +const ( + ListingRevisionStatusNew ListingRevisionStatusEnum = "NEW" + ListingRevisionStatusPendingReview ListingRevisionStatusEnum = "PENDING_REVIEW" + ListingRevisionStatusReviewInProgress ListingRevisionStatusEnum = "REVIEW_IN_PROGRESS" + ListingRevisionStatusRejected ListingRevisionStatusEnum = "REJECTED" + ListingRevisionStatusApproved ListingRevisionStatusEnum = "APPROVED" + ListingRevisionStatusPublishInProgress ListingRevisionStatusEnum = "PUBLISH_IN_PROGRESS" + ListingRevisionStatusPublishFailed ListingRevisionStatusEnum = "PUBLISH_FAILED" + ListingRevisionStatusPublished ListingRevisionStatusEnum = "PUBLISHED" + ListingRevisionStatusPublishAsPrivateFailed ListingRevisionStatusEnum = "PUBLISH_AS_PRIVATE_FAILED" + ListingRevisionStatusPublishedAsPrivate ListingRevisionStatusEnum = "PUBLISHED_AS_PRIVATE" + ListingRevisionStatusPublishAsPrivateInProgress ListingRevisionStatusEnum = "PUBLISH_AS_PRIVATE_IN_PROGRESS" + ListingRevisionStatusUnpublishInProgress ListingRevisionStatusEnum = "UNPUBLISH_IN_PROGRESS" + ListingRevisionStatusUnpublished ListingRevisionStatusEnum = "UNPUBLISHED" +) + +var mappingListingRevisionStatusEnum = map[string]ListingRevisionStatusEnum{ + "NEW": ListingRevisionStatusNew, + "PENDING_REVIEW": ListingRevisionStatusPendingReview, + "REVIEW_IN_PROGRESS": ListingRevisionStatusReviewInProgress, + "REJECTED": ListingRevisionStatusRejected, + "APPROVED": ListingRevisionStatusApproved, + "PUBLISH_IN_PROGRESS": ListingRevisionStatusPublishInProgress, + "PUBLISH_FAILED": ListingRevisionStatusPublishFailed, + "PUBLISHED": ListingRevisionStatusPublished, + "PUBLISH_AS_PRIVATE_FAILED": ListingRevisionStatusPublishAsPrivateFailed, + "PUBLISHED_AS_PRIVATE": ListingRevisionStatusPublishedAsPrivate, + "PUBLISH_AS_PRIVATE_IN_PROGRESS": ListingRevisionStatusPublishAsPrivateInProgress, + "UNPUBLISH_IN_PROGRESS": ListingRevisionStatusUnpublishInProgress, + "UNPUBLISHED": ListingRevisionStatusUnpublished, +} + +var mappingListingRevisionStatusEnumLowerCase = map[string]ListingRevisionStatusEnum{ + "new": ListingRevisionStatusNew, + "pending_review": ListingRevisionStatusPendingReview, + "review_in_progress": ListingRevisionStatusReviewInProgress, + "rejected": ListingRevisionStatusRejected, + "approved": ListingRevisionStatusApproved, + "publish_in_progress": ListingRevisionStatusPublishInProgress, + "publish_failed": ListingRevisionStatusPublishFailed, + "published": ListingRevisionStatusPublished, + "publish_as_private_failed": ListingRevisionStatusPublishAsPrivateFailed, + "published_as_private": ListingRevisionStatusPublishedAsPrivate, + "publish_as_private_in_progress": ListingRevisionStatusPublishAsPrivateInProgress, + "unpublish_in_progress": ListingRevisionStatusUnpublishInProgress, + "unpublished": ListingRevisionStatusUnpublished, +} + +// GetListingRevisionStatusEnumValues Enumerates the set of values for ListingRevisionStatusEnum +func GetListingRevisionStatusEnumValues() []ListingRevisionStatusEnum { + values := make([]ListingRevisionStatusEnum, 0) + for _, v := range mappingListingRevisionStatusEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionStatusEnumStringValues Enumerates the set of values in String for ListingRevisionStatusEnum +func GetListingRevisionStatusEnumStringValues() []string { + return []string{ + "NEW", + "PENDING_REVIEW", + "REVIEW_IN_PROGRESS", + "REJECTED", + "APPROVED", + "PUBLISH_IN_PROGRESS", + "PUBLISH_FAILED", + "PUBLISHED", + "PUBLISH_AS_PRIVATE_FAILED", + "PUBLISHED_AS_PRIVATE", + "PUBLISH_AS_PRIVATE_IN_PROGRESS", + "UNPUBLISH_IN_PROGRESS", + "UNPUBLISHED", + } +} + +// GetMappingListingRevisionStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionStatusEnum(val string) (ListingRevisionStatusEnum, bool) { + enum, ok := mappingListingRevisionStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListingRevisionLifecycleStateEnum Enum with underlying type: string +type ListingRevisionLifecycleStateEnum string + +// Set of constants representing the allowable values for ListingRevisionLifecycleStateEnum +const ( + ListingRevisionLifecycleStateCreating ListingRevisionLifecycleStateEnum = "CREATING" + ListingRevisionLifecycleStateUpdating ListingRevisionLifecycleStateEnum = "UPDATING" + ListingRevisionLifecycleStateActive ListingRevisionLifecycleStateEnum = "ACTIVE" + ListingRevisionLifecycleStateDeleting ListingRevisionLifecycleStateEnum = "DELETING" + ListingRevisionLifecycleStateDeleted ListingRevisionLifecycleStateEnum = "DELETED" + ListingRevisionLifecycleStateFailed ListingRevisionLifecycleStateEnum = "FAILED" +) + +var mappingListingRevisionLifecycleStateEnum = map[string]ListingRevisionLifecycleStateEnum{ + "CREATING": ListingRevisionLifecycleStateCreating, + "UPDATING": ListingRevisionLifecycleStateUpdating, + "ACTIVE": ListingRevisionLifecycleStateActive, + "DELETING": ListingRevisionLifecycleStateDeleting, + "DELETED": ListingRevisionLifecycleStateDeleted, + "FAILED": ListingRevisionLifecycleStateFailed, +} + +var mappingListingRevisionLifecycleStateEnumLowerCase = map[string]ListingRevisionLifecycleStateEnum{ + "creating": ListingRevisionLifecycleStateCreating, + "updating": ListingRevisionLifecycleStateUpdating, + "active": ListingRevisionLifecycleStateActive, + "deleting": ListingRevisionLifecycleStateDeleting, + "deleted": ListingRevisionLifecycleStateDeleted, + "failed": ListingRevisionLifecycleStateFailed, +} + +// GetListingRevisionLifecycleStateEnumValues Enumerates the set of values for ListingRevisionLifecycleStateEnum +func GetListingRevisionLifecycleStateEnumValues() []ListingRevisionLifecycleStateEnum { + values := make([]ListingRevisionLifecycleStateEnum, 0) + for _, v := range mappingListingRevisionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionLifecycleStateEnumStringValues Enumerates the set of values in String for ListingRevisionLifecycleStateEnum +func GetListingRevisionLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListingRevisionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionLifecycleStateEnum(val string) (ListingRevisionLifecycleStateEnum, bool) { + enum, ok := mappingListingRevisionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListingRevisionPricingTypeEnum Enum with underlying type: string +type ListingRevisionPricingTypeEnum string + +// Set of constants representing the allowable values for ListingRevisionPricingTypeEnum +const ( + ListingRevisionPricingTypeFree ListingRevisionPricingTypeEnum = "FREE" + ListingRevisionPricingTypeByol ListingRevisionPricingTypeEnum = "BYOL" + ListingRevisionPricingTypePaygo ListingRevisionPricingTypeEnum = "PAYGO" +) + +var mappingListingRevisionPricingTypeEnum = map[string]ListingRevisionPricingTypeEnum{ + "FREE": ListingRevisionPricingTypeFree, + "BYOL": ListingRevisionPricingTypeByol, + "PAYGO": ListingRevisionPricingTypePaygo, +} + +var mappingListingRevisionPricingTypeEnumLowerCase = map[string]ListingRevisionPricingTypeEnum{ + "free": ListingRevisionPricingTypeFree, + "byol": ListingRevisionPricingTypeByol, + "paygo": ListingRevisionPricingTypePaygo, +} + +// GetListingRevisionPricingTypeEnumValues Enumerates the set of values for ListingRevisionPricingTypeEnum +func GetListingRevisionPricingTypeEnumValues() []ListingRevisionPricingTypeEnum { + values := make([]ListingRevisionPricingTypeEnum, 0) + for _, v := range mappingListingRevisionPricingTypeEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionPricingTypeEnumStringValues Enumerates the set of values in String for ListingRevisionPricingTypeEnum +func GetListingRevisionPricingTypeEnumStringValues() []string { + return []string{ + "FREE", + "BYOL", + "PAYGO", + } +} + +// GetMappingListingRevisionPricingTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionPricingTypeEnum(val string) (ListingRevisionPricingTypeEnum, bool) { + enum, ok := mappingListingRevisionPricingTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/listing_revision_attachment.go b/marketplacepublisher/listing_revision_attachment.go new file mode 100644 index 0000000000..288dd5b99e --- /dev/null +++ b/marketplacepublisher/listing_revision_attachment.go @@ -0,0 +1,293 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionAttachment A attachment for the listing revision. User can provide an external URL/upload a file +type ListingRevisionAttachment interface { + + // Unique OCID identifier for the listing revision attachment. + GetId() *string + + // The unique identifier for the compartment. + GetCompartmentId() *string + + // The unique identifier of the listing revision that the specified attachment belongs to. + GetListingRevisionId() *string + + // Name of the listing revision attachment. + GetDisplayName() *string + + // The current state of the attachment. + GetLifecycleState() ListingRevisionAttachmentLifecycleStateEnum + + // The time the attachment was created. An RFC3339 formatted datetime string. + GetTimeCreated() *common.SDKTime + + // The time the attachment was updated. An RFC3339 formatted datetime string. + GetTimeUpdated() *common.SDKTime + + // Description of the listing revision attachment. + GetDescription() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type listingrevisionattachment struct { + JsonData []byte + Description *string `mandatory:"false" json:"description"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + Id *string `mandatory:"true" json:"id"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + DisplayName *string `mandatory:"true" json:"displayName"` + LifecycleState ListingRevisionAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + AttachmentType string `json:"attachmentType"` +} + +// UnmarshalJSON unmarshals json +func (m *listingrevisionattachment) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerlistingrevisionattachment listingrevisionattachment + s := struct { + Model Unmarshalerlistingrevisionattachment + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Id = s.Model.Id + m.CompartmentId = s.Model.CompartmentId + m.ListingRevisionId = s.Model.ListingRevisionId + m.DisplayName = s.Model.DisplayName + m.LifecycleState = s.Model.LifecycleState + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.Description = s.Model.Description + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.AttachmentType = s.Model.AttachmentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *listingrevisionattachment) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.AttachmentType { + case "RELATED_DOCUMENT": + mm := RelatedDocumentAttachment{} + err = json.Unmarshal(data, &mm) + return mm, err + case "SCREENSHOT": + mm := ScreenShotAttachment{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VIDEO": + mm := VideoAttachment{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for ListingRevisionAttachment: %s.", m.AttachmentType) + return *m, nil + } +} + +// GetDescription returns Description +func (m listingrevisionattachment) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m listingrevisionattachment) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m listingrevisionattachment) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m listingrevisionattachment) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +// GetId returns Id +func (m listingrevisionattachment) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m listingrevisionattachment) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetListingRevisionId returns ListingRevisionId +func (m listingrevisionattachment) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetDisplayName returns DisplayName +func (m listingrevisionattachment) GetDisplayName() *string { + return m.DisplayName +} + +// GetLifecycleState returns LifecycleState +func (m listingrevisionattachment) GetLifecycleState() ListingRevisionAttachmentLifecycleStateEnum { + return m.LifecycleState +} + +// GetTimeCreated returns TimeCreated +func (m listingrevisionattachment) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m listingrevisionattachment) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m listingrevisionattachment) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m listingrevisionattachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionAttachmentLifecycleStateEnum(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(GetListingRevisionAttachmentLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListingRevisionAttachmentLifecycleStateEnum Enum with underlying type: string +type ListingRevisionAttachmentLifecycleStateEnum string + +// Set of constants representing the allowable values for ListingRevisionAttachmentLifecycleStateEnum +const ( + ListingRevisionAttachmentLifecycleStateActive ListingRevisionAttachmentLifecycleStateEnum = "ACTIVE" + ListingRevisionAttachmentLifecycleStateInactive ListingRevisionAttachmentLifecycleStateEnum = "INACTIVE" + ListingRevisionAttachmentLifecycleStateDeleted ListingRevisionAttachmentLifecycleStateEnum = "DELETED" +) + +var mappingListingRevisionAttachmentLifecycleStateEnum = map[string]ListingRevisionAttachmentLifecycleStateEnum{ + "ACTIVE": ListingRevisionAttachmentLifecycleStateActive, + "INACTIVE": ListingRevisionAttachmentLifecycleStateInactive, + "DELETED": ListingRevisionAttachmentLifecycleStateDeleted, +} + +var mappingListingRevisionAttachmentLifecycleStateEnumLowerCase = map[string]ListingRevisionAttachmentLifecycleStateEnum{ + "active": ListingRevisionAttachmentLifecycleStateActive, + "inactive": ListingRevisionAttachmentLifecycleStateInactive, + "deleted": ListingRevisionAttachmentLifecycleStateDeleted, +} + +// GetListingRevisionAttachmentLifecycleStateEnumValues Enumerates the set of values for ListingRevisionAttachmentLifecycleStateEnum +func GetListingRevisionAttachmentLifecycleStateEnumValues() []ListingRevisionAttachmentLifecycleStateEnum { + values := make([]ListingRevisionAttachmentLifecycleStateEnum, 0) + for _, v := range mappingListingRevisionAttachmentLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionAttachmentLifecycleStateEnumStringValues Enumerates the set of values in String for ListingRevisionAttachmentLifecycleStateEnum +func GetListingRevisionAttachmentLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + "DELETED", + } +} + +// GetMappingListingRevisionAttachmentLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionAttachmentLifecycleStateEnum(val string) (ListingRevisionAttachmentLifecycleStateEnum, bool) { + enum, ok := mappingListingRevisionAttachmentLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListingRevisionAttachmentAttachmentTypeEnum Enum with underlying type: string +type ListingRevisionAttachmentAttachmentTypeEnum string + +// Set of constants representing the allowable values for ListingRevisionAttachmentAttachmentTypeEnum +const ( + ListingRevisionAttachmentAttachmentTypeRelatedDocument ListingRevisionAttachmentAttachmentTypeEnum = "RELATED_DOCUMENT" + ListingRevisionAttachmentAttachmentTypeScreenshot ListingRevisionAttachmentAttachmentTypeEnum = "SCREENSHOT" + ListingRevisionAttachmentAttachmentTypeVideo ListingRevisionAttachmentAttachmentTypeEnum = "VIDEO" +) + +var mappingListingRevisionAttachmentAttachmentTypeEnum = map[string]ListingRevisionAttachmentAttachmentTypeEnum{ + "RELATED_DOCUMENT": ListingRevisionAttachmentAttachmentTypeRelatedDocument, + "SCREENSHOT": ListingRevisionAttachmentAttachmentTypeScreenshot, + "VIDEO": ListingRevisionAttachmentAttachmentTypeVideo, +} + +var mappingListingRevisionAttachmentAttachmentTypeEnumLowerCase = map[string]ListingRevisionAttachmentAttachmentTypeEnum{ + "related_document": ListingRevisionAttachmentAttachmentTypeRelatedDocument, + "screenshot": ListingRevisionAttachmentAttachmentTypeScreenshot, + "video": ListingRevisionAttachmentAttachmentTypeVideo, +} + +// GetListingRevisionAttachmentAttachmentTypeEnumValues Enumerates the set of values for ListingRevisionAttachmentAttachmentTypeEnum +func GetListingRevisionAttachmentAttachmentTypeEnumValues() []ListingRevisionAttachmentAttachmentTypeEnum { + values := make([]ListingRevisionAttachmentAttachmentTypeEnum, 0) + for _, v := range mappingListingRevisionAttachmentAttachmentTypeEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionAttachmentAttachmentTypeEnumStringValues Enumerates the set of values in String for ListingRevisionAttachmentAttachmentTypeEnum +func GetListingRevisionAttachmentAttachmentTypeEnumStringValues() []string { + return []string{ + "RELATED_DOCUMENT", + "SCREENSHOT", + "VIDEO", + } +} + +// GetMappingListingRevisionAttachmentAttachmentTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionAttachmentAttachmentTypeEnum(val string) (ListingRevisionAttachmentAttachmentTypeEnum, bool) { + enum, ok := mappingListingRevisionAttachmentAttachmentTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/listing_revision_attachment_collection.go b/marketplacepublisher/listing_revision_attachment_collection.go new file mode 100644 index 0000000000..645f3143b3 --- /dev/null +++ b/marketplacepublisher/listing_revision_attachment_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionAttachmentCollection Results of the listing attachments search. Contains attachment items. +type ListingRevisionAttachmentCollection struct { + + // List of attachment summary. + Items []ListingRevisionAttachmentSummary `mandatory:"true" json:"items"` +} + +func (m ListingRevisionAttachmentCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionAttachmentCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_attachment_summary.go b/marketplacepublisher/listing_revision_attachment_summary.go new file mode 100644 index 0000000000..c8ea552473 --- /dev/null +++ b/marketplacepublisher/listing_revision_attachment_summary.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionAttachmentSummary The model for a summary of a listing revision related attachments. +type ListingRevisionAttachmentSummary struct { + + // The OCID of the listing revision attachment. + Id *string `mandatory:"true" json:"id"` + + // The ID of the listing revision. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the specified document. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The specified attachment type. + AttachmentType ListingRevisionAttachmentAttachmentTypeEnum `mandatory:"true" json:"attachmentType"` + + // The URL of the specified attachment. + ContentUrl *string `mandatory:"true" json:"contentUrl"` + + // The date and time the related document was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the related document was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The MIME type of the screenshot. + MimeType *string `mandatory:"false" json:"mimeType"` + + // The current state of the document. + LifecycleState ListingRevisionAttachmentLifecycleStateEnum `mandatory:"false" json:"lifecycleState,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 ListingRevisionAttachmentSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionAttachmentSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionAttachmentAttachmentTypeEnum(string(m.AttachmentType)); !ok && m.AttachmentType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttachmentType: %s. Supported values are: %s.", m.AttachmentType, strings.Join(GetListingRevisionAttachmentAttachmentTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingListingRevisionAttachmentLifecycleStateEnum(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(GetListingRevisionAttachmentLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_collection.go b/marketplacepublisher/listing_revision_collection.go new file mode 100644 index 0000000000..604f90cb33 --- /dev/null +++ b/marketplacepublisher/listing_revision_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionCollection Results of listing revision search. Contains Listing revision items. +type ListingRevisionCollection struct { + + // List of listing revision summary. + Items []ListingRevisionSummary `mandatory:"true" json:"items"` +} + +func (m ListingRevisionCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_icon_attachment.go b/marketplacepublisher/listing_revision_icon_attachment.go new file mode 100644 index 0000000000..69b161c385 --- /dev/null +++ b/marketplacepublisher/listing_revision_icon_attachment.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionIconAttachment An attachment uploaded by the Publisher to be attached to the listing revision. +type ListingRevisionIconAttachment struct { + + // The content URL of the uploaded data. + ContentUrl *string `mandatory:"true" json:"contentUrl"` + + // The MIME type of the uploaded data. + MimeType *string `mandatory:"true" json:"mimeType"` +} + +func (m ListingRevisionIconAttachment) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionIconAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_note.go b/marketplacepublisher/listing_revision_note.go new file mode 100644 index 0000000000..98a6315607 --- /dev/null +++ b/marketplacepublisher/listing_revision_note.go @@ -0,0 +1,166 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionNote The model for the listing revision notes. +type ListingRevisionNote struct { + + // The OCID of the listing revision note. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier of the listing revision that the specified note belongs to. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // type of the note. + NoteSource ListingRevisionNoteNoteSourceEnum `mandatory:"true" json:"noteSource"` + + // Notes provided for the listing revision. + NoteDetails *string `mandatory:"true" json:"noteDetails"` + + // The date and time the listing revision note was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the listing revision note was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The current state of the listing revision note. + LifecycleState ListingRevisionNoteLifecycleStateEnum `mandatory:"false" json:"lifecycleState,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 ListingRevisionNote) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionNote) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionNoteNoteSourceEnum(string(m.NoteSource)); !ok && m.NoteSource != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NoteSource: %s. Supported values are: %s.", m.NoteSource, strings.Join(GetListingRevisionNoteNoteSourceEnumStringValues(), ","))) + } + + if _, ok := GetMappingListingRevisionNoteLifecycleStateEnum(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(GetListingRevisionNoteLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListingRevisionNoteNoteSourceEnum Enum with underlying type: string +type ListingRevisionNoteNoteSourceEnum string + +// Set of constants representing the allowable values for ListingRevisionNoteNoteSourceEnum +const ( + ListingRevisionNoteNoteSourcePublisher ListingRevisionNoteNoteSourceEnum = "PUBLISHER" + ListingRevisionNoteNoteSourceAdministrator ListingRevisionNoteNoteSourceEnum = "ADMINISTRATOR" +) + +var mappingListingRevisionNoteNoteSourceEnum = map[string]ListingRevisionNoteNoteSourceEnum{ + "PUBLISHER": ListingRevisionNoteNoteSourcePublisher, + "ADMINISTRATOR": ListingRevisionNoteNoteSourceAdministrator, +} + +var mappingListingRevisionNoteNoteSourceEnumLowerCase = map[string]ListingRevisionNoteNoteSourceEnum{ + "publisher": ListingRevisionNoteNoteSourcePublisher, + "administrator": ListingRevisionNoteNoteSourceAdministrator, +} + +// GetListingRevisionNoteNoteSourceEnumValues Enumerates the set of values for ListingRevisionNoteNoteSourceEnum +func GetListingRevisionNoteNoteSourceEnumValues() []ListingRevisionNoteNoteSourceEnum { + values := make([]ListingRevisionNoteNoteSourceEnum, 0) + for _, v := range mappingListingRevisionNoteNoteSourceEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionNoteNoteSourceEnumStringValues Enumerates the set of values in String for ListingRevisionNoteNoteSourceEnum +func GetListingRevisionNoteNoteSourceEnumStringValues() []string { + return []string{ + "PUBLISHER", + "ADMINISTRATOR", + } +} + +// GetMappingListingRevisionNoteNoteSourceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionNoteNoteSourceEnum(val string) (ListingRevisionNoteNoteSourceEnum, bool) { + enum, ok := mappingListingRevisionNoteNoteSourceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListingRevisionNoteLifecycleStateEnum Enum with underlying type: string +type ListingRevisionNoteLifecycleStateEnum string + +// Set of constants representing the allowable values for ListingRevisionNoteLifecycleStateEnum +const ( + ListingRevisionNoteLifecycleStateActive ListingRevisionNoteLifecycleStateEnum = "ACTIVE" + ListingRevisionNoteLifecycleStateDeleted ListingRevisionNoteLifecycleStateEnum = "DELETED" +) + +var mappingListingRevisionNoteLifecycleStateEnum = map[string]ListingRevisionNoteLifecycleStateEnum{ + "ACTIVE": ListingRevisionNoteLifecycleStateActive, + "DELETED": ListingRevisionNoteLifecycleStateDeleted, +} + +var mappingListingRevisionNoteLifecycleStateEnumLowerCase = map[string]ListingRevisionNoteLifecycleStateEnum{ + "active": ListingRevisionNoteLifecycleStateActive, + "deleted": ListingRevisionNoteLifecycleStateDeleted, +} + +// GetListingRevisionNoteLifecycleStateEnumValues Enumerates the set of values for ListingRevisionNoteLifecycleStateEnum +func GetListingRevisionNoteLifecycleStateEnumValues() []ListingRevisionNoteLifecycleStateEnum { + values := make([]ListingRevisionNoteLifecycleStateEnum, 0) + for _, v := range mappingListingRevisionNoteLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionNoteLifecycleStateEnumStringValues Enumerates the set of values in String for ListingRevisionNoteLifecycleStateEnum +func GetListingRevisionNoteLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "DELETED", + } +} + +// GetMappingListingRevisionNoteLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionNoteLifecycleStateEnum(val string) (ListingRevisionNoteLifecycleStateEnum, bool) { + enum, ok := mappingListingRevisionNoteLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/listing_revision_note_collection.go b/marketplacepublisher/listing_revision_note_collection.go new file mode 100644 index 0000000000..c845df610d --- /dev/null +++ b/marketplacepublisher/listing_revision_note_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionNoteCollection Results of note search. Contains listing revision note items. +type ListingRevisionNoteCollection struct { + + // List of note summary. + Items []ListingRevisionNoteSummary `mandatory:"true" json:"items"` +} + +func (m ListingRevisionNoteCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionNoteCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_note_summary.go b/marketplacepublisher/listing_revision_note_summary.go new file mode 100644 index 0000000000..cf4391d878 --- /dev/null +++ b/marketplacepublisher/listing_revision_note_summary.go @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionNoteSummary The model for a summary of a listing revision notes. +type ListingRevisionNoteSummary struct { + + // The OCID of the listing revision note. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier of the listing revision that the specified note belongs to. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // type of the note. + NoteSource ListingRevisionNoteNoteSourceEnum `mandatory:"true" json:"noteSource"` + + // Notes provided for the listing revision. + NoteDetails *string `mandatory:"true" json:"noteDetails"` + + // The date and time the listing revision note was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the listing revision note was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The current state of the note. + LifecycleState ListingRevisionNoteLifecycleStateEnum `mandatory:"false" json:"lifecycleState,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 ListingRevisionNoteSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionNoteSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionNoteNoteSourceEnum(string(m.NoteSource)); !ok && m.NoteSource != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NoteSource: %s. Supported values are: %s.", m.NoteSource, strings.Join(GetListingRevisionNoteNoteSourceEnumStringValues(), ","))) + } + + if _, ok := GetMappingListingRevisionNoteLifecycleStateEnum(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(GetListingRevisionNoteLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_package.go b/marketplacepublisher/listing_revision_package.go new file mode 100644 index 0000000000..41060c4c98 --- /dev/null +++ b/marketplacepublisher/listing_revision_package.go @@ -0,0 +1,400 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionPackage A base object for all types of listing revision packages. +type ListingRevisionPackage interface { + + // The name of the listing revision package. + GetDisplayName() *string + + // The unique identifier for the listing revision. + GetListingRevisionId() *string + + // The unique identifier for the compartment. + GetCompartmentId() *string + + // The unique identifier for the artifact. + GetArtifactId() *string + + // The unique identifier for the term. + GetTermId() *string + + // The version for the package. + GetPackageVersion() *string + + // The current state for the listing revision package. + GetLifecycleState() ListingRevisionPackageLifecycleStateEnum + + // The current status for the listing revision package. + GetStatus() ListingRevisionPackageStatusEnum + + // Identifies whether security upgrades will be provided for this package. + GetAreSecurityUpgradesProvided() *bool + + // Identifies that this will be default package for the listing revision. + GetIsDefault() *bool + + // The date and time this listing revision package was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + GetTimeCreated() *common.SDKTime + + // The date and time this listing revision package was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + GetTimeUpdated() *common.SDKTime + + // The OCID for the listing revision package in Marketplace Publisher. + GetId() *string + + // The description of this package. + GetDescription() *string + + // Additional metadata key/value pairs for the listing revision package summary. + // For example: + // `{"partnerListingRevisionPackageStatus": "Published","parentListingRevisionPackageId": "1" }` + GetExtendedMetadata() map[string]string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type listingrevisionpackage struct { + JsonData []byte + Id *string `mandatory:"false" json:"id"` + Description *string `mandatory:"false" json:"description"` + ExtendedMetadata map[string]string `mandatory:"false" json:"extendedMetadata"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + DisplayName *string `mandatory:"true" json:"displayName"` + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + ArtifactId *string `mandatory:"true" json:"artifactId"` + TermId *string `mandatory:"true" json:"termId"` + PackageVersion *string `mandatory:"true" json:"packageVersion"` + LifecycleState ListingRevisionPackageLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + Status ListingRevisionPackageStatusEnum `mandatory:"true" json:"status"` + AreSecurityUpgradesProvided *bool `mandatory:"true" json:"areSecurityUpgradesProvided"` + IsDefault *bool `mandatory:"true" json:"isDefault"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + PackageType string `json:"packageType"` +} + +// UnmarshalJSON unmarshals json +func (m *listingrevisionpackage) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerlistingrevisionpackage listingrevisionpackage + s := struct { + Model Unmarshalerlistingrevisionpackage + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DisplayName = s.Model.DisplayName + m.ListingRevisionId = s.Model.ListingRevisionId + m.CompartmentId = s.Model.CompartmentId + m.ArtifactId = s.Model.ArtifactId + m.TermId = s.Model.TermId + m.PackageVersion = s.Model.PackageVersion + m.LifecycleState = s.Model.LifecycleState + m.Status = s.Model.Status + m.AreSecurityUpgradesProvided = s.Model.AreSecurityUpgradesProvided + m.IsDefault = s.Model.IsDefault + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.Id = s.Model.Id + m.Description = s.Model.Description + m.ExtendedMetadata = s.Model.ExtendedMetadata + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.PackageType = s.Model.PackageType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *listingrevisionpackage) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.PackageType { + case "HELM_CHART": + mm := HelmChartPackage{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CONTAINER_IMAGE": + mm := ContainerPackage{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for ListingRevisionPackage: %s.", m.PackageType) + return *m, nil + } +} + +// GetId returns Id +func (m listingrevisionpackage) GetId() *string { + return m.Id +} + +// GetDescription returns Description +func (m listingrevisionpackage) GetDescription() *string { + return m.Description +} + +// GetExtendedMetadata returns ExtendedMetadata +func (m listingrevisionpackage) GetExtendedMetadata() map[string]string { + return m.ExtendedMetadata +} + +// GetFreeformTags returns FreeformTags +func (m listingrevisionpackage) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m listingrevisionpackage) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m listingrevisionpackage) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +// GetDisplayName returns DisplayName +func (m listingrevisionpackage) GetDisplayName() *string { + return m.DisplayName +} + +// GetListingRevisionId returns ListingRevisionId +func (m listingrevisionpackage) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetCompartmentId returns CompartmentId +func (m listingrevisionpackage) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetArtifactId returns ArtifactId +func (m listingrevisionpackage) GetArtifactId() *string { + return m.ArtifactId +} + +// GetTermId returns TermId +func (m listingrevisionpackage) GetTermId() *string { + return m.TermId +} + +// GetPackageVersion returns PackageVersion +func (m listingrevisionpackage) GetPackageVersion() *string { + return m.PackageVersion +} + +// GetLifecycleState returns LifecycleState +func (m listingrevisionpackage) GetLifecycleState() ListingRevisionPackageLifecycleStateEnum { + return m.LifecycleState +} + +// GetStatus returns Status +func (m listingrevisionpackage) GetStatus() ListingRevisionPackageStatusEnum { + return m.Status +} + +// GetAreSecurityUpgradesProvided returns AreSecurityUpgradesProvided +func (m listingrevisionpackage) GetAreSecurityUpgradesProvided() *bool { + return m.AreSecurityUpgradesProvided +} + +// GetIsDefault returns IsDefault +func (m listingrevisionpackage) GetIsDefault() *bool { + return m.IsDefault +} + +// GetTimeCreated returns TimeCreated +func (m listingrevisionpackage) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m listingrevisionpackage) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m listingrevisionpackage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m listingrevisionpackage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionPackageLifecycleStateEnum(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(GetListingRevisionPackageLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionPackageStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetListingRevisionPackageStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListingRevisionPackageLifecycleStateEnum Enum with underlying type: string +type ListingRevisionPackageLifecycleStateEnum string + +// Set of constants representing the allowable values for ListingRevisionPackageLifecycleStateEnum +const ( + ListingRevisionPackageLifecycleStateCreating ListingRevisionPackageLifecycleStateEnum = "CREATING" + ListingRevisionPackageLifecycleStateUpdating ListingRevisionPackageLifecycleStateEnum = "UPDATING" + ListingRevisionPackageLifecycleStateActive ListingRevisionPackageLifecycleStateEnum = "ACTIVE" + ListingRevisionPackageLifecycleStateInactive ListingRevisionPackageLifecycleStateEnum = "INACTIVE" + ListingRevisionPackageLifecycleStateDeleting ListingRevisionPackageLifecycleStateEnum = "DELETING" + ListingRevisionPackageLifecycleStateDeleted ListingRevisionPackageLifecycleStateEnum = "DELETED" + ListingRevisionPackageLifecycleStateFailed ListingRevisionPackageLifecycleStateEnum = "FAILED" +) + +var mappingListingRevisionPackageLifecycleStateEnum = map[string]ListingRevisionPackageLifecycleStateEnum{ + "CREATING": ListingRevisionPackageLifecycleStateCreating, + "UPDATING": ListingRevisionPackageLifecycleStateUpdating, + "ACTIVE": ListingRevisionPackageLifecycleStateActive, + "INACTIVE": ListingRevisionPackageLifecycleStateInactive, + "DELETING": ListingRevisionPackageLifecycleStateDeleting, + "DELETED": ListingRevisionPackageLifecycleStateDeleted, + "FAILED": ListingRevisionPackageLifecycleStateFailed, +} + +var mappingListingRevisionPackageLifecycleStateEnumLowerCase = map[string]ListingRevisionPackageLifecycleStateEnum{ + "creating": ListingRevisionPackageLifecycleStateCreating, + "updating": ListingRevisionPackageLifecycleStateUpdating, + "active": ListingRevisionPackageLifecycleStateActive, + "inactive": ListingRevisionPackageLifecycleStateInactive, + "deleting": ListingRevisionPackageLifecycleStateDeleting, + "deleted": ListingRevisionPackageLifecycleStateDeleted, + "failed": ListingRevisionPackageLifecycleStateFailed, +} + +// GetListingRevisionPackageLifecycleStateEnumValues Enumerates the set of values for ListingRevisionPackageLifecycleStateEnum +func GetListingRevisionPackageLifecycleStateEnumValues() []ListingRevisionPackageLifecycleStateEnum { + values := make([]ListingRevisionPackageLifecycleStateEnum, 0) + for _, v := range mappingListingRevisionPackageLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionPackageLifecycleStateEnumStringValues Enumerates the set of values in String for ListingRevisionPackageLifecycleStateEnum +func GetListingRevisionPackageLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "INACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListingRevisionPackageLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionPackageLifecycleStateEnum(val string) (ListingRevisionPackageLifecycleStateEnum, bool) { + enum, ok := mappingListingRevisionPackageLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListingRevisionPackageStatusEnum Enum with underlying type: string +type ListingRevisionPackageStatusEnum string + +// Set of constants representing the allowable values for ListingRevisionPackageStatusEnum +const ( + ListingRevisionPackageStatusNew ListingRevisionPackageStatusEnum = "NEW" + ListingRevisionPackageStatusPublishInProgress ListingRevisionPackageStatusEnum = "PUBLISH_IN_PROGRESS" + ListingRevisionPackageStatusUnpublishInProgress ListingRevisionPackageStatusEnum = "UNPUBLISH_IN_PROGRESS" + ListingRevisionPackageStatusPublishFailed ListingRevisionPackageStatusEnum = "PUBLISH_FAILED" + ListingRevisionPackageStatusPublished ListingRevisionPackageStatusEnum = "PUBLISHED" + ListingRevisionPackageStatusPublishedAsPrivate ListingRevisionPackageStatusEnum = "PUBLISHED_AS_PRIVATE" + ListingRevisionPackageStatusUnpublished ListingRevisionPackageStatusEnum = "UNPUBLISHED" +) + +var mappingListingRevisionPackageStatusEnum = map[string]ListingRevisionPackageStatusEnum{ + "NEW": ListingRevisionPackageStatusNew, + "PUBLISH_IN_PROGRESS": ListingRevisionPackageStatusPublishInProgress, + "UNPUBLISH_IN_PROGRESS": ListingRevisionPackageStatusUnpublishInProgress, + "PUBLISH_FAILED": ListingRevisionPackageStatusPublishFailed, + "PUBLISHED": ListingRevisionPackageStatusPublished, + "PUBLISHED_AS_PRIVATE": ListingRevisionPackageStatusPublishedAsPrivate, + "UNPUBLISHED": ListingRevisionPackageStatusUnpublished, +} + +var mappingListingRevisionPackageStatusEnumLowerCase = map[string]ListingRevisionPackageStatusEnum{ + "new": ListingRevisionPackageStatusNew, + "publish_in_progress": ListingRevisionPackageStatusPublishInProgress, + "unpublish_in_progress": ListingRevisionPackageStatusUnpublishInProgress, + "publish_failed": ListingRevisionPackageStatusPublishFailed, + "published": ListingRevisionPackageStatusPublished, + "published_as_private": ListingRevisionPackageStatusPublishedAsPrivate, + "unpublished": ListingRevisionPackageStatusUnpublished, +} + +// GetListingRevisionPackageStatusEnumValues Enumerates the set of values for ListingRevisionPackageStatusEnum +func GetListingRevisionPackageStatusEnumValues() []ListingRevisionPackageStatusEnum { + values := make([]ListingRevisionPackageStatusEnum, 0) + for _, v := range mappingListingRevisionPackageStatusEnum { + values = append(values, v) + } + return values +} + +// GetListingRevisionPackageStatusEnumStringValues Enumerates the set of values in String for ListingRevisionPackageStatusEnum +func GetListingRevisionPackageStatusEnumStringValues() []string { + return []string{ + "NEW", + "PUBLISH_IN_PROGRESS", + "UNPUBLISH_IN_PROGRESS", + "PUBLISH_FAILED", + "PUBLISHED", + "PUBLISHED_AS_PRIVATE", + "UNPUBLISHED", + } +} + +// GetMappingListingRevisionPackageStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingRevisionPackageStatusEnum(val string) (ListingRevisionPackageStatusEnum, bool) { + enum, ok := mappingListingRevisionPackageStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/listing_revision_package_collection.go b/marketplacepublisher/listing_revision_package_collection.go new file mode 100644 index 0000000000..5a6de4b88f --- /dev/null +++ b/marketplacepublisher/listing_revision_package_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionPackageCollection Results of package search. Contains Package items. +type ListingRevisionPackageCollection struct { + + // List of package summary. + Items []ListingRevisionPackageSummary `mandatory:"true" json:"items"` +} + +func (m ListingRevisionPackageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionPackageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_package_summary.go b/marketplacepublisher/listing_revision_package_summary.go new file mode 100644 index 0000000000..41914bd17b --- /dev/null +++ b/marketplacepublisher/listing_revision_package_summary.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionPackageSummary The model for a summary of a package. +type ListingRevisionPackageSummary struct { + + // The ID of the listing revision package. + Id *string `mandatory:"true" json:"id"` + + // The ID of the listing revision. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the listing revision package. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The version of the specified package. + PackageVersion *string `mandatory:"true" json:"packageVersion"` + + // The specified package's type. + PackageType PackageTypeEnum `mandatory:"true" json:"packageType"` + + // Identifies whether security upgrades will be provided for this package. + AreSecurityUpgradesProvided *bool `mandatory:"true" json:"areSecurityUpgradesProvided"` + + // The current state of the Package. + LifecycleState ListingRevisionPackageLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The current status of the package. + Status ListingRevisionPackageStatusEnum `mandatory:"true" json:"status"` + + // The date and time the publication package was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the publication package was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2022-09-24T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // 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 ListingRevisionPackageSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionPackageSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPackageTypeEnum(string(m.PackageType)); !ok && m.PackageType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PackageType: %s. Supported values are: %s.", m.PackageType, strings.Join(GetPackageTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionPackageLifecycleStateEnum(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(GetListingRevisionPackageLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionPackageStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetListingRevisionPackageStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_revision_summary.go b/marketplacepublisher/listing_revision_summary.go new file mode 100644 index 0000000000..5d28c68387 --- /dev/null +++ b/marketplacepublisher/listing_revision_summary.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingRevisionSummary The model for a summary of an Oracle Cloud Infrastructure Marketplace Publisher listing revision. +type ListingRevisionSummary struct { + + // The OCID for the listing revision in Marketplace Publisher. + Id *string `mandatory:"true" json:"id"` + + // The OCID for the listing in Marketplace Publisher. + ListingId *string `mandatory:"true" json:"listingId"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the listing revision. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current status of the listing revision. + Status ListingRevisionStatusEnum `mandatory:"true" json:"status"` + + // The current state of the Listing. + LifecycleState ListingRevisionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The listing's package type. + PackageType PackageTypeEnum `mandatory:"true" json:"packageType"` + + // Pricing type of the listing. + PricingType ListingRevisionPricingTypeEnum `mandatory:"true" json:"pricingType"` + + // Categories that the listing revision belongs to. + Categories []string `mandatory:"true" json:"categories"` + + // The date and time the listing revision was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the listing revision was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // A short description of the listing revision. + ShortDescription *string `mandatory:"false" json:"shortDescription"` + + // The tagline of the listing revision. + Tagline *string `mandatory:"false" json:"tagline"` + + Icon *ListingRevisionIconAttachment `mandatory:"false" json:"icon"` + + // The markets where you can deploy the listing. + Markets []string `mandatory:"false" json:"markets"` + + // 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 ListingRevisionSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingRevisionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingRevisionStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetListingRevisionStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionLifecycleStateEnum(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(GetListingRevisionLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingPackageTypeEnum(string(m.PackageType)); !ok && m.PackageType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PackageType: %s. Supported values are: %s.", m.PackageType, strings.Join(GetPackageTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListingRevisionPricingTypeEnum(string(m.PricingType)); !ok && m.PricingType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PricingType: %s. Supported values are: %s.", m.PricingType, strings.Join(GetListingRevisionPricingTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_summary.go b/marketplacepublisher/listing_summary.go new file mode 100644 index 0000000000..5536d775c5 --- /dev/null +++ b/marketplacepublisher/listing_summary.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListingSummary The model for a summary of the publisher listing. +type ListingSummary struct { + + // The unique OCID of the listing. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The listing type of the Listing. + ListingType ListingTypeEnum `mandatory:"true" json:"listingType"` + + // The name of the listing. + Name *string `mandatory:"true" json:"name"` + + // The current state for the Listing. + LifecycleState ListingLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The package type for the listing. + PackageType PackageTypeEnum `mandatory:"true" json:"packageType"` + + // The date and time the listing was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2023-03-27T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the listing was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2023-03-27T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // 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 ListingSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ListingSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListingTypeEnum(string(m.ListingType)); !ok && m.ListingType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ListingType: %s. Supported values are: %s.", m.ListingType, strings.Join(GetListingTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListingLifecycleStateEnum(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(GetListingLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingPackageTypeEnum(string(m.PackageType)); !ok && m.PackageType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PackageType: %s. Supported values are: %s.", m.PackageType, strings.Join(GetPackageTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/listing_type.go b/marketplacepublisher/listing_type.go new file mode 100644 index 0000000000..8cb378f7c3 --- /dev/null +++ b/marketplacepublisher/listing_type.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// ListingTypeEnum Enum with underlying type: string +type ListingTypeEnum string + +// Set of constants representing the allowable values for ListingTypeEnum +const ( + ListingTypeOciApplication ListingTypeEnum = "OCI_APPLICATION" +) + +var mappingListingTypeEnum = map[string]ListingTypeEnum{ + "OCI_APPLICATION": ListingTypeOciApplication, +} + +var mappingListingTypeEnumLowerCase = map[string]ListingTypeEnum{ + "oci_application": ListingTypeOciApplication, +} + +// GetListingTypeEnumValues Enumerates the set of values for ListingTypeEnum +func GetListingTypeEnumValues() []ListingTypeEnum { + values := make([]ListingTypeEnum, 0) + for _, v := range mappingListingTypeEnum { + values = append(values, v) + } + return values +} + +// GetListingTypeEnumStringValues Enumerates the set of values in String for ListingTypeEnum +func GetListingTypeEnumStringValues() []string { + return []string{ + "OCI_APPLICATION", + } +} + +// GetMappingListingTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListingTypeEnum(val string) (ListingTypeEnum, bool) { + enum, ok := mappingListingTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/mark_listing_revision_package_as_default_request_response.go b/marketplacepublisher/mark_listing_revision_package_as_default_request_response.go new file mode 100644 index 0000000000..11c874e74e --- /dev/null +++ b/marketplacepublisher/mark_listing_revision_package_as_default_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// MarkListingRevisionPackageAsDefaultRequest wrapper for the MarkListingRevisionPackageAsDefault operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/MarkListingRevisionPackageAsDefault.go.html to see an example of how to use MarkListingRevisionPackageAsDefaultRequest. +type MarkListingRevisionPackageAsDefaultRequest struct { + + // Unique listing revision package identifier. + ListingRevisionPackageId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionPackageId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request MarkListingRevisionPackageAsDefaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request MarkListingRevisionPackageAsDefaultRequest) 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 MarkListingRevisionPackageAsDefaultRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request MarkListingRevisionPackageAsDefaultRequest) 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 MarkListingRevisionPackageAsDefaultRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarkListingRevisionPackageAsDefaultResponse wrapper for the MarkListingRevisionPackageAsDefault operation +type MarkListingRevisionPackageAsDefaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response MarkListingRevisionPackageAsDefaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response MarkListingRevisionPackageAsDefaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/market.go b/marketplacepublisher/market.go new file mode 100644 index 0000000000..99bd1f53ac --- /dev/null +++ b/marketplacepublisher/market.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Market The model for the market details. +type Market struct { + + // The name of the market. + Name *string `mandatory:"true" json:"name"` + + // The code of the market. + Code *string `mandatory:"true" json:"code"` + + // The category code of the market. + CategoryCode *string `mandatory:"true" json:"categoryCode"` + + // bill to countries for the market. + BillToCountries []string `mandatory:"true" json:"billToCountries"` + + // The current state for the market. + LifecycleState MarketLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the market was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the market was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The realm code of the market. + RealmCode *string `mandatory:"false" json:"realmCode"` +} + +func (m Market) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Market) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingMarketLifecycleStateEnum(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(GetMarketLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarketLifecycleStateEnum Enum with underlying type: string +type MarketLifecycleStateEnum string + +// Set of constants representing the allowable values for MarketLifecycleStateEnum +const ( + MarketLifecycleStateActive MarketLifecycleStateEnum = "ACTIVE" + MarketLifecycleStateInactive MarketLifecycleStateEnum = "INACTIVE" +) + +var mappingMarketLifecycleStateEnum = map[string]MarketLifecycleStateEnum{ + "ACTIVE": MarketLifecycleStateActive, + "INACTIVE": MarketLifecycleStateInactive, +} + +var mappingMarketLifecycleStateEnumLowerCase = map[string]MarketLifecycleStateEnum{ + "active": MarketLifecycleStateActive, + "inactive": MarketLifecycleStateInactive, +} + +// GetMarketLifecycleStateEnumValues Enumerates the set of values for MarketLifecycleStateEnum +func GetMarketLifecycleStateEnumValues() []MarketLifecycleStateEnum { + values := make([]MarketLifecycleStateEnum, 0) + for _, v := range mappingMarketLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetMarketLifecycleStateEnumStringValues Enumerates the set of values in String for MarketLifecycleStateEnum +func GetMarketLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + } +} + +// GetMappingMarketLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingMarketLifecycleStateEnum(val string) (MarketLifecycleStateEnum, bool) { + enum, ok := mappingMarketLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/market_collection.go b/marketplacepublisher/market_collection.go new file mode 100644 index 0000000000..75c6463d67 --- /dev/null +++ b/marketplacepublisher/market_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MarketCollection Results of a market search. Contains the market items. +type MarketCollection struct { + + // List of market summary. + Items []MarketSummary `mandatory:"true" json:"items"` +} + +func (m MarketCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MarketCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/market_summary.go b/marketplacepublisher/market_summary.go new file mode 100644 index 0000000000..f62052a319 --- /dev/null +++ b/marketplacepublisher/market_summary.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MarketSummary The model for the market metadata. +type MarketSummary struct { + + // The name of the product. + Name *string `mandatory:"true" json:"name"` + + // The code of the product. + Code *string `mandatory:"true" json:"code"` + + // The category code for the market. + CategoryCode *string `mandatory:"true" json:"categoryCode"` + + // Bill to countries for the market. + BillToCountries []string `mandatory:"true" json:"billToCountries"` + + // The current state for the market. + LifecycleState MarketLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the market was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the market was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m MarketSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MarketSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingMarketLifecycleStateEnum(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(GetMarketLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/marketplacepublisher_client.go b/marketplacepublisher/marketplacepublisher_client.go new file mode 100644 index 0000000000..f7aacc949e --- /dev/null +++ b/marketplacepublisher/marketplacepublisher_client.go @@ -0,0 +1,4350 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// MarketplacePublisherClient a client for MarketplacePublisher +type MarketplacePublisherClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewMarketplacePublisherClientWithConfigurationProvider Creates a new default MarketplacePublisher client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewMarketplacePublisherClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client MarketplacePublisherClient, err error) { + if enabled := common.CheckForEnabledServices("marketplacepublisher"); !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 newMarketplacePublisherClientFromBaseClient(baseClient, provider) +} + +// NewMarketplacePublisherClientWithOboToken Creates a new default MarketplacePublisher 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 NewMarketplacePublisherClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client MarketplacePublisherClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newMarketplacePublisherClientFromBaseClient(baseClient, configProvider) +} + +func newMarketplacePublisherClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client MarketplacePublisherClient, err error) { + // MarketplacePublisher service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("MarketplacePublisher")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = MarketplacePublisherClient{BaseClient: baseClient} + client.BasePath = "20220901" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *MarketplacePublisherClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("marketplacepublisher", "https://marketplace-publisher.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *MarketplacePublisherClient) 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 *MarketplacePublisherClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ActivateTermVersion Mark the Term Version identified by the id as active +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ActivateTermVersion.go.html to see an example of how to use ActivateTermVersion API. +// A default retry strategy applies to this operation ActivateTermVersion() +func (client MarketplacePublisherClient) ActivateTermVersion(ctx context.Context, request ActivateTermVersionRequest) (response ActivateTermVersionResponse, 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.activateTermVersion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ActivateTermVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ActivateTermVersionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ActivateTermVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ActivateTermVersionResponse") + } + return +} + +// activateTermVersion implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) activateTermVersion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/termVersions/{termVersionId}/actions/Activate", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ActivateTermVersionResponse + 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/publisher/20220901/TermVersion/ActivateTermVersion" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ActivateTermVersion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CancelWorkRequest Cancels the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequest API. +// A default retry strategy applies to this operation CancelWorkRequest() +func (client MarketplacePublisherClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, 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.cancelWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + } + return +} + +// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelWorkRequestResponse + 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/publisher/20220901/WorkRequest/CancelWorkRequest" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CancelWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CascadingDeleteListing Cascade delete the listing and its subresources. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CascadingDeleteListing.go.html to see an example of how to use CascadingDeleteListing API. +// A default retry strategy applies to this operation CascadingDeleteListing() +func (client MarketplacePublisherClient) CascadingDeleteListing(ctx context.Context, request CascadingDeleteListingRequest) (response CascadingDeleteListingResponse, 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.cascadingDeleteListing, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CascadingDeleteListingResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CascadingDeleteListingResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CascadingDeleteListingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CascadingDeleteListingResponse") + } + return +} + +// cascadingDeleteListing implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) cascadingDeleteListing(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listings/{listingId}/actions/cascadingDelete", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CascadingDeleteListingResponse + 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/publisher/20220901/Listing/CascadingDeleteListing" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CascadingDeleteListing", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CascadingDeleteListingRevision Cascade delete listing revision and its subresources. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CascadingDeleteListingRevision.go.html to see an example of how to use CascadingDeleteListingRevision API. +// A default retry strategy applies to this operation CascadingDeleteListingRevision() +func (client MarketplacePublisherClient) CascadingDeleteListingRevision(ctx context.Context, request CascadingDeleteListingRevisionRequest) (response CascadingDeleteListingRevisionResponse, 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.cascadingDeleteListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CascadingDeleteListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CascadingDeleteListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CascadingDeleteListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CascadingDeleteListingRevisionResponse") + } + return +} + +// cascadingDeleteListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) cascadingDeleteListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions/{listingRevisionId}/actions/cascadingDelete", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CascadingDeleteListingRevisionResponse + 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/publisher/20220901/ListingRevision/CascadingDeleteListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CascadingDeleteListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeArtifactCompartment Moves the specified artifact to the specified compartment within the same tenancy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeArtifactCompartment.go.html to see an example of how to use ChangeArtifactCompartment API. +// A default retry strategy applies to this operation ChangeArtifactCompartment() +func (client MarketplacePublisherClient) ChangeArtifactCompartment(ctx context.Context, request ChangeArtifactCompartmentRequest) (response ChangeArtifactCompartmentResponse, 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.changeArtifactCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeArtifactCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeArtifactCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeArtifactCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeArtifactCompartmentResponse") + } + return +} + +// changeArtifactCompartment implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) changeArtifactCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/artifacts/{artifactId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeArtifactCompartmentResponse + 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/publisher/20220901/Artifact/ChangeArtifactCompartment" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ChangeArtifactCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeListingCompartment Moves a listing from one compartment to another +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeListingCompartment.go.html to see an example of how to use ChangeListingCompartment API. +// A default retry strategy applies to this operation ChangeListingCompartment() +func (client MarketplacePublisherClient) ChangeListingCompartment(ctx context.Context, request ChangeListingCompartmentRequest) (response ChangeListingCompartmentResponse, 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.changeListingCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeListingCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeListingCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeListingCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeListingCompartmentResponse") + } + return +} + +// changeListingCompartment implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) changeListingCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listings/{listingId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeListingCompartmentResponse + 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/publisher/20220901/Listing/ChangeListingCompartment" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ChangeListingCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeListingRevisionToNewStatus Updates the Listing Revision to New status +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeListingRevisionToNewStatus.go.html to see an example of how to use ChangeListingRevisionToNewStatus API. +// A default retry strategy applies to this operation ChangeListingRevisionToNewStatus() +func (client MarketplacePublisherClient) ChangeListingRevisionToNewStatus(ctx context.Context, request ChangeListingRevisionToNewStatusRequest) (response ChangeListingRevisionToNewStatusResponse, 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.changeListingRevisionToNewStatus, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeListingRevisionToNewStatusResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeListingRevisionToNewStatusResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeListingRevisionToNewStatusResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeListingRevisionToNewStatusResponse") + } + return +} + +// changeListingRevisionToNewStatus implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) changeListingRevisionToNewStatus(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions/{listingRevisionId}/actions/changeToNewStatus", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeListingRevisionToNewStatusResponse + 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/publisher/20220901/ListingRevision/ChangeListingRevisionToNewStatus" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ChangeListingRevisionToNewStatus", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeTermCompartment Moves a term from one compartment to another +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ChangeTermCompartment.go.html to see an example of how to use ChangeTermCompartment API. +// A default retry strategy applies to this operation ChangeTermCompartment() +func (client MarketplacePublisherClient) ChangeTermCompartment(ctx context.Context, request ChangeTermCompartmentRequest) (response ChangeTermCompartmentResponse, 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.changeTermCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeTermCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeTermCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeTermCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeTermCompartmentResponse") + } + return +} + +// changeTermCompartment implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) changeTermCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/terms/{termId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeTermCompartmentResponse + 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/publisher/20220901/Term/ChangeTermCompartment" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ChangeTermCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CloneListingRevision Clone the published/withdrawn Listing Revision identified by the identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CloneListingRevision.go.html to see an example of how to use CloneListingRevision API. +// A default retry strategy applies to this operation CloneListingRevision() +func (client MarketplacePublisherClient) CloneListingRevision(ctx context.Context, request CloneListingRevisionRequest) (response CloneListingRevisionResponse, 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.cloneListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CloneListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CloneListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CloneListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CloneListingRevisionResponse") + } + return +} + +// cloneListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) cloneListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions/{listingRevisionId}/actions/clone", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CloneListingRevisionResponse + 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/publisher/20220901/ListingRevision/CloneListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CloneListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateArtifact Creates a new artifact in your compartment. +// You must specify your compartment ID in the request object. +// You must also specify a *name* for the artifact(although it can be an empty string). It does not +// have to be unique, and you can change it anytime with UpdateArtifact.. +// You must also specify a *artifactType* for the artifact. Allowed values are CONTAINER_IMAGE and HELM_CHART +// You must also provide the container or helm chart registry details for the corresponding images. +// Oracle container registry details (Registry/Concepts/registryoverview.htm). +// After you send your request, the new object's `status` will temporarily be IN_PROGRESS and `lifecycleState` will be CREATING. +// Before using the object, first make sure its `lifecycleState` has changed to ACTIVE and the status has changed to ‘AVAILABLE’ for the new Artifact. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateArtifact.go.html to see an example of how to use CreateArtifact API. +// A default retry strategy applies to this operation CreateArtifact() +func (client MarketplacePublisherClient) CreateArtifact(ctx context.Context, request CreateArtifactRequest) (response CreateArtifactResponse, 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.createArtifact, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateArtifactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateArtifactResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateArtifactResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateArtifactResponse") + } + return +} + +// createArtifact implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createArtifact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/artifacts", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateArtifactResponse + 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/publisher/20220901/Artifact/CreateArtifact" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateArtifact", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateListing Creates a new listing in your compartment. +// You must specify your compartment ID in the request object. +// You must also specify a *name* for the listing and cannot be updated later. +// You must also specify a *packageType* for the listing. Allowed values are CONTAINER_IMAGE and HELM_CHART +// After you send your request, the new object's `lifecycleState` will be CREATING. +// Before using the object, first make sure its `lifecycleState` has changed to ACTIVE. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListing.go.html to see an example of how to use CreateListing API. +// A default retry strategy applies to this operation CreateListing() +func (client MarketplacePublisherClient) CreateListing(ctx context.Context, request CreateListingRequest) (response CreateListingResponse, 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.createListing, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateListingResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateListingResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateListingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateListingResponse") + } + return +} + +// createListing implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createListing(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listings", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateListingResponse + 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/publisher/20220901/Listing/CreateListing" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateListing", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateListingRevision Creates a new Listing Revision. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevision.go.html to see an example of how to use CreateListingRevision API. +// A default retry strategy applies to this operation CreateListingRevision() +func (client MarketplacePublisherClient) CreateListingRevision(ctx context.Context, request CreateListingRevisionRequest) (response CreateListingRevisionResponse, 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.createListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateListingRevisionResponse") + } + return +} + +// createListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateListingRevisionResponse + 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/publisher/20220901/ListingRevision/CreateListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateListingRevisionAttachment Creates a new listing revision attachment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevisionAttachment.go.html to see an example of how to use CreateListingRevisionAttachment API. +// A default retry strategy applies to this operation CreateListingRevisionAttachment() +func (client MarketplacePublisherClient) CreateListingRevisionAttachment(ctx context.Context, request CreateListingRevisionAttachmentRequest) (response CreateListingRevisionAttachmentResponse, 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.createListingRevisionAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateListingRevisionAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateListingRevisionAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateListingRevisionAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateListingRevisionAttachmentResponse") + } + return +} + +// createListingRevisionAttachment implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createListingRevisionAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisionAttachments", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateListingRevisionAttachmentResponse + 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/publisher/20220901/ListingRevisionAttachment/CreateListingRevisionAttachment" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateListingRevisionAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listingrevisionattachment{}) + return response, err +} + +// CreateListingRevisionNote Creates a new Listing Revision Note. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevisionNote.go.html to see an example of how to use CreateListingRevisionNote API. +// A default retry strategy applies to this operation CreateListingRevisionNote() +func (client MarketplacePublisherClient) CreateListingRevisionNote(ctx context.Context, request CreateListingRevisionNoteRequest) (response CreateListingRevisionNoteResponse, 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.createListingRevisionNote, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateListingRevisionNoteResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateListingRevisionNoteResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateListingRevisionNoteResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateListingRevisionNoteResponse") + } + return +} + +// createListingRevisionNote implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createListingRevisionNote(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisionNotes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateListingRevisionNoteResponse + 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/publisher/20220901/ListingRevisionNote/CreateListingRevisionNote" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateListingRevisionNote", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateListingRevisionPackage Creates a new Listing Revision Package. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateListingRevisionPackage.go.html to see an example of how to use CreateListingRevisionPackage API. +// A default retry strategy applies to this operation CreateListingRevisionPackage() +func (client MarketplacePublisherClient) CreateListingRevisionPackage(ctx context.Context, request CreateListingRevisionPackageRequest) (response CreateListingRevisionPackageResponse, 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.createListingRevisionPackage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateListingRevisionPackageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateListingRevisionPackageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateListingRevisionPackageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateListingRevisionPackageResponse") + } + return +} + +// createListingRevisionPackage implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createListingRevisionPackage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisionPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateListingRevisionPackageResponse + 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/publisher/20220901/ListingRevisionPackage/CreateListingRevisionPackage" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateListingRevisionPackage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listingrevisionpackage{}) + return response, err +} + +// CreateTerm Creates a new Term. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateTerm.go.html to see an example of how to use CreateTerm API. +// A default retry strategy applies to this operation CreateTerm() +func (client MarketplacePublisherClient) CreateTerm(ctx context.Context, request CreateTermRequest) (response CreateTermResponse, 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.createTerm, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateTermResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateTermResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateTermResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateTermResponse") + } + return +} + +// createTerm implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createTerm(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/terms", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateTermResponse + 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/publisher/20220901/Term/CreateTerm" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateTerm", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateTermVersion Creates a new Term Version. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/CreateTermVersion.go.html to see an example of how to use CreateTermVersion API. +// A default retry strategy applies to this operation CreateTermVersion() +func (client MarketplacePublisherClient) CreateTermVersion(ctx context.Context, request CreateTermVersionRequest) (response CreateTermVersionResponse, 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.createTermVersion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateTermVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateTermVersionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateTermVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateTermVersionResponse") + } + return +} + +// createTermVersion implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) createTermVersion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/termVersions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateTermVersionResponse + 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/publisher/20220901/TermVersion/CreateTermVersion" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "CreateTermVersion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteArtifact Deletes the specified artifact. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteArtifact.go.html to see an example of how to use DeleteArtifact API. +// A default retry strategy applies to this operation DeleteArtifact() +func (client MarketplacePublisherClient) DeleteArtifact(ctx context.Context, request DeleteArtifactRequest) (response DeleteArtifactResponse, 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.deleteArtifact, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteArtifactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteArtifactResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteArtifactResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteArtifactResponse") + } + return +} + +// deleteArtifact implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteArtifact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/artifacts/{artifactId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteArtifactResponse + 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/publisher/20220901/Artifact/DeleteArtifact" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteArtifact", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteListing Deletes a listing by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListing.go.html to see an example of how to use DeleteListing API. +// A default retry strategy applies to this operation DeleteListing() +func (client MarketplacePublisherClient) DeleteListing(ctx context.Context, request DeleteListingRequest) (response DeleteListingResponse, 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.deleteListing, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteListingResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteListingResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteListingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteListingResponse") + } + return +} + +// deleteListing implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteListing(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/listings/{listingId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteListingResponse + 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/publisher/20220901/Listing/DeleteListing" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteListing", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteListingRevision Deletes a listing by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevision.go.html to see an example of how to use DeleteListingRevision API. +// A default retry strategy applies to this operation DeleteListingRevision() +func (client MarketplacePublisherClient) DeleteListingRevision(ctx context.Context, request DeleteListingRevisionRequest) (response DeleteListingRevisionResponse, 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.deleteListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteListingRevisionResponse") + } + return +} + +// deleteListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/listingRevisions/{listingRevisionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteListingRevisionResponse + 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/publisher/20220901/ListingRevision/DeleteListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteListingRevisionAttachment Deletes a listing revision attachment by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevisionAttachment.go.html to see an example of how to use DeleteListingRevisionAttachment API. +// A default retry strategy applies to this operation DeleteListingRevisionAttachment() +func (client MarketplacePublisherClient) DeleteListingRevisionAttachment(ctx context.Context, request DeleteListingRevisionAttachmentRequest) (response DeleteListingRevisionAttachmentResponse, 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.deleteListingRevisionAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteListingRevisionAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteListingRevisionAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteListingRevisionAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteListingRevisionAttachmentResponse") + } + return +} + +// deleteListingRevisionAttachment implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteListingRevisionAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/listingRevisionAttachments/{listingRevisionAttachmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteListingRevisionAttachmentResponse + 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/publisher/20220901/ListingRevisionAttachment/DeleteListingRevisionAttachment" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteListingRevisionAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteListingRevisionNote Deletes a listing revision note by the identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevisionNote.go.html to see an example of how to use DeleteListingRevisionNote API. +// A default retry strategy applies to this operation DeleteListingRevisionNote() +func (client MarketplacePublisherClient) DeleteListingRevisionNote(ctx context.Context, request DeleteListingRevisionNoteRequest) (response DeleteListingRevisionNoteResponse, 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.deleteListingRevisionNote, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteListingRevisionNoteResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteListingRevisionNoteResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteListingRevisionNoteResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteListingRevisionNoteResponse") + } + return +} + +// deleteListingRevisionNote implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteListingRevisionNote(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/listingRevisionNotes/{listingRevisionNoteId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteListingRevisionNoteResponse + 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/publisher/20220901/ListingRevisionNote/DeleteListingRevisionNote" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteListingRevisionNote", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteListingRevisionPackage Deletes a listing revision package by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteListingRevisionPackage.go.html to see an example of how to use DeleteListingRevisionPackage API. +// A default retry strategy applies to this operation DeleteListingRevisionPackage() +func (client MarketplacePublisherClient) DeleteListingRevisionPackage(ctx context.Context, request DeleteListingRevisionPackageRequest) (response DeleteListingRevisionPackageResponse, 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.deleteListingRevisionPackage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteListingRevisionPackageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteListingRevisionPackageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteListingRevisionPackageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteListingRevisionPackageResponse") + } + return +} + +// deleteListingRevisionPackage implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteListingRevisionPackage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/listingRevisionPackages/{listingRevisionPackageId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteListingRevisionPackageResponse + 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/publisher/20220901/ListingRevisionPackage/DeleteListingRevisionPackage" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteListingRevisionPackage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteTerm Deletes a Term by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteTerm.go.html to see an example of how to use DeleteTerm API. +// A default retry strategy applies to this operation DeleteTerm() +func (client MarketplacePublisherClient) DeleteTerm(ctx context.Context, request DeleteTermRequest) (response DeleteTermResponse, 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.deleteTerm, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteTermResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteTermResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteTermResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteTermResponse") + } + return +} + +// deleteTerm implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteTerm(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/terms/{termId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteTermResponse + 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/publisher/20220901/Term/DeleteTerm" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteTerm", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteTermVersion Deletes a Term by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/DeleteTermVersion.go.html to see an example of how to use DeleteTermVersion API. +// A default retry strategy applies to this operation DeleteTermVersion() +func (client MarketplacePublisherClient) DeleteTermVersion(ctx context.Context, request DeleteTermVersionRequest) (response DeleteTermVersionResponse, 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.deleteTermVersion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteTermVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteTermVersionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteTermVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteTermVersionResponse") + } + return +} + +// deleteTermVersion implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) deleteTermVersion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/termVersions/{termVersionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteTermVersionResponse + 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/publisher/20220901/TermVersion/DeleteTermVersion" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "DeleteTermVersion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetArtifact Gets the specified artifact's information. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetArtifact.go.html to see an example of how to use GetArtifact API. +// A default retry strategy applies to this operation GetArtifact() +func (client MarketplacePublisherClient) GetArtifact(ctx context.Context, request GetArtifactRequest) (response GetArtifactResponse, 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.getArtifact, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetArtifactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetArtifactResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetArtifactResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetArtifactResponse") + } + return +} + +// getArtifact implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getArtifact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/artifacts/{artifactId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetArtifactResponse + 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/publisher/20220901/Artifact/GetArtifact" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetArtifact", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &artifact{}) + return response, err +} + +// GetCategory Gets the specified category's information. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetCategory.go.html to see an example of how to use GetCategory API. +// A default retry strategy applies to this operation GetCategory() +func (client MarketplacePublisherClient) GetCategory(ctx context.Context, request GetCategoryRequest) (response GetCategoryResponse, 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.getCategory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCategoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCategoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCategoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCategoryResponse") + } + return +} + +// getCategory implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getCategory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/categories/{categoryCode}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCategoryResponse + 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/publisher/20220901/Category/GetCategory" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetCategory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetListing Gets the details for a listing. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListing.go.html to see an example of how to use GetListing API. +// A default retry strategy applies to this operation GetListing() +func (client MarketplacePublisherClient) GetListing(ctx context.Context, request GetListingRequest) (response GetListingResponse, 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.getListing, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetListingResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetListingResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetListingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetListingResponse") + } + return +} + +// getListing implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getListing(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listings/{listingId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetListingResponse + 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/publisher/20220901/Listing/GetListing" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetListing", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetListingRevision Gets the details for a listing revision. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevision.go.html to see an example of how to use GetListingRevision API. +// A default retry strategy applies to this operation GetListingRevision() +func (client MarketplacePublisherClient) GetListingRevision(ctx context.Context, request GetListingRevisionRequest) (response GetListingRevisionResponse, 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.getListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetListingRevisionResponse") + } + return +} + +// getListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisions/{listingRevisionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetListingRevisionResponse + 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/publisher/20220901/ListingRevision/GetListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetListingRevisionAttachment Get the details of the specified listing revision attachment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevisionAttachment.go.html to see an example of how to use GetListingRevisionAttachment API. +// A default retry strategy applies to this operation GetListingRevisionAttachment() +func (client MarketplacePublisherClient) GetListingRevisionAttachment(ctx context.Context, request GetListingRevisionAttachmentRequest) (response GetListingRevisionAttachmentResponse, 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.getListingRevisionAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetListingRevisionAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetListingRevisionAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetListingRevisionAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetListingRevisionAttachmentResponse") + } + return +} + +// getListingRevisionAttachment implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getListingRevisionAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisionAttachments/{listingRevisionAttachmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetListingRevisionAttachmentResponse + 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/publisher/20220901/ListingRevisionAttachment/GetListingRevisionAttachment" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetListingRevisionAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listingrevisionattachment{}) + return response, err +} + +// GetListingRevisionNote Get note details by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevisionNote.go.html to see an example of how to use GetListingRevisionNote API. +// A default retry strategy applies to this operation GetListingRevisionNote() +func (client MarketplacePublisherClient) GetListingRevisionNote(ctx context.Context, request GetListingRevisionNoteRequest) (response GetListingRevisionNoteResponse, 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.getListingRevisionNote, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetListingRevisionNoteResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetListingRevisionNoteResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetListingRevisionNoteResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetListingRevisionNoteResponse") + } + return +} + +// getListingRevisionNote implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getListingRevisionNote(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisionNotes/{listingRevisionNoteId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetListingRevisionNoteResponse + 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/publisher/20220901/ListingRevisionNote/GetListingRevisionNote" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetListingRevisionNote", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetListingRevisionPackage Get the details of the specified version of a package. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetListingRevisionPackage.go.html to see an example of how to use GetListingRevisionPackage API. +// A default retry strategy applies to this operation GetListingRevisionPackage() +func (client MarketplacePublisherClient) GetListingRevisionPackage(ctx context.Context, request GetListingRevisionPackageRequest) (response GetListingRevisionPackageResponse, 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.getListingRevisionPackage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetListingRevisionPackageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetListingRevisionPackageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetListingRevisionPackageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetListingRevisionPackageResponse") + } + return +} + +// getListingRevisionPackage implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getListingRevisionPackage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisionPackages/{listingRevisionPackageId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetListingRevisionPackageResponse + 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/publisher/20220901/ListingRevisionPackage/GetListingRevisionPackage" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetListingRevisionPackage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listingrevisionpackage{}) + return response, err +} + +// GetMarket Gets the specified market's information. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetMarket.go.html to see an example of how to use GetMarket API. +// A default retry strategy applies to this operation GetMarket() +func (client MarketplacePublisherClient) GetMarket(ctx context.Context, request GetMarketRequest) (response GetMarketResponse, 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.getMarket, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetMarketResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetMarketResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetMarketResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMarketResponse") + } + return +} + +// getMarket implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getMarket(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/markets/{marketCode}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetMarketResponse + 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/publisher/20220901/Market/GetMarket" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetMarket", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetProduct Gets a Product by code identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetProduct.go.html to see an example of how to use GetProduct API. +// A default retry strategy applies to this operation GetProduct() +func (client MarketplacePublisherClient) GetProduct(ctx context.Context, request GetProductRequest) (response GetProductResponse, 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.getProduct, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetProductResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetProductResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetProductResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetProductResponse") + } + return +} + +// getProduct implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getProduct(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/products/{productCode}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetProductResponse + 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/publisher/20220901/Product/GetProduct" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetProduct", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPublisher Gets a Publisher by identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetPublisher.go.html to see an example of how to use GetPublisher API. +// A default retry strategy applies to this operation GetPublisher() +func (client MarketplacePublisherClient) GetPublisher(ctx context.Context, request GetPublisherRequest) (response GetPublisherResponse, 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.getPublisher, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetPublisherResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetPublisherResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetPublisherResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPublisherResponse") + } + return +} + +// getPublisher implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getPublisher(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/publishers/{publisherId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetPublisherResponse + 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/publisher/20220901/Publisher/GetPublisher" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetPublisher", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTerm Gets a Term by identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetTerm.go.html to see an example of how to use GetTerm API. +// A default retry strategy applies to this operation GetTerm() +func (client MarketplacePublisherClient) GetTerm(ctx context.Context, request GetTermRequest) (response GetTermResponse, 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.getTerm, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetTermResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetTermResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetTermResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTermResponse") + } + return +} + +// getTerm implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getTerm(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/terms/{termId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetTermResponse + 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/publisher/20220901/Term/GetTerm" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetTerm", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTermVersion Gets a Term Version by the identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetTermVersion.go.html to see an example of how to use GetTermVersion API. +// A default retry strategy applies to this operation GetTermVersion() +func (client MarketplacePublisherClient) GetTermVersion(ctx context.Context, request GetTermVersionRequest) (response GetTermVersionResponse, 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.getTermVersion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetTermVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetTermVersionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetTermVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTermVersionResponse") + } + return +} + +// getTermVersion implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getTermVersion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/termVersions/{termVersionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetTermVersionResponse + 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/publisher/20220901/TermVersion/GetTermVersion" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetTermVersion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets details of the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client MarketplacePublisherClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/publisher/20220901/WorkRequest/GetWorkRequest" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListArtifacts Lists the artifacts in your compartment. You must specify your compartment's OCID as the value for +// the compartment ID. +// For information about OCIDs, see Resource Identifiers (Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListArtifacts.go.html to see an example of how to use ListArtifacts API. +// A default retry strategy applies to this operation ListArtifacts() +func (client MarketplacePublisherClient) ListArtifacts(ctx context.Context, request ListArtifactsRequest) (response ListArtifactsResponse, 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.listArtifacts, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListArtifactsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListArtifactsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListArtifactsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListArtifactsResponse") + } + return +} + +// listArtifacts implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listArtifacts(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/artifacts", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListArtifactsResponse + 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/publisher/20220901/ArtifactCollection/ListArtifacts" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListArtifacts", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCategories Lists the categories in your compartment. You must specify your compartment's OCID as the value for +// the compartment ID. +// For information about OCIDs, see Resource Identifiers (Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListCategories.go.html to see an example of how to use ListCategories API. +// A default retry strategy applies to this operation ListCategories() +func (client MarketplacePublisherClient) ListCategories(ctx context.Context, request ListCategoriesRequest) (response ListCategoriesResponse, 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.listCategories, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCategoriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCategoriesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCategoriesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCategoriesResponse") + } + return +} + +// listCategories implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listCategories(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/categories", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCategoriesResponse + 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/publisher/20220901/CategoryCollection/ListCategories" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListCategories", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListListingRevisionAttachments Gets the list of attachments for a listing revision in a compartment +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisionAttachments.go.html to see an example of how to use ListListingRevisionAttachments API. +// A default retry strategy applies to this operation ListListingRevisionAttachments() +func (client MarketplacePublisherClient) ListListingRevisionAttachments(ctx context.Context, request ListListingRevisionAttachmentsRequest) (response ListListingRevisionAttachmentsResponse, 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.listListingRevisionAttachments, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListListingRevisionAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListListingRevisionAttachmentsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListListingRevisionAttachmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListListingRevisionAttachmentsResponse") + } + return +} + +// listListingRevisionAttachments implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listListingRevisionAttachments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisionAttachments", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListListingRevisionAttachmentsResponse + 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/publisher/20220901/ListingRevisionAttachmentCollection/ListListingRevisionAttachments" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListListingRevisionAttachments", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListListingRevisionNotes Gets the list of notes for a listing revision. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisionNotes.go.html to see an example of how to use ListListingRevisionNotes API. +// A default retry strategy applies to this operation ListListingRevisionNotes() +func (client MarketplacePublisherClient) ListListingRevisionNotes(ctx context.Context, request ListListingRevisionNotesRequest) (response ListListingRevisionNotesResponse, 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.listListingRevisionNotes, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListListingRevisionNotesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListListingRevisionNotesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListListingRevisionNotesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListListingRevisionNotesResponse") + } + return +} + +// listListingRevisionNotes implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listListingRevisionNotes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisionNotes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListListingRevisionNotesResponse + 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/publisher/20220901/ListingRevisionNoteCollection/ListListingRevisionNotes" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListListingRevisionNotes", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListListingRevisionPackages Gets the list of packages for a listing revision. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisionPackages.go.html to see an example of how to use ListListingRevisionPackages API. +// A default retry strategy applies to this operation ListListingRevisionPackages() +func (client MarketplacePublisherClient) ListListingRevisionPackages(ctx context.Context, request ListListingRevisionPackagesRequest) (response ListListingRevisionPackagesResponse, 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.listListingRevisionPackages, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListListingRevisionPackagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListListingRevisionPackagesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListListingRevisionPackagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListListingRevisionPackagesResponse") + } + return +} + +// listListingRevisionPackages implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listListingRevisionPackages(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisionPackages", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListListingRevisionPackagesResponse + 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/publisher/20220901/ListingRevisionPackageCollection/ListListingRevisionPackages" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListListingRevisionPackages", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListListingRevisions Lists the list of listing revisions for a specific listing ID, compartment ID or listing revision status. +// You can specify your compartment's OCID as the value for the compartment ID. +// For information about OCIDs, see Resource Identifiers (Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListingRevisions.go.html to see an example of how to use ListListingRevisions API. +// A default retry strategy applies to this operation ListListingRevisions() +func (client MarketplacePublisherClient) ListListingRevisions(ctx context.Context, request ListListingRevisionsRequest) (response ListListingRevisionsResponse, 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.listListingRevisions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListListingRevisionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListListingRevisionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListListingRevisionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListListingRevisionsResponse") + } + return +} + +// listListingRevisions implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listListingRevisions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listingRevisions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListListingRevisionsResponse + 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/publisher/20220901/ListingRevisionCollection/ListListingRevisions" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListListingRevisions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListListings Lists the listings in your compartment. You must specify your compartment's OCID as the value for +// the compartment ID. +// For information about OCIDs, see Resource Identifiers (Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListListings.go.html to see an example of how to use ListListings API. +// A default retry strategy applies to this operation ListListings() +func (client MarketplacePublisherClient) ListListings(ctx context.Context, request ListListingsRequest) (response ListListingsResponse, 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.listListings, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListListingsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListListingsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListListingsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListListingsResponse") + } + return +} + +// listListings implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listListings(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/listings", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListListingsResponse + 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/publisher/20220901/ListingCollection/ListListings" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListListings", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMarkets Lists the markets in your compartment. You must specify your compartment's OCID as the value for +// the compartment ID. +// For information about OCIDs, see Resource Identifiers (Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListMarkets.go.html to see an example of how to use ListMarkets API. +// A default retry strategy applies to this operation ListMarkets() +func (client MarketplacePublisherClient) ListMarkets(ctx context.Context, request ListMarketsRequest) (response ListMarketsResponse, 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.listMarkets, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMarketsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMarketsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMarketsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMarketsResponse") + } + return +} + +// listMarkets implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listMarkets(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/markets", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMarketsResponse + 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/publisher/20220901/MarketCollection/ListMarkets" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListMarkets", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListProducts Lists the products in your compartment. You must specify your compartment's OCID as the value for +// the compartment ID. +// For information about OCIDs, see Resource Identifiers (Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListProducts.go.html to see an example of how to use ListProducts API. +// A default retry strategy applies to this operation ListProducts() +func (client MarketplacePublisherClient) ListProducts(ctx context.Context, request ListProductsRequest) (response ListProductsResponse, 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.listProducts, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListProductsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListProductsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListProductsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListProductsResponse") + } + return +} + +// listProducts implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listProducts(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/products", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListProductsResponse + 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/publisher/20220901/ProductCollection/ListProducts" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListProducts", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPublishers Returns a list of publishers. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListPublishers.go.html to see an example of how to use ListPublishers API. +// A default retry strategy applies to this operation ListPublishers() +func (client MarketplacePublisherClient) ListPublishers(ctx context.Context, request ListPublishersRequest) (response ListPublishersResponse, 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.listPublishers, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListPublishersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListPublishersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListPublishersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPublishersResponse") + } + return +} + +// listPublishers implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listPublishers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/publishers", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListPublishersResponse + 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/publisher/20220901/PublisherCollection/ListPublishers" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListPublishers", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListTermVersions Returns a list of the publisher term versions. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListTermVersions.go.html to see an example of how to use ListTermVersions API. +// A default retry strategy applies to this operation ListTermVersions() +func (client MarketplacePublisherClient) ListTermVersions(ctx context.Context, request ListTermVersionsRequest) (response ListTermVersionsResponse, 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.listTermVersions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListTermVersionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListTermVersionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListTermVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListTermVersionsResponse") + } + return +} + +// listTermVersions implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listTermVersions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/termVersions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListTermVersionsResponse + 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/publisher/20220901/TermVersionCollection/ListTermVersions" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListTermVersions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListTerms Returns a list of the publisher terms. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListTerms.go.html to see an example of how to use ListTerms API. +// A default retry strategy applies to this operation ListTerms() +func (client MarketplacePublisherClient) ListTerms(ctx context.Context, request ListTermsRequest) (response ListTermsResponse, 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.listTerms, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListTermsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListTermsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListTermsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListTermsResponse") + } + return +} + +// listTerms implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listTerms(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/terms", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListTermsResponse + 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/publisher/20220901/TermCollection/ListTerms" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListTerms", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Returns a (paginated) list of errors for the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client MarketplacePublisherClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/publisher/20220901/WorkRequestError/ListWorkRequestErrors" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Returns a (paginated) list of logs for the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client MarketplacePublisherClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/publisher/20220901/WorkRequestLogEntry/ListWorkRequestLogs" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in a compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client MarketplacePublisherClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/publisher/20220901/WorkRequest/ListWorkRequests" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// MarkListingRevisionPackageAsDefault Mark the Listing Revision Package identified by the id and package version as default +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/MarkListingRevisionPackageAsDefault.go.html to see an example of how to use MarkListingRevisionPackageAsDefault API. +// A default retry strategy applies to this operation MarkListingRevisionPackageAsDefault() +func (client MarketplacePublisherClient) MarkListingRevisionPackageAsDefault(ctx context.Context, request MarkListingRevisionPackageAsDefaultRequest) (response MarkListingRevisionPackageAsDefaultResponse, 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.markListingRevisionPackageAsDefault, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = MarkListingRevisionPackageAsDefaultResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = MarkListingRevisionPackageAsDefaultResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(MarkListingRevisionPackageAsDefaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into MarkListingRevisionPackageAsDefaultResponse") + } + return +} + +// markListingRevisionPackageAsDefault implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) markListingRevisionPackageAsDefault(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisionPackages/{listingRevisionPackageId}/actions/markAsDefault", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response MarkListingRevisionPackageAsDefaultResponse + 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/publisher/20220901/ListingRevisionPackage/MarkListingRevisionPackageAsDefault" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "MarkListingRevisionPackageAsDefault", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PublishListingRevision Publish the Listing revision identified by Identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/PublishListingRevision.go.html to see an example of how to use PublishListingRevision API. +// A default retry strategy applies to this operation PublishListingRevision() +func (client MarketplacePublisherClient) PublishListingRevision(ctx context.Context, request PublishListingRevisionRequest) (response PublishListingRevisionResponse, 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.publishListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PublishListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PublishListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PublishListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PublishListingRevisionResponse") + } + return +} + +// publishListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) publishListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions/{listingRevisionId}/actions/publish", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PublishListingRevisionResponse + 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/publisher/20220901/ListingRevision/PublishListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "PublishListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PublishListingRevisionAsPrivate Updates the Listing Revision to PublishAsPrivate +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/PublishListingRevisionAsPrivate.go.html to see an example of how to use PublishListingRevisionAsPrivate API. +// A default retry strategy applies to this operation PublishListingRevisionAsPrivate() +func (client MarketplacePublisherClient) PublishListingRevisionAsPrivate(ctx context.Context, request PublishListingRevisionAsPrivateRequest) (response PublishListingRevisionAsPrivateResponse, 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.publishListingRevisionAsPrivate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PublishListingRevisionAsPrivateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PublishListingRevisionAsPrivateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PublishListingRevisionAsPrivateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PublishListingRevisionAsPrivateResponse") + } + return +} + +// publishListingRevisionAsPrivate implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) publishListingRevisionAsPrivate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions/{listingRevisionId}/actions/publishAsPrivate", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PublishListingRevisionAsPrivateResponse + 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/publisher/20220901/ListingRevision/PublishListingRevisionAsPrivate" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "PublishListingRevisionAsPrivate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PublishListingRevisionPackage Updates the Listing Revision Package to publish status +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/PublishListingRevisionPackage.go.html to see an example of how to use PublishListingRevisionPackage API. +// A default retry strategy applies to this operation PublishListingRevisionPackage() +func (client MarketplacePublisherClient) PublishListingRevisionPackage(ctx context.Context, request PublishListingRevisionPackageRequest) (response PublishListingRevisionPackageResponse, 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.publishListingRevisionPackage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PublishListingRevisionPackageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PublishListingRevisionPackageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PublishListingRevisionPackageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PublishListingRevisionPackageResponse") + } + return +} + +// publishListingRevisionPackage implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) publishListingRevisionPackage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisionPackages/{listingRevisionPackageId}/actions/publish", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PublishListingRevisionPackageResponse + 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/publisher/20220901/ListingRevisionPackage/PublishListingRevisionPackage" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "PublishListingRevisionPackage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SubmitListingRevisionForReview Update the Listing Revision identified by the id for review +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/SubmitListingRevisionForReview.go.html to see an example of how to use SubmitListingRevisionForReview API. +// A default retry strategy applies to this operation SubmitListingRevisionForReview() +func (client MarketplacePublisherClient) SubmitListingRevisionForReview(ctx context.Context, request SubmitListingRevisionForReviewRequest) (response SubmitListingRevisionForReviewResponse, 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.submitListingRevisionForReview, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SubmitListingRevisionForReviewResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SubmitListingRevisionForReviewResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SubmitListingRevisionForReviewResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SubmitListingRevisionForReviewResponse") + } + return +} + +// submitListingRevisionForReview implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) submitListingRevisionForReview(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions/{listingRevisionId}/actions/submitForReview", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SubmitListingRevisionForReviewResponse + 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/publisher/20220901/ListingRevision/SubmitListingRevisionForReview" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "SubmitListingRevisionForReview", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UnPublishListingRevisionPackage Updates the Listing Revision Package to Unpublish status +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UnPublishListingRevisionPackage.go.html to see an example of how to use UnPublishListingRevisionPackage API. +// A default retry strategy applies to this operation UnPublishListingRevisionPackage() +func (client MarketplacePublisherClient) UnPublishListingRevisionPackage(ctx context.Context, request UnPublishListingRevisionPackageRequest) (response UnPublishListingRevisionPackageResponse, 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.unPublishListingRevisionPackage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UnPublishListingRevisionPackageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UnPublishListingRevisionPackageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UnPublishListingRevisionPackageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UnPublishListingRevisionPackageResponse") + } + return +} + +// unPublishListingRevisionPackage implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) unPublishListingRevisionPackage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisionPackages/{listingRevisionPackageId}/actions/unPublish", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UnPublishListingRevisionPackageResponse + 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/publisher/20220901/ListingRevisionPackage/UnPublishListingRevisionPackage" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UnPublishListingRevisionPackage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateArtifact Updates the specified artifact identified by the id. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateArtifact.go.html to see an example of how to use UpdateArtifact API. +// A default retry strategy applies to this operation UpdateArtifact() +func (client MarketplacePublisherClient) UpdateArtifact(ctx context.Context, request UpdateArtifactRequest) (response UpdateArtifactResponse, 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.updateArtifact, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateArtifactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateArtifactResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateArtifactResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateArtifactResponse") + } + return +} + +// updateArtifact implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateArtifact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/artifacts/{artifactId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateArtifactResponse + 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/publisher/20220901/Artifact/UpdateArtifact" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateArtifact", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateListing Updates the specified Listing identified by the id. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListing.go.html to see an example of how to use UpdateListing API. +// A default retry strategy applies to this operation UpdateListing() +func (client MarketplacePublisherClient) UpdateListing(ctx context.Context, request UpdateListingRequest) (response UpdateListingResponse, 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.updateListing, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateListingResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateListingResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateListingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateListingResponse") + } + return +} + +// updateListing implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateListing(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/listings/{listingId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateListingResponse + 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/publisher/20220901/Listing/UpdateListing" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateListing", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateListingRevision Updates the Listing Revision +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevision.go.html to see an example of how to use UpdateListingRevision API. +// A default retry strategy applies to this operation UpdateListingRevision() +func (client MarketplacePublisherClient) UpdateListingRevision(ctx context.Context, request UpdateListingRevisionRequest) (response UpdateListingRevisionResponse, 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.updateListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateListingRevisionResponse") + } + return +} + +// updateListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/listingRevisions/{listingRevisionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateListingRevisionResponse + 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/publisher/20220901/ListingRevision/UpdateListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateListingRevisionAttachment Updates the Listing Revision Attachment +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionAttachment.go.html to see an example of how to use UpdateListingRevisionAttachment API. +// A default retry strategy applies to this operation UpdateListingRevisionAttachment() +func (client MarketplacePublisherClient) UpdateListingRevisionAttachment(ctx context.Context, request UpdateListingRevisionAttachmentRequest) (response UpdateListingRevisionAttachmentResponse, 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.updateListingRevisionAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateListingRevisionAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateListingRevisionAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateListingRevisionAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateListingRevisionAttachmentResponse") + } + return +} + +// updateListingRevisionAttachment implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateListingRevisionAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/listingRevisionAttachments/{listingRevisionAttachmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateListingRevisionAttachmentResponse + 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/publisher/20220901/ListingRevisionAttachment/UpdateListingRevisionAttachment" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateListingRevisionAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listingrevisionattachment{}) + return response, err +} + +// UpdateListingRevisionAttachmentContent Update a file to listing revision attachment +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionAttachmentContent.go.html to see an example of how to use UpdateListingRevisionAttachmentContent API. +// A default retry strategy applies to this operation UpdateListingRevisionAttachmentContent() +func (client MarketplacePublisherClient) UpdateListingRevisionAttachmentContent(ctx context.Context, request UpdateListingRevisionAttachmentContentRequest) (response UpdateListingRevisionAttachmentContentResponse, 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.updateListingRevisionAttachmentContent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateListingRevisionAttachmentContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateListingRevisionAttachmentContentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateListingRevisionAttachmentContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateListingRevisionAttachmentContentResponse") + } + return +} + +// updateListingRevisionAttachmentContent implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateListingRevisionAttachmentContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/listingRevisionAttachments/{listingRevisionAttachmentId}/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateListingRevisionAttachmentContentResponse + 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/publisher/20220901/ListingRevisionAttachment/UpdateListingRevisionAttachmentContent" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateListingRevisionAttachmentContent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listingrevisionattachment{}) + return response, err +} + +// UpdateListingRevisionIconContent Updates the Listing Revision +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionIconContent.go.html to see an example of how to use UpdateListingRevisionIconContent API. +// A default retry strategy applies to this operation UpdateListingRevisionIconContent() +func (client MarketplacePublisherClient) UpdateListingRevisionIconContent(ctx context.Context, request UpdateListingRevisionIconContentRequest) (response UpdateListingRevisionIconContentResponse, 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.updateListingRevisionIconContent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateListingRevisionIconContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateListingRevisionIconContentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateListingRevisionIconContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateListingRevisionIconContentResponse") + } + return +} + +// updateListingRevisionIconContent implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateListingRevisionIconContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/listingRevisions/{listingRevisionId}/icon/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateListingRevisionIconContentResponse + 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/publisher/20220901/ListingRevision/UpdateListingRevisionIconContent" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateListingRevisionIconContent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateListingRevisionPackage Updates the Listing Revision Package. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionPackage.go.html to see an example of how to use UpdateListingRevisionPackage API. +// A default retry strategy applies to this operation UpdateListingRevisionPackage() +func (client MarketplacePublisherClient) UpdateListingRevisionPackage(ctx context.Context, request UpdateListingRevisionPackageRequest) (response UpdateListingRevisionPackageResponse, 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.updateListingRevisionPackage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateListingRevisionPackageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateListingRevisionPackageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateListingRevisionPackageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateListingRevisionPackageResponse") + } + return +} + +// updateListingRevisionPackage implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateListingRevisionPackage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/listingRevisionPackages/{listingRevisionPackageId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateListingRevisionPackageResponse + 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/publisher/20220901/ListingRevisionPackage/UpdateListingRevisionPackage" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateListingRevisionPackage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listingrevisionpackage{}) + return response, err +} + +// UpdateTerm Updates the Term +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateTerm.go.html to see an example of how to use UpdateTerm API. +// A default retry strategy applies to this operation UpdateTerm() +func (client MarketplacePublisherClient) UpdateTerm(ctx context.Context, request UpdateTermRequest) (response UpdateTermResponse, 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.updateTerm, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateTermResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateTermResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateTermResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTermResponse") + } + return +} + +// updateTerm implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateTerm(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/terms/{termId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateTermResponse + 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/publisher/20220901/Term/UpdateTerm" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateTerm", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateTermVersion Updates the Term Version +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateTermVersion.go.html to see an example of how to use UpdateTermVersion API. +// A default retry strategy applies to this operation UpdateTermVersion() +func (client MarketplacePublisherClient) UpdateTermVersion(ctx context.Context, request UpdateTermVersionRequest) (response UpdateTermVersionResponse, 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.updateTermVersion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateTermVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateTermVersionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateTermVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTermVersionResponse") + } + return +} + +// updateTermVersion implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateTermVersion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/termVersions/{termVersionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateTermVersionResponse + 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/publisher/20220901/TermVersion/UpdateTermVersion" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateTermVersion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateTermVersionContent Updates the Term Version attachment +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateTermVersionContent.go.html to see an example of how to use UpdateTermVersionContent API. +// A default retry strategy applies to this operation UpdateTermVersionContent() +func (client MarketplacePublisherClient) UpdateTermVersionContent(ctx context.Context, request UpdateTermVersionContentRequest) (response UpdateTermVersionContentResponse, 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.updateTermVersionContent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateTermVersionContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateTermVersionContentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateTermVersionContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTermVersionContentResponse") + } + return +} + +// updateTermVersionContent implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) updateTermVersionContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/termVersions/{termVersionId}/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateTermVersionContentResponse + 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/publisher/20220901/TermVersion/UpdateTermVersionContent" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "UpdateTermVersionContent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ValidateAndPublishArtifact Validate and publish artifact. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ValidateAndPublishArtifact.go.html to see an example of how to use ValidateAndPublishArtifact API. +// A default retry strategy applies to this operation ValidateAndPublishArtifact() +func (client MarketplacePublisherClient) ValidateAndPublishArtifact(ctx context.Context, request ValidateAndPublishArtifactRequest) (response ValidateAndPublishArtifactResponse, 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.validateAndPublishArtifact, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ValidateAndPublishArtifactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ValidateAndPublishArtifactResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ValidateAndPublishArtifactResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ValidateAndPublishArtifactResponse") + } + return +} + +// validateAndPublishArtifact implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) validateAndPublishArtifact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/artifacts/{artifactId}/actions/validateAndPublish", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ValidateAndPublishArtifactResponse + 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/publisher/20220901/Artifact/ValidateAndPublishArtifact" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "ValidateAndPublishArtifact", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// WithdrawListingRevision Update the Listing Revision identified by the id as Withdraw/UnPublished. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/WithdrawListingRevision.go.html to see an example of how to use WithdrawListingRevision API. +// A default retry strategy applies to this operation WithdrawListingRevision() +func (client MarketplacePublisherClient) WithdrawListingRevision(ctx context.Context, request WithdrawListingRevisionRequest) (response WithdrawListingRevisionResponse, 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.withdrawListingRevision, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = WithdrawListingRevisionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = WithdrawListingRevisionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(WithdrawListingRevisionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into WithdrawListingRevisionResponse") + } + return +} + +// withdrawListingRevision implements the OCIOperation interface (enables retrying operations) +func (client MarketplacePublisherClient) withdrawListingRevision(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/listingRevisions/{listingRevisionId}/actions/withdraw", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response WithdrawListingRevisionResponse + 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/publisher/20220901/ListingRevision/WithdrawListingRevision" + err = common.PostProcessServiceError(err, "MarketplacePublisher", "WithdrawListingRevision", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/marketplacepublisher/named_link.go b/marketplacepublisher/named_link.go new file mode 100644 index 0000000000..96df47ef88 --- /dev/null +++ b/marketplacepublisher/named_link.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NamedLink A link to a resource on the internet. +type NamedLink struct { + + // Text that describes the resource. + Name *string `mandatory:"true" json:"name"` + + // The URL of the resource. + Url *string `mandatory:"true" json:"url"` +} + +func (m NamedLink) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NamedLink) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/operation_status.go b/marketplacepublisher/operation_status.go new file mode 100644 index 0000000000..709d1c7ef4 --- /dev/null +++ b/marketplacepublisher/operation_status.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "needs_attention": OperationStatusNeedsAttention, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/operation_type.go b/marketplacepublisher/operation_type.go new file mode 100644 index 0000000000..4698c53e43 --- /dev/null +++ b/marketplacepublisher/operation_type.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypePublishListingRevisionPackage OperationTypeEnum = "PUBLISH_LISTING_REVISION_PACKAGE" + OperationTypeUnpublishListingRevisionPackage OperationTypeEnum = "UNPUBLISH_LISTING_REVISION_PACKAGE" + OperationTypePublishListingRevision OperationTypeEnum = "PUBLISH_LISTING_REVISION" + OperationTypePublishListingRevisionAsPrivate OperationTypeEnum = "PUBLISH_LISTING_REVISION_AS_PRIVATE" + OperationTypeWithdrawListingRevision OperationTypeEnum = "WITHDRAW_LISTING_REVISION" + OperationTypeCloneListingRevision OperationTypeEnum = "CLONE_LISTING_REVISION" + OperationTypeCascadingDeleteListing OperationTypeEnum = "CASCADING_DELETE_LISTING" + OperationTypeCascadingDeleteListingRevision OperationTypeEnum = "CASCADING_DELETE_LISTING_REVISION" + OperationTypeMarkAsDefaultListingRevisionPackage OperationTypeEnum = "MARK_AS_DEFAULT_LISTING_REVISION_PACKAGE" + OperationTypeChangeListingCompartment OperationTypeEnum = "CHANGE_LISTING_COMPARTMENT" + OperationTypeCreateArtifact OperationTypeEnum = "CREATE_ARTIFACT" + OperationTypeValidateAndPublishArtifact OperationTypeEnum = "VALIDATE_AND_PUBLISH_ARTIFACT" + OperationTypeChangeArtifactCompartment OperationTypeEnum = "CHANGE_ARTIFACT_COMPARTMENT" + OperationTypeChangeTermCompartment OperationTypeEnum = "CHANGE_TERM_COMPARTMENT" + OperationTypeDeleteArtifact OperationTypeEnum = "DELETE_ARTIFACT" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "PUBLISH_LISTING_REVISION_PACKAGE": OperationTypePublishListingRevisionPackage, + "UNPUBLISH_LISTING_REVISION_PACKAGE": OperationTypeUnpublishListingRevisionPackage, + "PUBLISH_LISTING_REVISION": OperationTypePublishListingRevision, + "PUBLISH_LISTING_REVISION_AS_PRIVATE": OperationTypePublishListingRevisionAsPrivate, + "WITHDRAW_LISTING_REVISION": OperationTypeWithdrawListingRevision, + "CLONE_LISTING_REVISION": OperationTypeCloneListingRevision, + "CASCADING_DELETE_LISTING": OperationTypeCascadingDeleteListing, + "CASCADING_DELETE_LISTING_REVISION": OperationTypeCascadingDeleteListingRevision, + "MARK_AS_DEFAULT_LISTING_REVISION_PACKAGE": OperationTypeMarkAsDefaultListingRevisionPackage, + "CHANGE_LISTING_COMPARTMENT": OperationTypeChangeListingCompartment, + "CREATE_ARTIFACT": OperationTypeCreateArtifact, + "VALIDATE_AND_PUBLISH_ARTIFACT": OperationTypeValidateAndPublishArtifact, + "CHANGE_ARTIFACT_COMPARTMENT": OperationTypeChangeArtifactCompartment, + "CHANGE_TERM_COMPARTMENT": OperationTypeChangeTermCompartment, + "DELETE_ARTIFACT": OperationTypeDeleteArtifact, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "publish_listing_revision_package": OperationTypePublishListingRevisionPackage, + "unpublish_listing_revision_package": OperationTypeUnpublishListingRevisionPackage, + "publish_listing_revision": OperationTypePublishListingRevision, + "publish_listing_revision_as_private": OperationTypePublishListingRevisionAsPrivate, + "withdraw_listing_revision": OperationTypeWithdrawListingRevision, + "clone_listing_revision": OperationTypeCloneListingRevision, + "cascading_delete_listing": OperationTypeCascadingDeleteListing, + "cascading_delete_listing_revision": OperationTypeCascadingDeleteListingRevision, + "mark_as_default_listing_revision_package": OperationTypeMarkAsDefaultListingRevisionPackage, + "change_listing_compartment": OperationTypeChangeListingCompartment, + "create_artifact": OperationTypeCreateArtifact, + "validate_and_publish_artifact": OperationTypeValidateAndPublishArtifact, + "change_artifact_compartment": OperationTypeChangeArtifactCompartment, + "change_term_compartment": OperationTypeChangeTermCompartment, + "delete_artifact": OperationTypeDeleteArtifact, +} + +// GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum +func GetOperationTypeEnumValues() []OperationTypeEnum { + values := make([]OperationTypeEnum, 0) + for _, v := range mappingOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypeEnumStringValues Enumerates the set of values in String for OperationTypeEnum +func GetOperationTypeEnumStringValues() []string { + return []string{ + "PUBLISH_LISTING_REVISION_PACKAGE", + "UNPUBLISH_LISTING_REVISION_PACKAGE", + "PUBLISH_LISTING_REVISION", + "PUBLISH_LISTING_REVISION_AS_PRIVATE", + "WITHDRAW_LISTING_REVISION", + "CLONE_LISTING_REVISION", + "CASCADING_DELETE_LISTING", + "CASCADING_DELETE_LISTING_REVISION", + "MARK_AS_DEFAULT_LISTING_REVISION_PACKAGE", + "CHANGE_LISTING_COMPARTMENT", + "CREATE_ARTIFACT", + "VALIDATE_AND_PUBLISH_ARTIFACT", + "CHANGE_ARTIFACT_COMPARTMENT", + "CHANGE_TERM_COMPARTMENT", + "DELETE_ARTIFACT", + } +} + +// GetMappingOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypeEnum(val string) (OperationTypeEnum, bool) { + enum, ok := mappingOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/opn_membership.go b/marketplacepublisher/opn_membership.go new file mode 100644 index 0000000000..fd90d350e0 --- /dev/null +++ b/marketplacepublisher/opn_membership.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpnMembership OPN membership information +type OpnMembership struct { + + // OPN membership start date. An RFC3339 formatted datetime string + TimeStart *common.SDKTime `mandatory:"false" json:"timeStart"` + + // OPN membership end date. An RFC3339 formatted datetime string + TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` + + // OPN status + OpnStatus OpnMembershipOpnStatusEnum `mandatory:"false" json:"opnStatus,omitempty"` + + // OPN Number number + OpnNumber *string `mandatory:"false" json:"opnNumber"` + + // OPN membership type + OpnMembershipType *string `mandatory:"false" json:"opnMembershipType"` +} + +func (m OpnMembership) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpnMembership) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingOpnMembershipOpnStatusEnum(string(m.OpnStatus)); !ok && m.OpnStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OpnStatus: %s. Supported values are: %s.", m.OpnStatus, strings.Join(GetOpnMembershipOpnStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OpnMembershipOpnStatusEnum Enum with underlying type: string +type OpnMembershipOpnStatusEnum string + +// Set of constants representing the allowable values for OpnMembershipOpnStatusEnum +const ( + OpnMembershipOpnStatusActive OpnMembershipOpnStatusEnum = "ACTIVE" + OpnMembershipOpnStatusInactive OpnMembershipOpnStatusEnum = "INACTIVE" + OpnMembershipOpnStatusRenewalInProgress OpnMembershipOpnStatusEnum = "RENEWAL_IN_PROGRESS" +) + +var mappingOpnMembershipOpnStatusEnum = map[string]OpnMembershipOpnStatusEnum{ + "ACTIVE": OpnMembershipOpnStatusActive, + "INACTIVE": OpnMembershipOpnStatusInactive, + "RENEWAL_IN_PROGRESS": OpnMembershipOpnStatusRenewalInProgress, +} + +var mappingOpnMembershipOpnStatusEnumLowerCase = map[string]OpnMembershipOpnStatusEnum{ + "active": OpnMembershipOpnStatusActive, + "inactive": OpnMembershipOpnStatusInactive, + "renewal_in_progress": OpnMembershipOpnStatusRenewalInProgress, +} + +// GetOpnMembershipOpnStatusEnumValues Enumerates the set of values for OpnMembershipOpnStatusEnum +func GetOpnMembershipOpnStatusEnumValues() []OpnMembershipOpnStatusEnum { + values := make([]OpnMembershipOpnStatusEnum, 0) + for _, v := range mappingOpnMembershipOpnStatusEnum { + values = append(values, v) + } + return values +} + +// GetOpnMembershipOpnStatusEnumStringValues Enumerates the set of values in String for OpnMembershipOpnStatusEnum +func GetOpnMembershipOpnStatusEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + "RENEWAL_IN_PROGRESS", + } +} + +// GetMappingOpnMembershipOpnStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOpnMembershipOpnStatusEnum(val string) (OpnMembershipOpnStatusEnum, bool) { + enum, ok := mappingOpnMembershipOpnStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/package_type.go b/marketplacepublisher/package_type.go new file mode 100644 index 0000000000..f8a5bb2c58 --- /dev/null +++ b/marketplacepublisher/package_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// PackageTypeEnum Enum with underlying type: string +type PackageTypeEnum string + +// Set of constants representing the allowable values for PackageTypeEnum +const ( + PackageTypeContainerImage PackageTypeEnum = "CONTAINER_IMAGE" + PackageTypeHelmChart PackageTypeEnum = "HELM_CHART" +) + +var mappingPackageTypeEnum = map[string]PackageTypeEnum{ + "CONTAINER_IMAGE": PackageTypeContainerImage, + "HELM_CHART": PackageTypeHelmChart, +} + +var mappingPackageTypeEnumLowerCase = map[string]PackageTypeEnum{ + "container_image": PackageTypeContainerImage, + "helm_chart": PackageTypeHelmChart, +} + +// GetPackageTypeEnumValues Enumerates the set of values for PackageTypeEnum +func GetPackageTypeEnumValues() []PackageTypeEnum { + values := make([]PackageTypeEnum, 0) + for _, v := range mappingPackageTypeEnum { + values = append(values, v) + } + return values +} + +// GetPackageTypeEnumStringValues Enumerates the set of values in String for PackageTypeEnum +func GetPackageTypeEnumStringValues() []string { + return []string{ + "CONTAINER_IMAGE", + "HELM_CHART", + } +} + +// GetMappingPackageTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPackageTypeEnum(val string) (PackageTypeEnum, bool) { + enum, ok := mappingPackageTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/private_offer_account_details.go b/marketplacepublisher/private_offer_account_details.go new file mode 100644 index 0000000000..833a47da4a --- /dev/null +++ b/marketplacepublisher/private_offer_account_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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrivateOfferAccountDetails Private Offer account details. +type PrivateOfferAccountDetails struct { + + // Meter name + Meter *string `mandatory:"false" json:"meter"` + + // SKU name + Sku *string `mandatory:"false" json:"sku"` +} + +func (m PrivateOfferAccountDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrivateOfferAccountDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/product.go b/marketplacepublisher/product.go new file mode 100644 index 0000000000..ae6d8a09df --- /dev/null +++ b/marketplacepublisher/product.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Product The model for the product details. +type Product struct { + + // The name for the product. + Name *string `mandatory:"true" json:"name"` + + // The code for the product. + Code *string `mandatory:"true" json:"code"` + + // The product group for the product. + ProductGroup *string `mandatory:"true" json:"productGroup"` + + // The current state for the product. + LifecycleState ProductLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the product was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the product was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m Product) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Product) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingProductLifecycleStateEnum(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(GetProductLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ProductLifecycleStateEnum Enum with underlying type: string +type ProductLifecycleStateEnum string + +// Set of constants representing the allowable values for ProductLifecycleStateEnum +const ( + ProductLifecycleStateActive ProductLifecycleStateEnum = "ACTIVE" + ProductLifecycleStateInactive ProductLifecycleStateEnum = "INACTIVE" +) + +var mappingProductLifecycleStateEnum = map[string]ProductLifecycleStateEnum{ + "ACTIVE": ProductLifecycleStateActive, + "INACTIVE": ProductLifecycleStateInactive, +} + +var mappingProductLifecycleStateEnumLowerCase = map[string]ProductLifecycleStateEnum{ + "active": ProductLifecycleStateActive, + "inactive": ProductLifecycleStateInactive, +} + +// GetProductLifecycleStateEnumValues Enumerates the set of values for ProductLifecycleStateEnum +func GetProductLifecycleStateEnumValues() []ProductLifecycleStateEnum { + values := make([]ProductLifecycleStateEnum, 0) + for _, v := range mappingProductLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetProductLifecycleStateEnumStringValues Enumerates the set of values in String for ProductLifecycleStateEnum +func GetProductLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + } +} + +// GetMappingProductLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingProductLifecycleStateEnum(val string) (ProductLifecycleStateEnum, bool) { + enum, ok := mappingProductLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/product_collection.go b/marketplacepublisher/product_collection.go new file mode 100644 index 0000000000..cc37afcd8e --- /dev/null +++ b/marketplacepublisher/product_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProductCollection Results of a product search. Contains the product items. +type ProductCollection struct { + + // List of product summary. + Items []ProductSummary `mandatory:"true" json:"items"` +} + +func (m ProductCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ProductCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/product_summary.go b/marketplacepublisher/product_summary.go new file mode 100644 index 0000000000..a9c878d400 --- /dev/null +++ b/marketplacepublisher/product_summary.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProductSummary The model for the product metadata. +type ProductSummary struct { + + // The name for the product. + Name *string `mandatory:"true" json:"name"` + + // The current state for the product. + LifecycleState ProductLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the product was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the product was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The code for the product. + Code *string `mandatory:"false" json:"code"` + + // The product group for the product. + ProductGroup *string `mandatory:"false" json:"productGroup"` +} + +func (m ProductSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ProductSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingProductLifecycleStateEnum(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(GetProductLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/publication_status.go b/marketplacepublisher/publication_status.go new file mode 100644 index 0000000000..9b31d4dc79 --- /dev/null +++ b/marketplacepublisher/publication_status.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// PublicationStatusEnum Enum with underlying type: string +type PublicationStatusEnum string + +// Set of constants representing the allowable values for PublicationStatusEnum +const ( + PublicationStatusPublicationInProgress PublicationStatusEnum = "PUBLICATION_IN_PROGRESS" + PublicationStatusPublicationCompleted PublicationStatusEnum = "PUBLICATION_COMPLETED" + PublicationStatusPublicationFailed PublicationStatusEnum = "PUBLICATION_FAILED" +) + +var mappingPublicationStatusEnum = map[string]PublicationStatusEnum{ + "PUBLICATION_IN_PROGRESS": PublicationStatusPublicationInProgress, + "PUBLICATION_COMPLETED": PublicationStatusPublicationCompleted, + "PUBLICATION_FAILED": PublicationStatusPublicationFailed, +} + +var mappingPublicationStatusEnumLowerCase = map[string]PublicationStatusEnum{ + "publication_in_progress": PublicationStatusPublicationInProgress, + "publication_completed": PublicationStatusPublicationCompleted, + "publication_failed": PublicationStatusPublicationFailed, +} + +// GetPublicationStatusEnumValues Enumerates the set of values for PublicationStatusEnum +func GetPublicationStatusEnumValues() []PublicationStatusEnum { + values := make([]PublicationStatusEnum, 0) + for _, v := range mappingPublicationStatusEnum { + values = append(values, v) + } + return values +} + +// GetPublicationStatusEnumStringValues Enumerates the set of values in String for PublicationStatusEnum +func GetPublicationStatusEnumStringValues() []string { + return []string{ + "PUBLICATION_IN_PROGRESS", + "PUBLICATION_COMPLETED", + "PUBLICATION_FAILED", + } +} + +// GetMappingPublicationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPublicationStatusEnum(val string) (PublicationStatusEnum, bool) { + enum, ok := mappingPublicationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/publish_listing_revision_as_private_details.go b/marketplacepublisher/publish_listing_revision_as_private_details.go new file mode 100644 index 0000000000..85faca5f1c --- /dev/null +++ b/marketplacepublisher/publish_listing_revision_as_private_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PublishListingRevisionAsPrivateDetails The model for an Oracle Cloud Infrastructure Marketplace Publisher publish as private listing revision. +type PublishListingRevisionAsPrivateDetails struct { + + // Allowed tenancies provided when a listing is published as private. + AllowedTenancies []string `mandatory:"false" json:"allowedTenancies"` +} + +func (m PublishListingRevisionAsPrivateDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PublishListingRevisionAsPrivateDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/publish_listing_revision_as_private_request_response.go b/marketplacepublisher/publish_listing_revision_as_private_request_response.go new file mode 100644 index 0000000000..77d2cfbd0e --- /dev/null +++ b/marketplacepublisher/publish_listing_revision_as_private_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PublishListingRevisionAsPrivateRequest wrapper for the PublishListingRevisionAsPrivate operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/PublishListingRevisionAsPrivate.go.html to see an example of how to use PublishListingRevisionAsPrivateRequest. +type PublishListingRevisionAsPrivateRequest struct { + + // The listing revision publish as private information to be updated. + PublishListingRevisionAsPrivateDetails `contributesTo:"body"` + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PublishListingRevisionAsPrivateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PublishListingRevisionAsPrivateRequest) 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 PublishListingRevisionAsPrivateRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PublishListingRevisionAsPrivateRequest) 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 PublishListingRevisionAsPrivateRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PublishListingRevisionAsPrivateResponse wrapper for the PublishListingRevisionAsPrivate operation +type PublishListingRevisionAsPrivateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PublishListingRevisionAsPrivateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PublishListingRevisionAsPrivateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/publish_listing_revision_package_request_response.go b/marketplacepublisher/publish_listing_revision_package_request_response.go new file mode 100644 index 0000000000..bd4ce54d63 --- /dev/null +++ b/marketplacepublisher/publish_listing_revision_package_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PublishListingRevisionPackageRequest wrapper for the PublishListingRevisionPackage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/PublishListingRevisionPackage.go.html to see an example of how to use PublishListingRevisionPackageRequest. +type PublishListingRevisionPackageRequest struct { + + // Unique listing revision package identifier. + ListingRevisionPackageId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionPackageId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PublishListingRevisionPackageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PublishListingRevisionPackageRequest) 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 PublishListingRevisionPackageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PublishListingRevisionPackageRequest) 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 PublishListingRevisionPackageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PublishListingRevisionPackageResponse wrapper for the PublishListingRevisionPackage operation +type PublishListingRevisionPackageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PublishListingRevisionPackageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PublishListingRevisionPackageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/publish_listing_revision_request_response.go b/marketplacepublisher/publish_listing_revision_request_response.go new file mode 100644 index 0000000000..0d73ccf6ab --- /dev/null +++ b/marketplacepublisher/publish_listing_revision_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PublishListingRevisionRequest wrapper for the PublishListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/PublishListingRevision.go.html to see an example of how to use PublishListingRevisionRequest. +type PublishListingRevisionRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PublishListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PublishListingRevisionRequest) 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 PublishListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PublishListingRevisionRequest) 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 PublishListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PublishListingRevisionResponse wrapper for the PublishListingRevision operation +type PublishListingRevisionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PublishListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PublishListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/publisher.go b/marketplacepublisher/publisher.go new file mode 100644 index 0000000000..0c843deac7 --- /dev/null +++ b/marketplacepublisher/publisher.go @@ -0,0 +1,217 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Publisher The model for a publisher details. +type Publisher struct { + + // Unique OCID identifier for the publisher. + Id *string `mandatory:"true" json:"id"` + + // The root compartment of the Publisher. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The namespace for the publisher registry to persist artifacts. + RegistryNamespace *string `mandatory:"true" json:"registryNamespace"` + + // The name of the publisher. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The public email address of the publisher for customers. + ContactEmail *string `mandatory:"true" json:"contactEmail"` + + // The phone number of the publisher in E.164 format. + ContactPhone *string `mandatory:"true" json:"contactPhone"` + + // publisher type. + PublisherType PublisherPublisherTypeEnum `mandatory:"true" json:"publisherType"` + + // The time the publisher was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the publisher was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // publisher status. + PublisherStatus PublisherPublisherStatusEnum `mandatory:"true" json:"publisherStatus"` + + // Unique legacy service identifier for the publisher. + LegacyId *string `mandatory:"false" json:"legacyId"` + + // A description of the publisher. + Description *string `mandatory:"false" json:"description"` + + // The year the publisher's company or organization was founded. + YearFounded *int64 `mandatory:"false" json:"yearFounded"` + + // The publisher's website. + WebsiteUrl *string `mandatory:"false" json:"websiteUrl"` + + // The address of the publisher's headquarters. + HqAddress *string `mandatory:"false" json:"hqAddress"` + + Logo *UploadData `mandatory:"false" json:"logo"` + + // Publisher's Facebook URL + FacebookUrl *string `mandatory:"false" json:"facebookUrl"` + + // Publisher's Twitter URL + TwitterUrl *string `mandatory:"false" json:"twitterUrl"` + + // Publisher's LinkedIn URL + LinkedinUrl *string `mandatory:"false" json:"linkedinUrl"` + + // 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"` + + // The private email address of the publisher product team. + NotificationEmail *string `mandatory:"false" json:"notificationEmail"` + + OpnMembership *OpnMembership `mandatory:"false" json:"opnMembership"` + + PrivateOfferAccountDetails *PrivateOfferAccountDetails `mandatory:"false" json:"privateOfferAccountDetails"` +} + +func (m Publisher) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Publisher) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPublisherPublisherTypeEnum(string(m.PublisherType)); !ok && m.PublisherType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PublisherType: %s. Supported values are: %s.", m.PublisherType, strings.Join(GetPublisherPublisherTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingPublisherPublisherStatusEnum(string(m.PublisherStatus)); !ok && m.PublisherStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PublisherStatus: %s. Supported values are: %s.", m.PublisherStatus, strings.Join(GetPublisherPublisherStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PublisherPublisherTypeEnum Enum with underlying type: string +type PublisherPublisherTypeEnum string + +// Set of constants representing the allowable values for PublisherPublisherTypeEnum +const ( + PublisherPublisherTypeInternal PublisherPublisherTypeEnum = "INTERNAL" + PublisherPublisherTypeExternal PublisherPublisherTypeEnum = "EXTERNAL" +) + +var mappingPublisherPublisherTypeEnum = map[string]PublisherPublisherTypeEnum{ + "INTERNAL": PublisherPublisherTypeInternal, + "EXTERNAL": PublisherPublisherTypeExternal, +} + +var mappingPublisherPublisherTypeEnumLowerCase = map[string]PublisherPublisherTypeEnum{ + "internal": PublisherPublisherTypeInternal, + "external": PublisherPublisherTypeExternal, +} + +// GetPublisherPublisherTypeEnumValues Enumerates the set of values for PublisherPublisherTypeEnum +func GetPublisherPublisherTypeEnumValues() []PublisherPublisherTypeEnum { + values := make([]PublisherPublisherTypeEnum, 0) + for _, v := range mappingPublisherPublisherTypeEnum { + values = append(values, v) + } + return values +} + +// GetPublisherPublisherTypeEnumStringValues Enumerates the set of values in String for PublisherPublisherTypeEnum +func GetPublisherPublisherTypeEnumStringValues() []string { + return []string{ + "INTERNAL", + "EXTERNAL", + } +} + +// GetMappingPublisherPublisherTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPublisherPublisherTypeEnum(val string) (PublisherPublisherTypeEnum, bool) { + enum, ok := mappingPublisherPublisherTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// PublisherPublisherStatusEnum Enum with underlying type: string +type PublisherPublisherStatusEnum string + +// Set of constants representing the allowable values for PublisherPublisherStatusEnum +const ( + PublisherPublisherStatusNew PublisherPublisherStatusEnum = "NEW" + PublisherPublisherStatusApproved PublisherPublisherStatusEnum = "APPROVED" + PublisherPublisherStatusSuspended PublisherPublisherStatusEnum = "SUSPENDED" + PublisherPublisherStatusRemoved PublisherPublisherStatusEnum = "REMOVED" + PublisherPublisherStatusRejected PublisherPublisherStatusEnum = "REJECTED" + PublisherPublisherStatusContacted PublisherPublisherStatusEnum = "CONTACTED" +) + +var mappingPublisherPublisherStatusEnum = map[string]PublisherPublisherStatusEnum{ + "NEW": PublisherPublisherStatusNew, + "APPROVED": PublisherPublisherStatusApproved, + "SUSPENDED": PublisherPublisherStatusSuspended, + "REMOVED": PublisherPublisherStatusRemoved, + "REJECTED": PublisherPublisherStatusRejected, + "CONTACTED": PublisherPublisherStatusContacted, +} + +var mappingPublisherPublisherStatusEnumLowerCase = map[string]PublisherPublisherStatusEnum{ + "new": PublisherPublisherStatusNew, + "approved": PublisherPublisherStatusApproved, + "suspended": PublisherPublisherStatusSuspended, + "removed": PublisherPublisherStatusRemoved, + "rejected": PublisherPublisherStatusRejected, + "contacted": PublisherPublisherStatusContacted, +} + +// GetPublisherPublisherStatusEnumValues Enumerates the set of values for PublisherPublisherStatusEnum +func GetPublisherPublisherStatusEnumValues() []PublisherPublisherStatusEnum { + values := make([]PublisherPublisherStatusEnum, 0) + for _, v := range mappingPublisherPublisherStatusEnum { + values = append(values, v) + } + return values +} + +// GetPublisherPublisherStatusEnumStringValues Enumerates the set of values in String for PublisherPublisherStatusEnum +func GetPublisherPublisherStatusEnumStringValues() []string { + return []string{ + "NEW", + "APPROVED", + "SUSPENDED", + "REMOVED", + "REJECTED", + "CONTACTED", + } +} + +// GetMappingPublisherPublisherStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPublisherPublisherStatusEnum(val string) (PublisherPublisherStatusEnum, bool) { + enum, ok := mappingPublisherPublisherStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/publisher_collection.go b/marketplacepublisher/publisher_collection.go new file mode 100644 index 0000000000..a8bb1a112f --- /dev/null +++ b/marketplacepublisher/publisher_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PublisherCollection Results of a publisher search. Contains Publisher items. +type PublisherCollection struct { + + // List of publisher summary. + Items []PublisherSummary `mandatory:"true" json:"items"` +} + +func (m PublisherCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PublisherCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/publisher_summary.go b/marketplacepublisher/publisher_summary.go new file mode 100644 index 0000000000..8eb67de568 --- /dev/null +++ b/marketplacepublisher/publisher_summary.go @@ -0,0 +1,146 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PublisherSummary The model for a publisher. +type PublisherSummary struct { + + // Unique OCID identifier for the publisher. + Id *string `mandatory:"true" json:"id"` + + // The root compartment of the Publisher. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The namespace for the publisher registry to persist artifacts. + RegistryNamespace *string `mandatory:"true" json:"registryNamespace"` + + // The name of the publisher. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The public email address of the publisher for customers. + ContactEmail *string `mandatory:"true" json:"contactEmail"` + + // The phone number of the publisher in E.164 format. + ContactPhone *string `mandatory:"true" json:"contactPhone"` + + // publisher type. + PublisherType PublisherSummaryPublisherTypeEnum `mandatory:"true" json:"publisherType"` + + // The time the publisher was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the publisher was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Unique legacy service identifier for the publisher. + LegacyId *string `mandatory:"false" json:"legacyId"` + + // A description of the publisher. + Description *string `mandatory:"false" json:"description"` + + // The year the publisher's company or organization was founded. + YearFounded *int64 `mandatory:"false" json:"yearFounded"` + + // The publisher's website. + WebsiteUrl *string `mandatory:"false" json:"websiteUrl"` + + // The address of the publisher's headquarters. + HqAddress *string `mandatory:"false" json:"hqAddress"` + + Logo *UploadData `mandatory:"false" json:"logo"` + + // Publisher's Facebook URL + FacebookUrl *string `mandatory:"false" json:"facebookUrl"` + + // Publisher's Twitter URL + TwitterUrl *string `mandatory:"false" json:"twitterUrl"` + + // Publisher's LinkedIn URL + LinkedinUrl *string `mandatory:"false" json:"linkedinUrl"` + + // 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 PublisherSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PublisherSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPublisherSummaryPublisherTypeEnum(string(m.PublisherType)); !ok && m.PublisherType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PublisherType: %s. Supported values are: %s.", m.PublisherType, strings.Join(GetPublisherSummaryPublisherTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PublisherSummaryPublisherTypeEnum Enum with underlying type: string +type PublisherSummaryPublisherTypeEnum string + +// Set of constants representing the allowable values for PublisherSummaryPublisherTypeEnum +const ( + PublisherSummaryPublisherTypeInternal PublisherSummaryPublisherTypeEnum = "INTERNAL" + PublisherSummaryPublisherTypeExternal PublisherSummaryPublisherTypeEnum = "EXTERNAL" +) + +var mappingPublisherSummaryPublisherTypeEnum = map[string]PublisherSummaryPublisherTypeEnum{ + "INTERNAL": PublisherSummaryPublisherTypeInternal, + "EXTERNAL": PublisherSummaryPublisherTypeExternal, +} + +var mappingPublisherSummaryPublisherTypeEnumLowerCase = map[string]PublisherSummaryPublisherTypeEnum{ + "internal": PublisherSummaryPublisherTypeInternal, + "external": PublisherSummaryPublisherTypeExternal, +} + +// GetPublisherSummaryPublisherTypeEnumValues Enumerates the set of values for PublisherSummaryPublisherTypeEnum +func GetPublisherSummaryPublisherTypeEnumValues() []PublisherSummaryPublisherTypeEnum { + values := make([]PublisherSummaryPublisherTypeEnum, 0) + for _, v := range mappingPublisherSummaryPublisherTypeEnum { + values = append(values, v) + } + return values +} + +// GetPublisherSummaryPublisherTypeEnumStringValues Enumerates the set of values in String for PublisherSummaryPublisherTypeEnum +func GetPublisherSummaryPublisherTypeEnumStringValues() []string { + return []string{ + "INTERNAL", + "EXTERNAL", + } +} + +// GetMappingPublisherSummaryPublisherTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPublisherSummaryPublisherTypeEnum(val string) (PublisherSummaryPublisherTypeEnum, bool) { + enum, ok := mappingPublisherSummaryPublisherTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/related_document_attachment.go b/marketplacepublisher/related_document_attachment.go new file mode 100644 index 0000000000..4506064bea --- /dev/null +++ b/marketplacepublisher/related_document_attachment.go @@ -0,0 +1,219 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RelatedDocumentAttachment Related document attachment for the listing revision. +type RelatedDocumentAttachment struct { + + // Unique OCID identifier for the listing revision attachment. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier of the listing revision that the specified attachment belongs to. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // Name of the listing revision attachment. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the attachment was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the attachment was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Description of the listing revision attachment. + 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"` + + // 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"` + + // URL of the uploaded document. + ContentUrl *string `mandatory:"false" json:"contentUrl"` + + // The MIME type of the uploaded data. + MimeType *string `mandatory:"false" json:"mimeType"` + + // Possible lifecycle states. + DocumentCategory RelatedDocumentAttachmentDocumentCategoryEnum `mandatory:"false" json:"documentCategory,omitempty"` + + // The current state of the attachment. + LifecycleState ListingRevisionAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m RelatedDocumentAttachment) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m RelatedDocumentAttachment) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetListingRevisionId returns ListingRevisionId +func (m RelatedDocumentAttachment) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetDisplayName returns DisplayName +func (m RelatedDocumentAttachment) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m RelatedDocumentAttachment) GetDescription() *string { + return m.Description +} + +// GetLifecycleState returns LifecycleState +func (m RelatedDocumentAttachment) GetLifecycleState() ListingRevisionAttachmentLifecycleStateEnum { + return m.LifecycleState +} + +// GetTimeCreated returns TimeCreated +func (m RelatedDocumentAttachment) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m RelatedDocumentAttachment) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetFreeformTags returns FreeformTags +func (m RelatedDocumentAttachment) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m RelatedDocumentAttachment) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m RelatedDocumentAttachment) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m RelatedDocumentAttachment) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RelatedDocumentAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRelatedDocumentAttachmentDocumentCategoryEnum(string(m.DocumentCategory)); !ok && m.DocumentCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DocumentCategory: %s. Supported values are: %s.", m.DocumentCategory, strings.Join(GetRelatedDocumentAttachmentDocumentCategoryEnumStringValues(), ","))) + } + + if _, ok := GetMappingListingRevisionAttachmentLifecycleStateEnum(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(GetListingRevisionAttachmentLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m RelatedDocumentAttachment) MarshalJSON() (buff []byte, e error) { + type MarshalTypeRelatedDocumentAttachment RelatedDocumentAttachment + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeRelatedDocumentAttachment + }{ + "RELATED_DOCUMENT", + (MarshalTypeRelatedDocumentAttachment)(m), + } + + return json.Marshal(&s) +} + +// RelatedDocumentAttachmentDocumentCategoryEnum Enum with underlying type: string +type RelatedDocumentAttachmentDocumentCategoryEnum string + +// Set of constants representing the allowable values for RelatedDocumentAttachmentDocumentCategoryEnum +const ( + RelatedDocumentAttachmentDocumentCategoryCaseStudies RelatedDocumentAttachmentDocumentCategoryEnum = "CASE_STUDIES" + RelatedDocumentAttachmentDocumentCategoryCustomizationGuides RelatedDocumentAttachmentDocumentCategoryEnum = "CUSTOMIZATION_GUIDES" + RelatedDocumentAttachmentDocumentCategoryDataSheets RelatedDocumentAttachmentDocumentCategoryEnum = "DATA_SHEETS" + RelatedDocumentAttachmentDocumentCategoryPressRelease RelatedDocumentAttachmentDocumentCategoryEnum = "PRESS_RELEASE" + RelatedDocumentAttachmentDocumentCategoryProductDocumentation RelatedDocumentAttachmentDocumentCategoryEnum = "PRODUCT_DOCUMENTATION" + RelatedDocumentAttachmentDocumentCategoryUserGuides RelatedDocumentAttachmentDocumentCategoryEnum = "USER_GUIDES" + RelatedDocumentAttachmentDocumentCategoryWebinar RelatedDocumentAttachmentDocumentCategoryEnum = "WEBINAR" +) + +var mappingRelatedDocumentAttachmentDocumentCategoryEnum = map[string]RelatedDocumentAttachmentDocumentCategoryEnum{ + "CASE_STUDIES": RelatedDocumentAttachmentDocumentCategoryCaseStudies, + "CUSTOMIZATION_GUIDES": RelatedDocumentAttachmentDocumentCategoryCustomizationGuides, + "DATA_SHEETS": RelatedDocumentAttachmentDocumentCategoryDataSheets, + "PRESS_RELEASE": RelatedDocumentAttachmentDocumentCategoryPressRelease, + "PRODUCT_DOCUMENTATION": RelatedDocumentAttachmentDocumentCategoryProductDocumentation, + "USER_GUIDES": RelatedDocumentAttachmentDocumentCategoryUserGuides, + "WEBINAR": RelatedDocumentAttachmentDocumentCategoryWebinar, +} + +var mappingRelatedDocumentAttachmentDocumentCategoryEnumLowerCase = map[string]RelatedDocumentAttachmentDocumentCategoryEnum{ + "case_studies": RelatedDocumentAttachmentDocumentCategoryCaseStudies, + "customization_guides": RelatedDocumentAttachmentDocumentCategoryCustomizationGuides, + "data_sheets": RelatedDocumentAttachmentDocumentCategoryDataSheets, + "press_release": RelatedDocumentAttachmentDocumentCategoryPressRelease, + "product_documentation": RelatedDocumentAttachmentDocumentCategoryProductDocumentation, + "user_guides": RelatedDocumentAttachmentDocumentCategoryUserGuides, + "webinar": RelatedDocumentAttachmentDocumentCategoryWebinar, +} + +// GetRelatedDocumentAttachmentDocumentCategoryEnumValues Enumerates the set of values for RelatedDocumentAttachmentDocumentCategoryEnum +func GetRelatedDocumentAttachmentDocumentCategoryEnumValues() []RelatedDocumentAttachmentDocumentCategoryEnum { + values := make([]RelatedDocumentAttachmentDocumentCategoryEnum, 0) + for _, v := range mappingRelatedDocumentAttachmentDocumentCategoryEnum { + values = append(values, v) + } + return values +} + +// GetRelatedDocumentAttachmentDocumentCategoryEnumStringValues Enumerates the set of values in String for RelatedDocumentAttachmentDocumentCategoryEnum +func GetRelatedDocumentAttachmentDocumentCategoryEnumStringValues() []string { + return []string{ + "CASE_STUDIES", + "CUSTOMIZATION_GUIDES", + "DATA_SHEETS", + "PRESS_RELEASE", + "PRODUCT_DOCUMENTATION", + "USER_GUIDES", + "WEBINAR", + } +} + +// GetMappingRelatedDocumentAttachmentDocumentCategoryEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRelatedDocumentAttachmentDocumentCategoryEnum(val string) (RelatedDocumentAttachmentDocumentCategoryEnum, bool) { + enum, ok := mappingRelatedDocumentAttachmentDocumentCategoryEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/screen_shot_attachment.go b/marketplacepublisher/screen_shot_attachment.go new file mode 100644 index 0000000000..06cc32d49a --- /dev/null +++ b/marketplacepublisher/screen_shot_attachment.go @@ -0,0 +1,151 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScreenShotAttachment Screenshot attachment for the listing revision. +type ScreenShotAttachment struct { + + // Unique OCID identifier for the listing revision attachment. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier of the listing revision that the specified attachment belongs to. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // Name of the listing revision attachment. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the attachment was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the attachment was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Description of the listing revision attachment. + 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"` + + // 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"` + + // URL of the uploaded document. + ContentUrl *string `mandatory:"false" json:"contentUrl"` + + // The MIME type of the uploaded data. + MimeType *string `mandatory:"false" json:"mimeType"` + + // The current state of the attachment. + LifecycleState ListingRevisionAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m ScreenShotAttachment) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m ScreenShotAttachment) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetListingRevisionId returns ListingRevisionId +func (m ScreenShotAttachment) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetDisplayName returns DisplayName +func (m ScreenShotAttachment) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m ScreenShotAttachment) GetDescription() *string { + return m.Description +} + +// GetLifecycleState returns LifecycleState +func (m ScreenShotAttachment) GetLifecycleState() ListingRevisionAttachmentLifecycleStateEnum { + return m.LifecycleState +} + +// GetTimeCreated returns TimeCreated +func (m ScreenShotAttachment) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m ScreenShotAttachment) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetFreeformTags returns FreeformTags +func (m ScreenShotAttachment) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m ScreenShotAttachment) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m ScreenShotAttachment) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m ScreenShotAttachment) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScreenShotAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingListingRevisionAttachmentLifecycleStateEnum(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(GetListingRevisionAttachmentLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ScreenShotAttachment) MarshalJSON() (buff []byte, e error) { + type MarshalTypeScreenShotAttachment ScreenShotAttachment + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeScreenShotAttachment + }{ + "SCREENSHOT", + (MarshalTypeScreenShotAttachment)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/sort_order.go b/marketplacepublisher/sort_order.go new file mode 100644 index 0000000000..9a297fbb31 --- /dev/null +++ b/marketplacepublisher/sort_order.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +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/marketplacepublisher/submit_listing_revision_for_review_details.go b/marketplacepublisher/submit_listing_revision_for_review_details.go new file mode 100644 index 0000000000..32b4717cb1 --- /dev/null +++ b/marketplacepublisher/submit_listing_revision_for_review_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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SubmitListingRevisionForReviewDetails The model for an Oracle Cloud Infrastructure Marketplace Publisher review listing revision. +type SubmitListingRevisionForReviewDetails struct { + + // Notes provided for the listing revision. + NoteDetails *string `mandatory:"false" json:"noteDetails"` + + // Identifies whether publisher allows internal tenancy launches for the listing revision. + AreInternalTenancyLaunchAllowed *bool `mandatory:"false" json:"areInternalTenancyLaunchAllowed"` +} + +func (m SubmitListingRevisionForReviewDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SubmitListingRevisionForReviewDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/submit_listing_revision_for_review_request_response.go b/marketplacepublisher/submit_listing_revision_for_review_request_response.go new file mode 100644 index 0000000000..906f5bb631 --- /dev/null +++ b/marketplacepublisher/submit_listing_revision_for_review_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SubmitListingRevisionForReviewRequest wrapper for the SubmitListingRevisionForReview operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/SubmitListingRevisionForReview.go.html to see an example of how to use SubmitListingRevisionForReviewRequest. +type SubmitListingRevisionForReviewRequest struct { + + // The listing revision review information to be updated. + SubmitListingRevisionForReviewDetails `contributesTo:"body"` + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SubmitListingRevisionForReviewRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SubmitListingRevisionForReviewRequest) 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 SubmitListingRevisionForReviewRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SubmitListingRevisionForReviewRequest) 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 SubmitListingRevisionForReviewRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SubmitListingRevisionForReviewResponse wrapper for the SubmitListingRevisionForReview operation +type SubmitListingRevisionForReviewResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevision instance + ListingRevision `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 SubmitListingRevisionForReviewResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SubmitListingRevisionForReviewResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/support_contact.go b/marketplacepublisher/support_contact.go new file mode 100644 index 0000000000..337473e422 --- /dev/null +++ b/marketplacepublisher/support_contact.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SupportContact Contact information to use to get support. +type SupportContact struct { + + // The name of the contact. + Name *string `mandatory:"true" json:"name"` + + // The phone number of the contact. + Phone *string `mandatory:"false" json:"phone"` + + // The email of the contact. + Email *string `mandatory:"false" json:"email"` + + // The email subject line to use when contacting support. + Subject *string `mandatory:"false" json:"subject"` +} + +func (m SupportContact) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SupportContact) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/term.go b/marketplacepublisher/term.go new file mode 100644 index 0000000000..c3709b4b00 --- /dev/null +++ b/marketplacepublisher/term.go @@ -0,0 +1,164 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Term Base model object for the term. +type Term struct { + + // The name for the term. + Name *string `mandatory:"true" json:"name"` + + // Who authored the term. Publisher terms will be defaulted to 'PARTNER'. + Author TermAuthorEnum `mandatory:"true" json:"author"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier for the publisher. + PublisherId *string `mandatory:"true" json:"publisherId"` + + // The current state for the Term. + LifecycleState TermLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the term was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the term was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Unique OCID identifier for the term. + Id *string `mandatory:"false" json:"id"` + + // 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 Term) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Term) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTermAuthorEnum(string(m.Author)); !ok && m.Author != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Author: %s. Supported values are: %s.", m.Author, strings.Join(GetTermAuthorEnumStringValues(), ","))) + } + if _, ok := GetMappingTermLifecycleStateEnum(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(GetTermLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// TermAuthorEnum Enum with underlying type: string +type TermAuthorEnum string + +// Set of constants representing the allowable values for TermAuthorEnum +const ( + TermAuthorOracle TermAuthorEnum = "ORACLE" + TermAuthorPartner TermAuthorEnum = "PARTNER" +) + +var mappingTermAuthorEnum = map[string]TermAuthorEnum{ + "ORACLE": TermAuthorOracle, + "PARTNER": TermAuthorPartner, +} + +var mappingTermAuthorEnumLowerCase = map[string]TermAuthorEnum{ + "oracle": TermAuthorOracle, + "partner": TermAuthorPartner, +} + +// GetTermAuthorEnumValues Enumerates the set of values for TermAuthorEnum +func GetTermAuthorEnumValues() []TermAuthorEnum { + values := make([]TermAuthorEnum, 0) + for _, v := range mappingTermAuthorEnum { + values = append(values, v) + } + return values +} + +// GetTermAuthorEnumStringValues Enumerates the set of values in String for TermAuthorEnum +func GetTermAuthorEnumStringValues() []string { + return []string{ + "ORACLE", + "PARTNER", + } +} + +// GetMappingTermAuthorEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTermAuthorEnum(val string) (TermAuthorEnum, bool) { + enum, ok := mappingTermAuthorEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// TermLifecycleStateEnum Enum with underlying type: string +type TermLifecycleStateEnum string + +// Set of constants representing the allowable values for TermLifecycleStateEnum +const ( + TermLifecycleStateActive TermLifecycleStateEnum = "ACTIVE" + TermLifecycleStateInactive TermLifecycleStateEnum = "INACTIVE" +) + +var mappingTermLifecycleStateEnum = map[string]TermLifecycleStateEnum{ + "ACTIVE": TermLifecycleStateActive, + "INACTIVE": TermLifecycleStateInactive, +} + +var mappingTermLifecycleStateEnumLowerCase = map[string]TermLifecycleStateEnum{ + "active": TermLifecycleStateActive, + "inactive": TermLifecycleStateInactive, +} + +// GetTermLifecycleStateEnumValues Enumerates the set of values for TermLifecycleStateEnum +func GetTermLifecycleStateEnumValues() []TermLifecycleStateEnum { + values := make([]TermLifecycleStateEnum, 0) + for _, v := range mappingTermLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetTermLifecycleStateEnumStringValues Enumerates the set of values in String for TermLifecycleStateEnum +func GetTermLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + } +} + +// GetMappingTermLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTermLifecycleStateEnum(val string) (TermLifecycleStateEnum, bool) { + enum, ok := mappingTermLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/term_collection.go b/marketplacepublisher/term_collection.go new file mode 100644 index 0000000000..ebad647593 --- /dev/null +++ b/marketplacepublisher/term_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TermCollection Results of the term search. Contains term items. +type TermCollection struct { + + // List of the Terms summary. + Items []TermSummary `mandatory:"true" json:"items"` +} + +func (m TermCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TermCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/term_summary.go b/marketplacepublisher/term_summary.go new file mode 100644 index 0000000000..006a380d6c --- /dev/null +++ b/marketplacepublisher/term_summary.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TermSummary The model for the term summary. +type TermSummary struct { + + // Unique OCID identifier for the term. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name for the term. + Name *string `mandatory:"true" json:"name"` + + // Who authored the term. Publisher terms will be defaulted to as 'PARTNER'. + Author TermAuthorEnum `mandatory:"true" json:"author"` + + // The current state for the term version. + LifecycleState TermLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the resource was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the resource was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // 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 TermSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TermSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTermAuthorEnum(string(m.Author)); !ok && m.Author != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Author: %s. Supported values are: %s.", m.Author, strings.Join(GetTermAuthorEnumStringValues(), ","))) + } + if _, ok := GetMappingTermLifecycleStateEnum(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(GetTermLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/term_version.go b/marketplacepublisher/term_version.go new file mode 100644 index 0000000000..0dae4c2d2c --- /dev/null +++ b/marketplacepublisher/term_version.go @@ -0,0 +1,182 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TermVersion Model object for the term version details. +type TermVersion struct { + + // The unique identifier for the term. + TermId *string `mandatory:"true" json:"termId"` + + // Who authored the term. Publisher terms will be defaulted to 'PARTNER'. + TermAuthor TermAuthorEnum `mandatory:"true" json:"termAuthor"` + + // The name for the term version. + DisplayName *string `mandatory:"true" json:"displayName"` + + Attachment *TermVersionAttachment `mandatory:"true" json:"attachment"` + + // The current status for the term version. + Status TermVersionStatusEnum `mandatory:"true" json:"status"` + + // The current state for the term version. + LifecycleState TermVersionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the term version was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the term version was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Unique OCID identifier for the term version. + Id *string `mandatory:"false" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Who authored the term. Publisher terms will be defaulted to 'PARTNER'. + Author TermAuthorEnum `mandatory:"false" json:"author,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 TermVersion) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TermVersion) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTermAuthorEnum(string(m.TermAuthor)); !ok && m.TermAuthor != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TermAuthor: %s. Supported values are: %s.", m.TermAuthor, strings.Join(GetTermAuthorEnumStringValues(), ","))) + } + if _, ok := GetMappingTermVersionStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetTermVersionStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingTermVersionLifecycleStateEnum(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(GetTermVersionLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingTermAuthorEnum(string(m.Author)); !ok && m.Author != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Author: %s. Supported values are: %s.", m.Author, strings.Join(GetTermAuthorEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// TermVersionStatusEnum Enum with underlying type: string +type TermVersionStatusEnum string + +// Set of constants representing the allowable values for TermVersionStatusEnum +const ( + TermVersionStatusAvailable TermVersionStatusEnum = "AVAILABLE" + TermVersionStatusNotAvailable TermVersionStatusEnum = "NOT_AVAILABLE" + TermVersionStatusDeleted TermVersionStatusEnum = "DELETED" +) + +var mappingTermVersionStatusEnum = map[string]TermVersionStatusEnum{ + "AVAILABLE": TermVersionStatusAvailable, + "NOT_AVAILABLE": TermVersionStatusNotAvailable, + "DELETED": TermVersionStatusDeleted, +} + +var mappingTermVersionStatusEnumLowerCase = map[string]TermVersionStatusEnum{ + "available": TermVersionStatusAvailable, + "not_available": TermVersionStatusNotAvailable, + "deleted": TermVersionStatusDeleted, +} + +// GetTermVersionStatusEnumValues Enumerates the set of values for TermVersionStatusEnum +func GetTermVersionStatusEnumValues() []TermVersionStatusEnum { + values := make([]TermVersionStatusEnum, 0) + for _, v := range mappingTermVersionStatusEnum { + values = append(values, v) + } + return values +} + +// GetTermVersionStatusEnumStringValues Enumerates the set of values in String for TermVersionStatusEnum +func GetTermVersionStatusEnumStringValues() []string { + return []string{ + "AVAILABLE", + "NOT_AVAILABLE", + "DELETED", + } +} + +// GetMappingTermVersionStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTermVersionStatusEnum(val string) (TermVersionStatusEnum, bool) { + enum, ok := mappingTermVersionStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// TermVersionLifecycleStateEnum Enum with underlying type: string +type TermVersionLifecycleStateEnum string + +// Set of constants representing the allowable values for TermVersionLifecycleStateEnum +const ( + TermVersionLifecycleStateActive TermVersionLifecycleStateEnum = "ACTIVE" + TermVersionLifecycleStateInactive TermVersionLifecycleStateEnum = "INACTIVE" +) + +var mappingTermVersionLifecycleStateEnum = map[string]TermVersionLifecycleStateEnum{ + "ACTIVE": TermVersionLifecycleStateActive, + "INACTIVE": TermVersionLifecycleStateInactive, +} + +var mappingTermVersionLifecycleStateEnumLowerCase = map[string]TermVersionLifecycleStateEnum{ + "active": TermVersionLifecycleStateActive, + "inactive": TermVersionLifecycleStateInactive, +} + +// GetTermVersionLifecycleStateEnumValues Enumerates the set of values for TermVersionLifecycleStateEnum +func GetTermVersionLifecycleStateEnumValues() []TermVersionLifecycleStateEnum { + values := make([]TermVersionLifecycleStateEnum, 0) + for _, v := range mappingTermVersionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetTermVersionLifecycleStateEnumStringValues Enumerates the set of values in String for TermVersionLifecycleStateEnum +func GetTermVersionLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + } +} + +// GetMappingTermVersionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTermVersionLifecycleStateEnum(val string) (TermVersionLifecycleStateEnum, bool) { + enum, ok := mappingTermVersionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/term_version_attachment.go b/marketplacepublisher/term_version_attachment.go new file mode 100644 index 0000000000..ba2d1a5744 --- /dev/null +++ b/marketplacepublisher/term_version_attachment.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TermVersionAttachment An attachment uploaded by the Publisher for the term. +type TermVersionAttachment struct { + + // The content URL of the uploaded data. + ContentUrl *string `mandatory:"true" json:"contentUrl"` + + // The MIME type of the uploaded data. + MimeType *string `mandatory:"true" json:"mimeType"` +} + +func (m TermVersionAttachment) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TermVersionAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/term_version_collection.go b/marketplacepublisher/term_version_collection.go new file mode 100644 index 0000000000..d882efc625 --- /dev/null +++ b/marketplacepublisher/term_version_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TermVersionCollection Results of the term version search. Contains term version items. +type TermVersionCollection struct { + + // List of the Terms version summary. + Items []TermVersionSummary `mandatory:"true" json:"items"` +} + +func (m TermVersionCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TermVersionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/term_version_summary.go b/marketplacepublisher/term_version_summary.go new file mode 100644 index 0000000000..2fdbdce44b --- /dev/null +++ b/marketplacepublisher/term_version_summary.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TermVersionSummary The model for the term version summary. +type TermVersionSummary struct { + + // Unique OCID identifier for the term version. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name for the term version. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current status for the term version. + Status TermVersionStatusEnum `mandatory:"true" json:"status"` + + // The current state for the Term version. + LifecycleState TermVersionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the term version was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the time version was updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2022-09-15T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // 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 TermVersionSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TermVersionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTermVersionStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetTermVersionStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingTermVersionLifecycleStateEnum(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(GetTermVersionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/un_publish_listing_revision_package_request_response.go b/marketplacepublisher/un_publish_listing_revision_package_request_response.go new file mode 100644 index 0000000000..b561168eea --- /dev/null +++ b/marketplacepublisher/un_publish_listing_revision_package_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UnPublishListingRevisionPackageRequest wrapper for the UnPublishListingRevisionPackage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UnPublishListingRevisionPackage.go.html to see an example of how to use UnPublishListingRevisionPackageRequest. +type UnPublishListingRevisionPackageRequest struct { + + // Unique listing revision package identifier. + ListingRevisionPackageId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionPackageId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UnPublishListingRevisionPackageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UnPublishListingRevisionPackageRequest) 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 UnPublishListingRevisionPackageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UnPublishListingRevisionPackageRequest) 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 UnPublishListingRevisionPackageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnPublishListingRevisionPackageResponse wrapper for the UnPublishListingRevisionPackage operation +type UnPublishListingRevisionPackageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UnPublishListingRevisionPackageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UnPublishListingRevisionPackageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_artifact_details.go b/marketplacepublisher/update_artifact_details.go new file mode 100644 index 0000000000..9de40aefc3 --- /dev/null +++ b/marketplacepublisher/update_artifact_details.go @@ -0,0 +1,123 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateArtifactDetails The model for an Oracle Cloud Infrastructure Marketplace artifact. +type UpdateArtifactDetails interface { + + // The unique identifier for the compartment. + GetCompartmentId() *string + + // The display name for the artifact. + GetDisplayName() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type updateartifactdetails struct { + JsonData []byte + CompartmentId *string `mandatory:"false" json:"compartmentId"` + DisplayName *string `mandatory:"false" json:"displayName"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + ArtifactType string `json:"artifactType"` +} + +// UnmarshalJSON unmarshals json +func (m *updateartifactdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdateartifactdetails updateartifactdetails + s := struct { + Model Unmarshalerupdateartifactdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.DisplayName = s.Model.DisplayName + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.ArtifactType = s.Model.ArtifactType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updateartifactdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ArtifactType { + case "HELM_CHART": + mm := UpdateKubernetesImageArtifactDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CONTAINER_IMAGE": + mm := UpdateContainerImageArtifactDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateArtifactDetails: %s.", m.ArtifactType) + return *m, nil + } +} + +// GetCompartmentId returns CompartmentId +func (m updateartifactdetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m updateartifactdetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetFreeformTags returns FreeformTags +func (m updateartifactdetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m updateartifactdetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m updateartifactdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updateartifactdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_artifact_request_response.go b/marketplacepublisher/update_artifact_request_response.go new file mode 100644 index 0000000000..b2062dacdd --- /dev/null +++ b/marketplacepublisher/update_artifact_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateArtifactRequest wrapper for the UpdateArtifact operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateArtifact.go.html to see an example of how to use UpdateArtifactRequest. +type UpdateArtifactRequest struct { + + // artifact OCID + ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` + + // Request object for updating an artifact. + UpdateArtifactDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateArtifactRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateArtifactRequest) 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 UpdateArtifactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateArtifactRequest) 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 UpdateArtifactRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateArtifactResponse wrapper for the UpdateArtifact operation +type UpdateArtifactResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateArtifactResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateArtifactResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_container_image_artifact_details.go b/marketplacepublisher/update_container_image_artifact_details.go new file mode 100644 index 0000000000..2d42c2aadd --- /dev/null +++ b/marketplacepublisher/update_container_image_artifact_details.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerImageArtifactDetails Details to update the container image artifact. +type UpdateContainerImageArtifactDetails struct { + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The display name for the artifact. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + ContainerImage *UpdateContainerImageDetails `mandatory:"false" json:"containerImage"` +} + +// GetCompartmentId returns CompartmentId +func (m UpdateContainerImageArtifactDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m UpdateContainerImageArtifactDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetFreeformTags returns FreeformTags +func (m UpdateContainerImageArtifactDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m UpdateContainerImageArtifactDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateContainerImageArtifactDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerImageArtifactDetails) 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 UpdateContainerImageArtifactDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateContainerImageArtifactDetails UpdateContainerImageArtifactDetails + s := struct { + DiscriminatorParam string `json:"artifactType"` + MarshalTypeUpdateContainerImageArtifactDetails + }{ + "CONTAINER_IMAGE", + (MarshalTypeUpdateContainerImageArtifactDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/update_container_image_details.go b/marketplacepublisher/update_container_image_details.go new file mode 100644 index 0000000000..e795e23ecb --- /dev/null +++ b/marketplacepublisher/update_container_image_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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerImageDetails Container image details required to update a container artifact. +type UpdateContainerImageDetails struct { + + // The source registry OCID of the container image. + SourceRegistryId *string `mandatory:"true" json:"sourceRegistryId"` + + // The source registry url of the container image. + SourceRegistryUrl *string `mandatory:"true" json:"sourceRegistryUrl"` +} + +func (m UpdateContainerImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_helm_chart_image_details.go b/marketplacepublisher/update_helm_chart_image_details.go new file mode 100644 index 0000000000..94dedaa324 --- /dev/null +++ b/marketplacepublisher/update_helm_chart_image_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateHelmChartImageDetails Helmchart image details required to update an helmchart artifact. +type UpdateHelmChartImageDetails struct { + + // The source registry OCID of the helmchart image. + SourceRegistryId *string `mandatory:"true" json:"sourceRegistryId"` + + // The source registry url of the helmchart image. + SourceRegistryUrl *string `mandatory:"true" json:"sourceRegistryUrl"` + + // The Supported Versions of Kubernetes + SupportedKubernetesVersions []string `mandatory:"false" json:"supportedKubernetesVersions"` +} + +func (m UpdateHelmChartImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateHelmChartImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_kubernetes_image_artifact_details.go b/marketplacepublisher/update_kubernetes_image_artifact_details.go new file mode 100644 index 0000000000..c72dd93b3d --- /dev/null +++ b/marketplacepublisher/update_kubernetes_image_artifact_details.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateKubernetesImageArtifactDetails Details to update the kubernetes image artifact. +type UpdateKubernetesImageArtifactDetails struct { + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The display name for the artifact. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + HelmChart *UpdateHelmChartImageDetails `mandatory:"false" json:"helmChart"` + + // List of container image artifact unique identifiers included in the helm chart. + ContainerImageArtifactIds []string `mandatory:"false" json:"containerImageArtifactIds"` +} + +// GetCompartmentId returns CompartmentId +func (m UpdateKubernetesImageArtifactDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m UpdateKubernetesImageArtifactDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetFreeformTags returns FreeformTags +func (m UpdateKubernetesImageArtifactDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m UpdateKubernetesImageArtifactDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateKubernetesImageArtifactDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateKubernetesImageArtifactDetails) 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 UpdateKubernetesImageArtifactDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateKubernetesImageArtifactDetails UpdateKubernetesImageArtifactDetails + s := struct { + DiscriminatorParam string `json:"artifactType"` + MarshalTypeUpdateKubernetesImageArtifactDetails + }{ + "HELM_CHART", + (MarshalTypeUpdateKubernetesImageArtifactDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/update_listing_details.go b/marketplacepublisher/update_listing_details.go new file mode 100644 index 0000000000..b96f68a40c --- /dev/null +++ b/marketplacepublisher/update_listing_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateListingDetails Details to update an existing listing. +type UpdateListingDetails struct { + + // 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 UpdateListingDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateListingDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_listing_request_response.go b/marketplacepublisher/update_listing_request_response.go new file mode 100644 index 0000000000..e25cefff53 --- /dev/null +++ b/marketplacepublisher/update_listing_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateListingRequest wrapper for the UpdateListing operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListing.go.html to see an example of how to use UpdateListingRequest. +type UpdateListingRequest struct { + + // listing OCID + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // The information to be updated. + UpdateListingDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateListingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateListingRequest) 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 UpdateListingRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateListingRequest) 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 UpdateListingRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateListingResponse wrapper for the UpdateListing operation +type UpdateListingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Listing instance + Listing `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 UpdateListingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateListingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_listing_revision_attachment_content_request_response.go b/marketplacepublisher/update_listing_revision_attachment_content_request_response.go new file mode 100644 index 0000000000..10346f82ec --- /dev/null +++ b/marketplacepublisher/update_listing_revision_attachment_content_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// UpdateListingRevisionAttachmentContentRequest wrapper for the UpdateListingRevisionAttachmentContent operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionAttachmentContent.go.html to see an example of how to use UpdateListingRevisionAttachmentContentRequest. +type UpdateListingRevisionAttachmentContentRequest struct { + + // attachment OCID + ListingRevisionAttachmentId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionAttachmentId"` + + // The attachment to upload. + UpdateListingRevisionAttachmentContent io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateListingRevisionAttachmentContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateListingRevisionAttachmentContentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateListingRevisionAttachmentContentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.UpdateListingRevisionAttachmentContent) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateListingRevisionAttachmentContentRequest) 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 UpdateListingRevisionAttachmentContentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateListingRevisionAttachmentContentResponse wrapper for the UpdateListingRevisionAttachmentContent operation +type UpdateListingRevisionAttachmentContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionAttachment instance + ListingRevisionAttachment `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateListingRevisionAttachmentContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateListingRevisionAttachmentContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_listing_revision_attachment_details.go b/marketplacepublisher/update_listing_revision_attachment_details.go new file mode 100644 index 0000000000..b45b46c0f4 --- /dev/null +++ b/marketplacepublisher/update_listing_revision_attachment_details.go @@ -0,0 +1,127 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateListingRevisionAttachmentDetails Update the attachment for the listing revision. +type UpdateListingRevisionAttachmentDetails interface { + + // The name for the listing revision attachment. + GetDisplayName() *string + + // The description for the listing revision attachment. + GetDescription() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type updatelistingrevisionattachmentdetails struct { + JsonData []byte + DisplayName *string `mandatory:"false" json:"displayName"` + Description *string `mandatory:"false" json:"description"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + AttachmentType string `json:"attachmentType"` +} + +// UnmarshalJSON unmarshals json +func (m *updatelistingrevisionattachmentdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdatelistingrevisionattachmentdetails updatelistingrevisionattachmentdetails + s := struct { + Model Unmarshalerupdatelistingrevisionattachmentdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DisplayName = s.Model.DisplayName + m.Description = s.Model.Description + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.AttachmentType = s.Model.AttachmentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updatelistingrevisionattachmentdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.AttachmentType { + case "SCREENSHOT": + mm := UpdateScreenShotAttachmentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "RELATED_DOCUMENT": + mm := UpdateRelatedDocumentAttachmentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VIDEO": + mm := UpdateVideoAttachmentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateListingRevisionAttachmentDetails: %s.", m.AttachmentType) + return *m, nil + } +} + +// GetDisplayName returns DisplayName +func (m updatelistingrevisionattachmentdetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m updatelistingrevisionattachmentdetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m updatelistingrevisionattachmentdetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m updatelistingrevisionattachmentdetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m updatelistingrevisionattachmentdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updatelistingrevisionattachmentdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_listing_revision_attachment_request_response.go b/marketplacepublisher/update_listing_revision_attachment_request_response.go new file mode 100644 index 0000000000..bebd8b28e9 --- /dev/null +++ b/marketplacepublisher/update_listing_revision_attachment_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateListingRevisionAttachmentRequest wrapper for the UpdateListingRevisionAttachment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionAttachment.go.html to see an example of how to use UpdateListingRevisionAttachmentRequest. +type UpdateListingRevisionAttachmentRequest struct { + + // attachment OCID + ListingRevisionAttachmentId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionAttachmentId"` + + // The attachment to be updated. + UpdateListingRevisionAttachmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateListingRevisionAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateListingRevisionAttachmentRequest) 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 UpdateListingRevisionAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateListingRevisionAttachmentRequest) 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 UpdateListingRevisionAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateListingRevisionAttachmentResponse wrapper for the UpdateListingRevisionAttachment operation +type UpdateListingRevisionAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionAttachment instance + ListingRevisionAttachment `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateListingRevisionAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateListingRevisionAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_listing_revision_details.go b/marketplacepublisher/update_listing_revision_details.go new file mode 100644 index 0000000000..e21bde100b --- /dev/null +++ b/marketplacepublisher/update_listing_revision_details.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateListingRevisionDetails The model for an Oracle Cloud Infrastructure Marketplace Publisher listing revision. +type UpdateListingRevisionDetails struct { + + // The name for the listing revision. + DisplayName *string `mandatory:"false" json:"displayName"` + + VersionDetails *VersionDetails `mandatory:"false" json:"versionDetails"` + + // Single line introduction for the listing revision. + Headline *string `mandatory:"false" json:"headline"` + + // The tagline for the listing revision. + Tagline *string `mandatory:"false" json:"tagline"` + + // Keywords associated for the listing revision. + Keywords *string `mandatory:"false" json:"keywords"` + + // A short description for the listing revision. + ShortDescription *string `mandatory:"false" json:"shortDescription"` + + // Usage information for the listing revision. + UsageInformation *string `mandatory:"false" json:"usageInformation"` + + // A long description for the listing revision. + LongDescription *string `mandatory:"false" json:"longDescription"` + + // System requirements for the listing revision. + SystemRequirements *string `mandatory:"false" json:"systemRequirements"` + + // The categories for the listing revision. + Categories []string `mandatory:"false" json:"categories"` + + // The markets supported by the listing revision. + Markets []string `mandatory:"false" json:"markets"` + + ContentLanguage *LanguageItem `mandatory:"false" json:"contentLanguage"` + + // Languages supported by the listing revision. + Supportedlanguages []LanguageItem `mandatory:"false" json:"supportedlanguages"` + + // Contact information to use to get support from the publisher for the listing revision. + SupportContacts []SupportContact `mandatory:"false" json:"supportContacts"` + + // Links to support resources for the listing revision. + SupportLinks []NamedLink `mandatory:"false" json:"supportLinks"` + + // The pricing model for the listing revision. + PricingType ListingRevisionPricingTypeEnum `mandatory:"false" json:"pricingType,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"` +} + +func (m UpdateListingRevisionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateListingRevisionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingListingRevisionPricingTypeEnum(string(m.PricingType)); !ok && m.PricingType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PricingType: %s. Supported values are: %s.", m.PricingType, strings.Join(GetListingRevisionPricingTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_listing_revision_icon_content_request_response.go b/marketplacepublisher/update_listing_revision_icon_content_request_response.go new file mode 100644 index 0000000000..eebc9e96ae --- /dev/null +++ b/marketplacepublisher/update_listing_revision_icon_content_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// UpdateListingRevisionIconContentRequest wrapper for the UpdateListingRevisionIconContent operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionIconContent.go.html to see an example of how to use UpdateListingRevisionIconContentRequest. +type UpdateListingRevisionIconContentRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // The listing revision icon to be updated. + UpdateListingRevisionIconContent io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateListingRevisionIconContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateListingRevisionIconContentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateListingRevisionIconContentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.UpdateListingRevisionIconContent) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateListingRevisionIconContentRequest) 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 UpdateListingRevisionIconContentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateListingRevisionIconContentResponse wrapper for the UpdateListingRevisionIconContent operation +type UpdateListingRevisionIconContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevision instance + ListingRevision `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 UpdateListingRevisionIconContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateListingRevisionIconContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_listing_revision_package_details.go b/marketplacepublisher/update_listing_revision_package_details.go new file mode 100644 index 0000000000..2d27ac6c66 --- /dev/null +++ b/marketplacepublisher/update_listing_revision_package_details.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateListingRevisionPackageDetails The model for an Oracle Cloud Infrastructure Marketplace Listing revison package. +type UpdateListingRevisionPackageDetails struct { + + // The version for the package. + PackageVersion *string `mandatory:"false" json:"packageVersion"` + + // The name for the listing revision package. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description for this package. + Description *string `mandatory:"false" json:"description"` + + // The unique identifier for the artifact. + ArtifactId *string `mandatory:"false" json:"artifactId"` + + // The unique term identifier. + TermId *string `mandatory:"false" json:"termId"` + + // Identifies that this will be default package for the listing revision. + IsDefault *bool `mandatory:"false" json:"isDefault"` + + // Identifies whether security upgrades will be provided for this package. + AreSecurityUpgradesProvided *bool `mandatory:"false" json:"areSecurityUpgradesProvided"` + + // 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 UpdateListingRevisionPackageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateListingRevisionPackageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_listing_revision_package_request_response.go b/marketplacepublisher/update_listing_revision_package_request_response.go new file mode 100644 index 0000000000..2590a026df --- /dev/null +++ b/marketplacepublisher/update_listing_revision_package_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateListingRevisionPackageRequest wrapper for the UpdateListingRevisionPackage operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevisionPackage.go.html to see an example of how to use UpdateListingRevisionPackageRequest. +type UpdateListingRevisionPackageRequest struct { + + // Unique listing revision package identifier. + ListingRevisionPackageId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionPackageId"` + + // The information to be updated. + UpdateListingRevisionPackageDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateListingRevisionPackageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateListingRevisionPackageRequest) 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 UpdateListingRevisionPackageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateListingRevisionPackageRequest) 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 UpdateListingRevisionPackageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateListingRevisionPackageResponse wrapper for the UpdateListingRevisionPackage operation +type UpdateListingRevisionPackageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevisionPackage instance + ListingRevisionPackage `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateListingRevisionPackageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateListingRevisionPackageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_listing_revision_request_response.go b/marketplacepublisher/update_listing_revision_request_response.go new file mode 100644 index 0000000000..952146ca4e --- /dev/null +++ b/marketplacepublisher/update_listing_revision_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateListingRevisionRequest wrapper for the UpdateListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateListingRevision.go.html to see an example of how to use UpdateListingRevisionRequest. +type UpdateListingRevisionRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // The listing revision information to be updated. + UpdateListingRevisionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateListingRevisionRequest) 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 UpdateListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateListingRevisionRequest) 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 UpdateListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateListingRevisionResponse wrapper for the UpdateListingRevision operation +type UpdateListingRevisionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ListingRevision instance + ListingRevision `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 UpdateListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_related_document_attachment_details.go b/marketplacepublisher/update_related_document_attachment_details.go new file mode 100644 index 0000000000..d2da38598e --- /dev/null +++ b/marketplacepublisher/update_related_document_attachment_details.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateRelatedDocumentAttachmentDetails Update Details of the related document attachment. +type UpdateRelatedDocumentAttachmentDetails struct { + + // The name for the listing revision attachment. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description for the listing revision attachment. + 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"` + + // The document category of the listing revision attachment. + DocumentCategory RelatedDocumentAttachmentDocumentCategoryEnum `mandatory:"false" json:"documentCategory,omitempty"` +} + +// GetDisplayName returns DisplayName +func (m UpdateRelatedDocumentAttachmentDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m UpdateRelatedDocumentAttachmentDetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m UpdateRelatedDocumentAttachmentDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m UpdateRelatedDocumentAttachmentDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateRelatedDocumentAttachmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateRelatedDocumentAttachmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingRelatedDocumentAttachmentDocumentCategoryEnum(string(m.DocumentCategory)); !ok && m.DocumentCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DocumentCategory: %s. Supported values are: %s.", m.DocumentCategory, strings.Join(GetRelatedDocumentAttachmentDocumentCategoryEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateRelatedDocumentAttachmentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateRelatedDocumentAttachmentDetails UpdateRelatedDocumentAttachmentDetails + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeUpdateRelatedDocumentAttachmentDetails + }{ + "RELATED_DOCUMENT", + (MarshalTypeUpdateRelatedDocumentAttachmentDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/update_screen_shot_attachment_details.go b/marketplacepublisher/update_screen_shot_attachment_details.go new file mode 100644 index 0000000000..05418a3234 --- /dev/null +++ b/marketplacepublisher/update_screen_shot_attachment_details.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateScreenShotAttachmentDetails Update details of the screenshot attachment. +type UpdateScreenShotAttachmentDetails struct { + + // The name for the listing revision attachment. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description for the listing revision attachment. + 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"` +} + +// GetDisplayName returns DisplayName +func (m UpdateScreenShotAttachmentDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m UpdateScreenShotAttachmentDetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m UpdateScreenShotAttachmentDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m UpdateScreenShotAttachmentDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateScreenShotAttachmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateScreenShotAttachmentDetails) 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 UpdateScreenShotAttachmentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateScreenShotAttachmentDetails UpdateScreenShotAttachmentDetails + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeUpdateScreenShotAttachmentDetails + }{ + "SCREENSHOT", + (MarshalTypeUpdateScreenShotAttachmentDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/update_term_details.go b/marketplacepublisher/update_term_details.go new file mode 100644 index 0000000000..85a42f9343 --- /dev/null +++ b/marketplacepublisher/update_term_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateTermDetails Details to update Marketplace Publisher term. +type UpdateTermDetails struct { + + // 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 UpdateTermDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateTermDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_term_request_response.go b/marketplacepublisher/update_term_request_response.go new file mode 100644 index 0000000000..adc934d5cf --- /dev/null +++ b/marketplacepublisher/update_term_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateTermRequest wrapper for the UpdateTerm operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateTerm.go.html to see an example of how to use UpdateTermRequest. +type UpdateTermRequest struct { + + // term OCID + TermId *string `mandatory:"true" contributesTo:"path" name:"termId"` + + // The information to be updated. + UpdateTermDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateTermRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateTermRequest) 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 UpdateTermRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTermRequest) 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 UpdateTermRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateTermResponse wrapper for the UpdateTerm operation +type UpdateTermResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Term instance + Term `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 UpdateTermResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTermResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_term_version_content_request_response.go b/marketplacepublisher/update_term_version_content_request_response.go new file mode 100644 index 0000000000..897fc82102 --- /dev/null +++ b/marketplacepublisher/update_term_version_content_request_response.go @@ -0,0 +1,109 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// UpdateTermVersionContentRequest wrapper for the UpdateTermVersionContent operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateTermVersionContent.go.html to see an example of how to use UpdateTermVersionContentRequest. +type UpdateTermVersionContentRequest struct { + + // term version OCID + TermVersionId *string `mandatory:"true" contributesTo:"path" name:"termVersionId"` + + // The term attachment to upload. + UpdateTermVersionContent io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The name of the resource. + DisplayName *string `mandatory:"false" contributesTo:"header" name:"display-name"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateTermVersionContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateTermVersionContentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateTermVersionContentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.UpdateTermVersionContent) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTermVersionContentRequest) 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 UpdateTermVersionContentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateTermVersionContentResponse wrapper for the UpdateTermVersionContent operation +type UpdateTermVersionContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TermVersion instance + TermVersion `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 UpdateTermVersionContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTermVersionContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_term_version_details.go b/marketplacepublisher/update_term_version_details.go new file mode 100644 index 0000000000..7545ce77da --- /dev/null +++ b/marketplacepublisher/update_term_version_details.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateTermVersionDetails Details to update Marketplace Publisher term version. +type UpdateTermVersionDetails struct { + + // The name for the term version. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateTermVersionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateTermVersionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/update_term_version_request_response.go b/marketplacepublisher/update_term_version_request_response.go new file mode 100644 index 0000000000..ea4abd8950 --- /dev/null +++ b/marketplacepublisher/update_term_version_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateTermVersionRequest wrapper for the UpdateTermVersion operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/UpdateTermVersion.go.html to see an example of how to use UpdateTermVersionRequest. +type UpdateTermVersionRequest struct { + + // term version OCID + TermVersionId *string `mandatory:"true" contributesTo:"path" name:"termVersionId"` + + // Term Version details to be updated. + UpdateTermVersionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateTermVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateTermVersionRequest) 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 UpdateTermVersionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTermVersionRequest) 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 UpdateTermVersionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateTermVersionResponse wrapper for the UpdateTermVersion operation +type UpdateTermVersionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TermVersion instance + TermVersion `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 UpdateTermVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTermVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/update_video_attachment_details.go b/marketplacepublisher/update_video_attachment_details.go new file mode 100644 index 0000000000..cd34c01375 --- /dev/null +++ b/marketplacepublisher/update_video_attachment_details.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateVideoAttachmentDetails Details of the video attachment. +type UpdateVideoAttachmentDetails struct { + + // The name for the listing revision attachment. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description for the listing revision attachment. + 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"` +} + +// GetDisplayName returns DisplayName +func (m UpdateVideoAttachmentDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m UpdateVideoAttachmentDetails) GetDescription() *string { + return m.Description +} + +// GetFreeformTags returns FreeformTags +func (m UpdateVideoAttachmentDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m UpdateVideoAttachmentDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateVideoAttachmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateVideoAttachmentDetails) 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 UpdateVideoAttachmentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateVideoAttachmentDetails UpdateVideoAttachmentDetails + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeUpdateVideoAttachmentDetails + }{ + "VIDEO", + (MarshalTypeUpdateVideoAttachmentDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/upload_data.go b/marketplacepublisher/upload_data.go new file mode 100644 index 0000000000..7a9b17737d --- /dev/null +++ b/marketplacepublisher/upload_data.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UploadData The model for upload data for images and icons. +type UploadData struct { + + // The name used to refer to the upload data. + Name *string `mandatory:"false" json:"name"` + + // The content URL of the upload data. + ContentUrl *string `mandatory:"false" json:"contentUrl"` + + // The MIME type of the upload data. + MimeType *string `mandatory:"false" json:"mimeType"` +} + +func (m UploadData) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UploadData) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/validate_and_publish_artifact_request_response.go b/marketplacepublisher/validate_and_publish_artifact_request_response.go new file mode 100644 index 0000000000..ec5becf48b --- /dev/null +++ b/marketplacepublisher/validate_and_publish_artifact_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ValidateAndPublishArtifactRequest wrapper for the ValidateAndPublishArtifact operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/ValidateAndPublishArtifact.go.html to see an example of how to use ValidateAndPublishArtifactRequest. +type ValidateAndPublishArtifactRequest struct { + + // artifact OCID + ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ValidateAndPublishArtifactRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ValidateAndPublishArtifactRequest) 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 ValidateAndPublishArtifactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ValidateAndPublishArtifactRequest) 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 ValidateAndPublishArtifactRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ValidateAndPublishArtifactResponse wrapper for the ValidateAndPublishArtifact operation +type ValidateAndPublishArtifactResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ValidateAndPublishArtifactResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ValidateAndPublishArtifactResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/validation_status.go b/marketplacepublisher/validation_status.go new file mode 100644 index 0000000000..4d7f6e0542 --- /dev/null +++ b/marketplacepublisher/validation_status.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// ValidationStatusEnum Enum with underlying type: string +type ValidationStatusEnum string + +// Set of constants representing the allowable values for ValidationStatusEnum +const ( + ValidationStatusValidationInProgress ValidationStatusEnum = "VALIDATION_IN_PROGRESS" + ValidationStatusValidationFailed ValidationStatusEnum = "VALIDATION_FAILED" + ValidationStatusValidationCompleted ValidationStatusEnum = "VALIDATION_COMPLETED" +) + +var mappingValidationStatusEnum = map[string]ValidationStatusEnum{ + "VALIDATION_IN_PROGRESS": ValidationStatusValidationInProgress, + "VALIDATION_FAILED": ValidationStatusValidationFailed, + "VALIDATION_COMPLETED": ValidationStatusValidationCompleted, +} + +var mappingValidationStatusEnumLowerCase = map[string]ValidationStatusEnum{ + "validation_in_progress": ValidationStatusValidationInProgress, + "validation_failed": ValidationStatusValidationFailed, + "validation_completed": ValidationStatusValidationCompleted, +} + +// GetValidationStatusEnumValues Enumerates the set of values for ValidationStatusEnum +func GetValidationStatusEnumValues() []ValidationStatusEnum { + values := make([]ValidationStatusEnum, 0) + for _, v := range mappingValidationStatusEnum { + values = append(values, v) + } + return values +} + +// GetValidationStatusEnumStringValues Enumerates the set of values in String for ValidationStatusEnum +func GetValidationStatusEnumStringValues() []string { + return []string{ + "VALIDATION_IN_PROGRESS", + "VALIDATION_FAILED", + "VALIDATION_COMPLETED", + } +} + +// GetMappingValidationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingValidationStatusEnum(val string) (ValidationStatusEnum, bool) { + enum, ok := mappingValidationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/version_details.go b/marketplacepublisher/version_details.go new file mode 100644 index 0000000000..7c99b4f28c --- /dev/null +++ b/marketplacepublisher/version_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VersionDetails A listing version provided by the Publisher. +type VersionDetails struct { + + // The version number. + Number *string `mandatory:"true" json:"number"` + + // The version description. + Description *string `mandatory:"true" json:"description"` + + // The version release date. + ReleaseDate *string `mandatory:"true" json:"releaseDate"` +} + +func (m VersionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VersionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/video_attachment.go b/marketplacepublisher/video_attachment.go new file mode 100644 index 0000000000..98093cc16d --- /dev/null +++ b/marketplacepublisher/video_attachment.go @@ -0,0 +1,148 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VideoAttachment Video attachment for the listing revision. +type VideoAttachment struct { + + // Unique OCID identifier for the listing revision attachment. + Id *string `mandatory:"true" json:"id"` + + // The unique identifier for the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The unique identifier of the listing revision that the specified attachment belongs to. + ListingRevisionId *string `mandatory:"true" json:"listingRevisionId"` + + // Name of the listing revision attachment. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the attachment was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the attachment was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The URL for the video. + ContentUrl *string `mandatory:"true" json:"contentUrl"` + + // Description of the listing revision attachment. + 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"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The current state of the attachment. + LifecycleState ListingRevisionAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m VideoAttachment) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m VideoAttachment) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetListingRevisionId returns ListingRevisionId +func (m VideoAttachment) GetListingRevisionId() *string { + return m.ListingRevisionId +} + +// GetDisplayName returns DisplayName +func (m VideoAttachment) GetDisplayName() *string { + return m.DisplayName +} + +// GetDescription returns Description +func (m VideoAttachment) GetDescription() *string { + return m.Description +} + +// GetLifecycleState returns LifecycleState +func (m VideoAttachment) GetLifecycleState() ListingRevisionAttachmentLifecycleStateEnum { + return m.LifecycleState +} + +// GetTimeCreated returns TimeCreated +func (m VideoAttachment) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m VideoAttachment) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetFreeformTags returns FreeformTags +func (m VideoAttachment) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m VideoAttachment) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m VideoAttachment) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m VideoAttachment) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VideoAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingListingRevisionAttachmentLifecycleStateEnum(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(GetListingRevisionAttachmentLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m VideoAttachment) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVideoAttachment VideoAttachment + s := struct { + DiscriminatorParam string `json:"attachmentType"` + MarshalTypeVideoAttachment + }{ + "VIDEO", + (MarshalTypeVideoAttachment)(m), + } + + return json.Marshal(&s) +} diff --git a/marketplacepublisher/withdraw_listing_revision_request_response.go b/marketplacepublisher/withdraw_listing_revision_request_response.go new file mode 100644 index 0000000000..4b16bdfc06 --- /dev/null +++ b/marketplacepublisher/withdraw_listing_revision_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 marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// WithdrawListingRevisionRequest wrapper for the WithdrawListingRevision operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/marketplacepublisher/WithdrawListingRevision.go.html to see an example of how to use WithdrawListingRevisionRequest. +type WithdrawListingRevisionRequest struct { + + // listing revision + ListingRevisionId *string `mandatory:"true" contributesTo:"path" name:"listingRevisionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request WithdrawListingRevisionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request WithdrawListingRevisionRequest) 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 WithdrawListingRevisionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request WithdrawListingRevisionRequest) 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 WithdrawListingRevisionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// WithdrawListingRevisionResponse wrapper for the WithdrawListingRevision operation +type WithdrawListingRevisionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response WithdrawListingRevisionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response WithdrawListingRevisionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/marketplacepublisher/work_request.go b/marketplacepublisher/work_request.go new file mode 100644 index 0000000000..302ba4f31c --- /dev/null +++ b/marketplacepublisher/work_request.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest A description of workrequest status +type WorkRequest struct { + + // Type of the work request + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The id of the work request. + Id *string `mandatory:"true" json:"id"` + + // The ocid of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Percentage of the request completed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the request was started, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), + // section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the object was finished, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/work_request_error.go b/marketplacepublisher/work_request_error.go new file mode 100644 index 0000000000..0bf10bddf5 --- /dev/null +++ b/marketplacepublisher/work_request_error.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestError An error encountered while executing a work request. +type WorkRequestError struct { + + // A machine-usable code for the error that occured. Error codes are listed on + // (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm) + Code *string `mandatory:"true" json:"code"` + + // A human readable description of the issue encountered. + Message *string `mandatory:"true" json:"message"` + + // The time the error occured. An RFC3339 formatted datetime string. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/work_request_error_collection.go b/marketplacepublisher/work_request_error_collection.go new file mode 100644 index 0000000000..e1b86fa027 --- /dev/null +++ b/marketplacepublisher/work_request_error_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection Results of a workRequestError search. Contains both WorkRequestError items and other information, such as metadata. +type WorkRequestErrorCollection struct { + + // List of workRequestError objects. + Items []WorkRequestError `mandatory:"true" json:"items"` +} + +func (m WorkRequestErrorCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestErrorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/work_request_log_entry.go b/marketplacepublisher/work_request_log_entry.go new file mode 100644 index 0000000000..e3f2d327cf --- /dev/null +++ b/marketplacepublisher/work_request_log_entry.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. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntry A log message from the execution of a work request. +type WorkRequestLogEntry struct { + + // Human-readable log message. + Message *string `mandatory:"true" json:"message"` + + // The time the log message was written. An RFC3339 formatted datetime string + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntry) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/work_request_log_entry_collection.go b/marketplacepublisher/work_request_log_entry_collection.go new file mode 100644 index 0000000000..fa5458b9bf --- /dev/null +++ b/marketplacepublisher/work_request_log_entry_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection Results of a workRequestLog search. Contains both workRequestLog items and other information, such as metadata. +type WorkRequestLogEntryCollection struct { + + // List of workRequestLogEntries. + Items []WorkRequestLogEntry `mandatory:"true" json:"items"` +} + +func (m WorkRequestLogEntryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/work_request_resource.go b/marketplacepublisher/work_request_resource.go new file mode 100644 index 0000000000..80fd8ff5fa --- /dev/null +++ b/marketplacepublisher/work_request_resource.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestResource A resource created or operated on by a work request. +type WorkRequestResource struct { + + // The resource type the work request affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource is affected by the work tracked in the work request. + // A resource being created, updated, or deleted will remain in the IN_PROGRESS state until + // work is complete for that resource at which point it will transition to CREATED, UPDATED, + // or DELETED, respectively. + ActionType ActionTypeEnum `mandatory:"true" json:"actionType"` + + // The identifier of the resource the work request affects. + Identifier *string `mandatory:"true" json:"identifier"` + + // The URI path that the user can do a GET on to access the resource metadata + EntityUri *string `mandatory:"false" json:"entityUri"` + + // Additional information that helps to explain the resource. + Metadata map[string]string `mandatory:"false" json:"metadata"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/work_request_resource_metadata_key.go b/marketplacepublisher/work_request_resource_metadata_key.go new file mode 100644 index 0000000000..d1f6c2696b --- /dev/null +++ b/marketplacepublisher/work_request_resource_metadata_key.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "strings" +) + +// WorkRequestResourceMetadataKeyEnum Enum with underlying type: string +type WorkRequestResourceMetadataKeyEnum string + +// Set of constants representing the allowable values for WorkRequestResourceMetadataKeyEnum +const ( + WorkRequestResourceMetadataKeyIsDryRun WorkRequestResourceMetadataKeyEnum = "IS_DRY_RUN" +) + +var mappingWorkRequestResourceMetadataKeyEnum = map[string]WorkRequestResourceMetadataKeyEnum{ + "IS_DRY_RUN": WorkRequestResourceMetadataKeyIsDryRun, +} + +var mappingWorkRequestResourceMetadataKeyEnumLowerCase = map[string]WorkRequestResourceMetadataKeyEnum{ + "is_dry_run": WorkRequestResourceMetadataKeyIsDryRun, +} + +// GetWorkRequestResourceMetadataKeyEnumValues Enumerates the set of values for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumValues() []WorkRequestResourceMetadataKeyEnum { + values := make([]WorkRequestResourceMetadataKeyEnum, 0) + for _, v := range mappingWorkRequestResourceMetadataKeyEnum { + values = append(values, v) + } + return values +} + +// GetWorkRequestResourceMetadataKeyEnumStringValues Enumerates the set of values in String for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumStringValues() []string { + return []string{ + "IS_DRY_RUN", + } +} + +// GetMappingWorkRequestResourceMetadataKeyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingWorkRequestResourceMetadataKeyEnum(val string) (WorkRequestResourceMetadataKeyEnum, bool) { + enum, ok := mappingWorkRequestResourceMetadataKeyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/marketplacepublisher/work_request_summary.go b/marketplacepublisher/work_request_summary.go new file mode 100644 index 0000000000..f9a36d9b08 --- /dev/null +++ b/marketplacepublisher/work_request_summary.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary A summary of the status of a work request. +type WorkRequestSummary struct { + + // Type of the work request + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The id of the work request. + Id *string `mandatory:"true" json:"id"` + + // The ocid of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Percentage of the request completed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the request was started, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), + // section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the object was finished, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/marketplacepublisher/work_request_summary_collection.go b/marketplacepublisher/work_request_summary_collection.go new file mode 100644 index 0000000000..b0ce0f2209 --- /dev/null +++ b/marketplacepublisher/work_request_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MarketplacePublisherService API +// +// Use the Marketplace Publisher API to manage the publishing of applications in Oracle Cloud Infrastructure Marketplace. +// + +package marketplacepublisher + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection Results of a workRequest search. Contains both WorkRequest items and other information, such as metadata. +type WorkRequestSummaryCollection struct { + + // List of workRequestSummary objects. + Items []WorkRequestSummary `mandatory:"true" json:"items"` +} + +func (m WorkRequestSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/address_list.go b/networkfirewall/address_list.go new file mode 100644 index 0000000000..d52bf59234 --- /dev/null +++ b/networkfirewall/address_list.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddressList List of addresses with a reference name. +// The value of an entry is a list of IP addresses or prefixes in CIDR notation or FQDNs. +// The associated key is the identifier by which the IP address list is referenced. +type AddressList struct { + + // Unique name to identify the group of addresses to be used in the policy rules. + Name *string `mandatory:"true" json:"name"` + + // Type of address List. The accepted values are - * FQDN * IP + Type AddressListTypeEnum `mandatory:"true" json:"type"` + + // List of addresses. + Addresses []string `mandatory:"true" json:"addresses"` + + // Count of total Addresses in the AddressList + TotalAddresses *int `mandatory:"true" json:"totalAddresses"` + + // OCID of the Network Firewall Policy this Address List belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m AddressList) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AddressList) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAddressListTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAddressListTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/address_list_summary.go b/networkfirewall/address_list_summary.go new file mode 100644 index 0000000000..8dd274565b --- /dev/null +++ b/networkfirewall/address_list_summary.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddressListSummary Address List Summary in the network firewall policy +type AddressListSummary struct { + + // Name of Address List + Name *string `mandatory:"true" json:"name"` + + // Type of address List. The accepted values are - * FQDN * IP + Type AddressListTypeEnum `mandatory:"true" json:"type"` + + // Count of total Addresses in the AddressList + TotalAddresses *int `mandatory:"true" json:"totalAddresses"` + + // OCID of the Network Firewall Policy this address list belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m AddressListSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AddressListSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAddressListTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAddressListTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/address_list_summary_collection.go b/networkfirewall/address_list_summary_collection.go new file mode 100644 index 0000000000..ddbb91bf81 --- /dev/null +++ b/networkfirewall/address_list_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddressListSummaryCollection Collection of Address Lists in the network firewall policy +type AddressListSummaryCollection struct { + + // Collection of address lists. + Items []AddressListSummary `mandatory:"true" json:"items"` +} + +func (m AddressListSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AddressListSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/address_list_type.go b/networkfirewall/address_list_type.go new file mode 100644 index 0000000000..bd258931e0 --- /dev/null +++ b/networkfirewall/address_list_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// AddressListTypeEnum Enum with underlying type: string +type AddressListTypeEnum string + +// Set of constants representing the allowable values for AddressListTypeEnum +const ( + AddressListTypeFqdn AddressListTypeEnum = "FQDN" + AddressListTypeIp AddressListTypeEnum = "IP" +) + +var mappingAddressListTypeEnum = map[string]AddressListTypeEnum{ + "FQDN": AddressListTypeFqdn, + "IP": AddressListTypeIp, +} + +var mappingAddressListTypeEnumLowerCase = map[string]AddressListTypeEnum{ + "fqdn": AddressListTypeFqdn, + "ip": AddressListTypeIp, +} + +// GetAddressListTypeEnumValues Enumerates the set of values for AddressListTypeEnum +func GetAddressListTypeEnumValues() []AddressListTypeEnum { + values := make([]AddressListTypeEnum, 0) + for _, v := range mappingAddressListTypeEnum { + values = append(values, v) + } + return values +} + +// GetAddressListTypeEnumStringValues Enumerates the set of values in String for AddressListTypeEnum +func GetAddressListTypeEnumStringValues() []string { + return []string{ + "FQDN", + "IP", + } +} + +// GetMappingAddressListTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAddressListTypeEnum(val string) (AddressListTypeEnum, bool) { + enum, ok := mappingAddressListTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/app_type.go b/networkfirewall/app_type.go new file mode 100644 index 0000000000..449d379de0 --- /dev/null +++ b/networkfirewall/app_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// AppTypeEnum Enum with underlying type: string +type AppTypeEnum string + +// Set of constants representing the allowable values for AppTypeEnum +const ( + AppTypeIcmp AppTypeEnum = "ICMP" + AppTypeIcmpV6 AppTypeEnum = "ICMP_V6" +) + +var mappingAppTypeEnum = map[string]AppTypeEnum{ + "ICMP": AppTypeIcmp, + "ICMP_V6": AppTypeIcmpV6, +} + +var mappingAppTypeEnumLowerCase = map[string]AppTypeEnum{ + "icmp": AppTypeIcmp, + "icmp_v6": AppTypeIcmpV6, +} + +// GetAppTypeEnumValues Enumerates the set of values for AppTypeEnum +func GetAppTypeEnumValues() []AppTypeEnum { + values := make([]AppTypeEnum, 0) + for _, v := range mappingAppTypeEnum { + values = append(values, v) + } + return values +} + +// GetAppTypeEnumStringValues Enumerates the set of values in String for AppTypeEnum +func GetAppTypeEnumStringValues() []string { + return []string{ + "ICMP", + "ICMP_V6", + } +} + +// GetMappingAppTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAppTypeEnum(val string) (AppTypeEnum, bool) { + enum, ok := mappingAppTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/application.go b/networkfirewall/application.go index 7e396406bd..e1be08e5fc 100644 --- a/networkfirewall/application.go +++ b/networkfirewall/application.go @@ -19,11 +19,19 @@ import ( // Application A protocol identifier (such as TCP, UDP, or ICMP) // and protocol-specific parameters (such as a port range). type Application interface { + + // Name of the application. + GetName() *string + + // OCID of the Network Firewall Policy this application belongs to. + GetParentResourceId() *string } type application struct { - JsonData []byte - Type string `json:"type"` + JsonData []byte + Name *string `mandatory:"true" json:"name"` + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + Type string `json:"type"` } // UnmarshalJSON unmarshals json @@ -37,6 +45,8 @@ func (m *application) UnmarshalJSON(data []byte) error { if err != nil { return err } + m.Name = s.Model.Name + m.ParentResourceId = s.Model.ParentResourceId m.Type = s.Model.Type return err @@ -55,15 +65,7 @@ func (m *application) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) mm := IcmpApplication{} err = json.Unmarshal(data, &mm) return mm, err - case "UDP": - mm := UdpApplication{} - err = json.Unmarshal(data, &mm) - return mm, err - case "TCP": - mm := TcpApplication{} - err = json.Unmarshal(data, &mm) - return mm, err - case "ICMP6": + case "ICMP_V6": mm := Icmp6Application{} err = json.Unmarshal(data, &mm) return mm, err @@ -73,6 +75,16 @@ func (m *application) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) } } +// GetName returns Name +func (m application) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m application) GetParentResourceId() *string { + return m.ParentResourceId +} + func (m application) String() string { return common.PointerString(m) } diff --git a/networkfirewall/application_group.go b/networkfirewall/application_group.go new file mode 100644 index 0000000000..1596661221 --- /dev/null +++ b/networkfirewall/application_group.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApplicationGroup A group of applications. +type ApplicationGroup struct { + + // Name of the application Group. + Name *string `mandatory:"true" json:"name"` + + // List of apps in the group. + Apps []string `mandatory:"true" json:"apps"` + + // Count of total applications in the given application group. + TotalApps *int `mandatory:"true" json:"totalApps"` + + // OCID of the Network Firewall Policy this application group belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m ApplicationGroup) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ApplicationGroup) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/application_group_summary.go b/networkfirewall/application_group_summary.go new file mode 100644 index 0000000000..1a11b79ef9 --- /dev/null +++ b/networkfirewall/application_group_summary.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApplicationGroupSummary Summary object for application list in the network firewall policy. +type ApplicationGroupSummary struct { + + // Name of the application groups. + Name *string `mandatory:"true" json:"name"` + + // Count of total applications in the given application group. + TotalApps *int `mandatory:"true" json:"totalApps"` + + // OCID of the Network Firewall Policy this application group belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m ApplicationGroupSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ApplicationGroupSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/application_group_summary_collection.go b/networkfirewall/application_group_summary_collection.go new file mode 100644 index 0000000000..f5c19a1d0d --- /dev/null +++ b/networkfirewall/application_group_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApplicationGroupSummaryCollection Collection of Application Lists in the network firewall policy +type ApplicationGroupSummaryCollection struct { + + // List of application lists. + Items []ApplicationGroupSummary `mandatory:"true" json:"items"` +} + +func (m ApplicationGroupSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ApplicationGroupSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/application_summary.go b/networkfirewall/application_summary.go new file mode 100644 index 0000000000..c4640ec982 --- /dev/null +++ b/networkfirewall/application_summary.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApplicationSummary Summary object for application element in the network firewall policy. +type ApplicationSummary interface { + + // Name of the application. + GetName() *string + + // OCID of the Network Firewall Policy this application belongs to. + GetParentResourceId() *string +} + +type applicationsummary struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *applicationsummary) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerapplicationsummary applicationsummary + s := struct { + Model Unmarshalerapplicationsummary + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.ParentResourceId = s.Model.ParentResourceId + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *applicationsummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "ICMP_V6": + mm := Icmp6ApplicationSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ICMP": + mm := IcmpApplicationSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for ApplicationSummary: %s.", m.Type) + return *m, nil + } +} + +// GetName returns Name +func (m applicationsummary) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m applicationsummary) GetParentResourceId() *string { + return m.ParentResourceId +} + +func (m applicationsummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m applicationsummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/application_summary_collection.go b/networkfirewall/application_summary_collection.go new file mode 100644 index 0000000000..00534f14ca --- /dev/null +++ b/networkfirewall/application_summary_collection.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApplicationSummaryCollection Collection of Applications in the network firewall policy +type ApplicationSummaryCollection struct { + + // Collection of Applications. + Items []ApplicationSummary `mandatory:"true" json:"items"` +} + +func (m ApplicationSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ApplicationSummaryCollection) 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 *ApplicationSummaryCollection) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []applicationsummary `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Items = make([]ApplicationSummary, len(model.Items)) + for i, n := range model.Items { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Items[i] = nn.(ApplicationSummary) + } else { + m.Items[i] = nil + } + } + return +} diff --git a/networkfirewall/apply_network_firewall_policy_details.go b/networkfirewall/apply_network_firewall_policy_details.go new file mode 100644 index 0000000000..0532c24468 --- /dev/null +++ b/networkfirewall/apply_network_firewall_policy_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApplyNetworkFirewallPolicyDetails Request data required to clone a network firewall policy. +type ApplyNetworkFirewallPolicyDetails struct { + + // Ordered priority list of firewall OCIDs on which the update needs to be applied in given order. If the list is a subset of the firewalls attached, then given firewalls would be deployed first with the change, followed by remaining firewalls. + Firewalls []string `mandatory:"false" json:"firewalls"` +} + +func (m ApplyNetworkFirewallPolicyDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ApplyNetworkFirewallPolicyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/apply_network_firewall_policy_request_response.go b/networkfirewall/apply_network_firewall_policy_request_response.go new file mode 100644 index 0000000000..a6bf06e784 --- /dev/null +++ b/networkfirewall/apply_network_firewall_policy_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ApplyNetworkFirewallPolicyRequest wrapper for the ApplyNetworkFirewallPolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ApplyNetworkFirewallPolicy.go.html to see an example of how to use ApplyNetworkFirewallPolicyRequest. +type ApplyNetworkFirewallPolicyRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // The information to be updated. + ApplyNetworkFirewallPolicyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ApplyNetworkFirewallPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ApplyNetworkFirewallPolicyRequest) 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 ApplyNetworkFirewallPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ApplyNetworkFirewallPolicyRequest) 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 ApplyNetworkFirewallPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ApplyNetworkFirewallPolicyResponse wrapper for the ApplyNetworkFirewallPolicy operation +type ApplyNetworkFirewallPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NetworkFirewallPolicy instance + NetworkFirewallPolicy `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ApplyNetworkFirewallPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ApplyNetworkFirewallPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_address_lists_request_response.go b/networkfirewall/bulk_upload_address_lists_request_response.go new file mode 100644 index 0000000000..33431fbf4d --- /dev/null +++ b/networkfirewall/bulk_upload_address_lists_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadAddressListsRequest wrapper for the BulkUploadAddressLists operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadAddressLists.go.html to see an example of how to use BulkUploadAddressListsRequest. +type BulkUploadAddressListsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Address Lists for the Network Firewall Policy Resource. + BulkUploadAddressListsDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadAddressListsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadAddressListsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadAddressListsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadAddressListsDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadAddressListsRequest) 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 BulkUploadAddressListsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadAddressListsResponse wrapper for the BulkUploadAddressLists operation +type BulkUploadAddressListsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadAddressListsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadAddressListsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_application_groups_request_response.go b/networkfirewall/bulk_upload_application_groups_request_response.go new file mode 100644 index 0000000000..14efc8bacc --- /dev/null +++ b/networkfirewall/bulk_upload_application_groups_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadApplicationGroupsRequest wrapper for the BulkUploadApplicationGroups operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadApplicationGroups.go.html to see an example of how to use BulkUploadApplicationGroupsRequest. +type BulkUploadApplicationGroupsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Application Group for the Network Firewall Policy Resource. + BulkUploadApplicationGroupsDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadApplicationGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadApplicationGroupsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadApplicationGroupsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadApplicationGroupsDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadApplicationGroupsRequest) 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 BulkUploadApplicationGroupsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadApplicationGroupsResponse wrapper for the BulkUploadApplicationGroups operation +type BulkUploadApplicationGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadApplicationGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadApplicationGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_applications_request_response.go b/networkfirewall/bulk_upload_applications_request_response.go new file mode 100644 index 0000000000..059d29d9a1 --- /dev/null +++ b/networkfirewall/bulk_upload_applications_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadApplicationsRequest wrapper for the BulkUploadApplications operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadApplications.go.html to see an example of how to use BulkUploadApplicationsRequest. +type BulkUploadApplicationsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Applications for the Network Firewall Policy Resource. + BulkUploadApplicationsDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadApplicationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadApplicationsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadApplicationsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadApplicationsDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadApplicationsRequest) 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 BulkUploadApplicationsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadApplicationsResponse wrapper for the BulkUploadApplications operation +type BulkUploadApplicationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadApplicationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadApplicationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_decryption_profiles_request_response.go b/networkfirewall/bulk_upload_decryption_profiles_request_response.go new file mode 100644 index 0000000000..44035bf324 --- /dev/null +++ b/networkfirewall/bulk_upload_decryption_profiles_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadDecryptionProfilesRequest wrapper for the BulkUploadDecryptionProfiles operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadDecryptionProfiles.go.html to see an example of how to use BulkUploadDecryptionProfilesRequest. +type BulkUploadDecryptionProfilesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Decryption Profile for the Network Firewall Policy Resource. + BulkUploadDecryptionProfilesDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadDecryptionProfilesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadDecryptionProfilesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadDecryptionProfilesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadDecryptionProfilesDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadDecryptionProfilesRequest) 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 BulkUploadDecryptionProfilesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadDecryptionProfilesResponse wrapper for the BulkUploadDecryptionProfiles operation +type BulkUploadDecryptionProfilesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadDecryptionProfilesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadDecryptionProfilesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_decryption_rules_request_response.go b/networkfirewall/bulk_upload_decryption_rules_request_response.go new file mode 100644 index 0000000000..2879c25e5a --- /dev/null +++ b/networkfirewall/bulk_upload_decryption_rules_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadDecryptionRulesRequest wrapper for the BulkUploadDecryptionRules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadDecryptionRules.go.html to see an example of how to use BulkUploadDecryptionRulesRequest. +type BulkUploadDecryptionRulesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Decryption Rule for the Network Firewall Policy Resource. + BulkUploadDecryptionRulesDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadDecryptionRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadDecryptionRulesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadDecryptionRulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadDecryptionRulesDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadDecryptionRulesRequest) 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 BulkUploadDecryptionRulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadDecryptionRulesResponse wrapper for the BulkUploadDecryptionRules operation +type BulkUploadDecryptionRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadDecryptionRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadDecryptionRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_mapped_secrets_request_response.go b/networkfirewall/bulk_upload_mapped_secrets_request_response.go new file mode 100644 index 0000000000..ef8f047278 --- /dev/null +++ b/networkfirewall/bulk_upload_mapped_secrets_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadMappedSecretsRequest wrapper for the BulkUploadMappedSecrets operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadMappedSecrets.go.html to see an example of how to use BulkUploadMappedSecretsRequest. +type BulkUploadMappedSecretsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Mapped Secret for the Network Firewall Policy Resource. + BulkUploadMappedSecretsDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadMappedSecretsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadMappedSecretsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadMappedSecretsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadMappedSecretsDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadMappedSecretsRequest) 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 BulkUploadMappedSecretsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadMappedSecretsResponse wrapper for the BulkUploadMappedSecrets operation +type BulkUploadMappedSecretsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadMappedSecretsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadMappedSecretsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_security_rules_request_response.go b/networkfirewall/bulk_upload_security_rules_request_response.go new file mode 100644 index 0000000000..1c5e04e145 --- /dev/null +++ b/networkfirewall/bulk_upload_security_rules_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadSecurityRulesRequest wrapper for the BulkUploadSecurityRules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadSecurityRules.go.html to see an example of how to use BulkUploadSecurityRulesRequest. +type BulkUploadSecurityRulesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Security Rule for the Network Firewall Policy Resource. + BulkUploadSecurityRulesDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadSecurityRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadSecurityRulesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadSecurityRulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadSecurityRulesDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadSecurityRulesRequest) 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 BulkUploadSecurityRulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadSecurityRulesResponse wrapper for the BulkUploadSecurityRules operation +type BulkUploadSecurityRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadSecurityRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadSecurityRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_service_lists_request_response.go b/networkfirewall/bulk_upload_service_lists_request_response.go new file mode 100644 index 0000000000..75d877aab8 --- /dev/null +++ b/networkfirewall/bulk_upload_service_lists_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadServiceListsRequest wrapper for the BulkUploadServiceLists operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadServiceLists.go.html to see an example of how to use BulkUploadServiceListsRequest. +type BulkUploadServiceListsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Service List for the Network Firewall Policy Resource. + BulkUploadServiceListsDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadServiceListsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadServiceListsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadServiceListsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadServiceListsDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadServiceListsRequest) 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 BulkUploadServiceListsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadServiceListsResponse wrapper for the BulkUploadServiceLists operation +type BulkUploadServiceListsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadServiceListsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadServiceListsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_services_request_response.go b/networkfirewall/bulk_upload_services_request_response.go new file mode 100644 index 0000000000..8cf5296382 --- /dev/null +++ b/networkfirewall/bulk_upload_services_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadServicesRequest wrapper for the BulkUploadServices operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadServices.go.html to see an example of how to use BulkUploadServicesRequest. +type BulkUploadServicesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Services for the Network Firewall Policy Resource. + BulkUploadServicesDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadServicesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadServicesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadServicesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadServicesDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadServicesRequest) 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 BulkUploadServicesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadServicesResponse wrapper for the BulkUploadServices operation +type BulkUploadServicesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadServicesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadServicesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/bulk_upload_url_lists_request_response.go b/networkfirewall/bulk_upload_url_lists_request_response.go new file mode 100644 index 0000000000..ceb83cf22c --- /dev/null +++ b/networkfirewall/bulk_upload_url_lists_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// BulkUploadUrlListsRequest wrapper for the BulkUploadUrlLists operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadUrlLists.go.html to see an example of how to use BulkUploadUrlListsRequest. +type BulkUploadUrlListsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Url Lists for the Network Firewall Policy Resource. + BulkUploadUrlListsDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request BulkUploadUrlListsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BulkUploadUrlListsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request BulkUploadUrlListsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.BulkUploadUrlListsDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkUploadUrlListsRequest) 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 BulkUploadUrlListsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BulkUploadUrlListsResponse wrapper for the BulkUploadUrlLists operation +type BulkUploadUrlListsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response BulkUploadUrlListsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BulkUploadUrlListsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/change_network_firewall_compartment_request_response.go b/networkfirewall/change_network_firewall_compartment_request_response.go index b1cf7b92c7..6777e8e2ff 100644 --- a/networkfirewall/change_network_firewall_compartment_request_response.go +++ b/networkfirewall/change_network_firewall_compartment_request_response.go @@ -34,6 +34,13 @@ type ChangeNetworkFirewallCompartmentRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/networkfirewall/clone_network_firewall_policy_details.go b/networkfirewall/clone_network_firewall_policy_details.go new file mode 100644 index 0000000000..79905ae3a2 --- /dev/null +++ b/networkfirewall/clone_network_firewall_policy_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CloneNetworkFirewallPolicyDetails Request data required to clone a network firewall policy. +type CloneNetworkFirewallPolicyDetails struct { + + // A user-friendly optional name for the cloned firewall policy. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the NetworkFirewall Policy. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CloneNetworkFirewallPolicyDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CloneNetworkFirewallPolicyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/clone_network_firewall_policy_request_response.go b/networkfirewall/clone_network_firewall_policy_request_response.go new file mode 100644 index 0000000000..27c8de49b9 --- /dev/null +++ b/networkfirewall/clone_network_firewall_policy_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CloneNetworkFirewallPolicyRequest wrapper for the CloneNetworkFirewallPolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CloneNetworkFirewallPolicy.go.html to see an example of how to use CloneNetworkFirewallPolicyRequest. +type CloneNetworkFirewallPolicyRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // The information to be updated. + CloneNetworkFirewallPolicyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CloneNetworkFirewallPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CloneNetworkFirewallPolicyRequest) 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 CloneNetworkFirewallPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CloneNetworkFirewallPolicyRequest) 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 CloneNetworkFirewallPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CloneNetworkFirewallPolicyResponse wrapper for the CloneNetworkFirewallPolicy operation +type CloneNetworkFirewallPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NetworkFirewallPolicy instance + NetworkFirewallPolicy `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CloneNetworkFirewallPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CloneNetworkFirewallPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_address_list_details.go b/networkfirewall/create_address_list_details.go new file mode 100644 index 0000000000..0351bc878c --- /dev/null +++ b/networkfirewall/create_address_list_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateAddressListDetails The Request for creating the address List +type CreateAddressListDetails struct { + + // Unique name to identify the group of addresses to be used in the policy rules. + Name *string `mandatory:"true" json:"name"` + + // Type of address List. The accepted values are - * FQDN * IP + Type AddressListTypeEnum `mandatory:"true" json:"type"` + + // List of addresses. + Addresses []string `mandatory:"true" json:"addresses"` +} + +func (m CreateAddressListDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateAddressListDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAddressListTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAddressListTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_address_list_request_response.go b/networkfirewall/create_address_list_request_response.go new file mode 100644 index 0000000000..4727e40a7e --- /dev/null +++ b/networkfirewall/create_address_list_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateAddressListRequest wrapper for the CreateAddressList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateAddressList.go.html to see an example of how to use CreateAddressListRequest. +type CreateAddressListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Network Firewall Policy Resource. + CreateAddressListDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAddressListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAddressListRequest) 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 CreateAddressListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAddressListRequest) 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 CreateAddressListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateAddressListResponse wrapper for the CreateAddressList operation +type CreateAddressListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AddressList instance + AddressList `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 CreateAddressListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAddressListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_application_details.go b/networkfirewall/create_application_details.go new file mode 100644 index 0000000000..db88ee847e --- /dev/null +++ b/networkfirewall/create_application_details.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateApplicationDetails Request for creating a application against a policy. +type CreateApplicationDetails interface { + + // Name of the application + GetName() *string +} + +type createapplicationdetails struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *createapplicationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateapplicationdetails createapplicationdetails + s := struct { + Model Unmarshalercreateapplicationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createapplicationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "ICMP": + mm := CreateIcmpApplicationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ICMP_V6": + mm := CreateIcmp6ApplicationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateApplicationDetails: %s.", m.Type) + return *m, nil + } +} + +// GetName returns Name +func (m createapplicationdetails) GetName() *string { + return m.Name +} + +func (m createapplicationdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createapplicationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_application_group_details.go b/networkfirewall/create_application_group_details.go new file mode 100644 index 0000000000..749e041d2b --- /dev/null +++ b/networkfirewall/create_application_group_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateApplicationGroupDetails Request for creating a application list in a policy. +type CreateApplicationGroupDetails struct { + + // Name of the application Group. + Name *string `mandatory:"true" json:"name"` + + // Collection of application names. + Apps []string `mandatory:"true" json:"apps"` +} + +func (m CreateApplicationGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateApplicationGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_application_group_request_response.go b/networkfirewall/create_application_group_request_response.go new file mode 100644 index 0000000000..6afbb77a05 --- /dev/null +++ b/networkfirewall/create_application_group_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateApplicationGroupRequest wrapper for the CreateApplicationGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateApplicationGroup.go.html to see an example of how to use CreateApplicationGroupRequest. +type CreateApplicationGroupRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the ApplicationGroup for the Network Firewall Policy Resource. + CreateApplicationGroupDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateApplicationGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateApplicationGroupRequest) 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 CreateApplicationGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateApplicationGroupRequest) 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 CreateApplicationGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateApplicationGroupResponse wrapper for the CreateApplicationGroup operation +type CreateApplicationGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ApplicationGroup instance + ApplicationGroup `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 CreateApplicationGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateApplicationGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_application_request_response.go b/networkfirewall/create_application_request_response.go new file mode 100644 index 0000000000..6641e1cfa1 --- /dev/null +++ b/networkfirewall/create_application_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateApplicationRequest wrapper for the CreateApplication operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateApplication.go.html to see an example of how to use CreateApplicationRequest. +type CreateApplicationRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Application for the Network Firewall Policy Resource. + CreateApplicationDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateApplicationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateApplicationRequest) 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 CreateApplicationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateApplicationRequest) 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 CreateApplicationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateApplicationResponse wrapper for the CreateApplication operation +type CreateApplicationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Application instance + Application `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 CreateApplicationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateApplicationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_decryption_profile_details.go b/networkfirewall/create_decryption_profile_details.go new file mode 100644 index 0000000000..c3e7e0458f --- /dev/null +++ b/networkfirewall/create_decryption_profile_details.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDecryptionProfileDetails Request for Decryption Profile used on the firewall policy rules. +type CreateDecryptionProfileDetails interface { + + // Name of the decryption profile. + GetName() *string +} + +type createdecryptionprofiledetails struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *createdecryptionprofiledetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatedecryptionprofiledetails createdecryptionprofiledetails + s := struct { + Model Unmarshalercreatedecryptionprofiledetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createdecryptionprofiledetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "SSL_INBOUND_INSPECTION": + mm := CreateSslInboundInspectionProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "SSL_FORWARD_PROXY": + mm := CreateSslForwardProxyProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateDecryptionProfileDetails: %s.", m.Type) + return *m, nil + } +} + +// GetName returns Name +func (m createdecryptionprofiledetails) GetName() *string { + return m.Name +} + +func (m createdecryptionprofiledetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createdecryptionprofiledetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_decryption_profile_request_response.go b/networkfirewall/create_decryption_profile_request_response.go new file mode 100644 index 0000000000..660716f01a --- /dev/null +++ b/networkfirewall/create_decryption_profile_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDecryptionProfileRequest wrapper for the CreateDecryptionProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateDecryptionProfile.go.html to see an example of how to use CreateDecryptionProfileRequest. +type CreateDecryptionProfileRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Network Firewall Policy Resource. + CreateDecryptionProfileDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateDecryptionProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDecryptionProfileRequest) 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 CreateDecryptionProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDecryptionProfileRequest) 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 CreateDecryptionProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDecryptionProfileResponse wrapper for the CreateDecryptionProfile operation +type CreateDecryptionProfileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DecryptionProfile instance + DecryptionProfile `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 CreateDecryptionProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDecryptionProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_decryption_rule_details.go b/networkfirewall/create_decryption_rule_details.go new file mode 100644 index 0000000000..5934640346 --- /dev/null +++ b/networkfirewall/create_decryption_rule_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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDecryptionRuleDetails Request for creating Decryption Rule used in the firewall policy rules. +// A Decryption Rule is used to define which traffic should be decrypted by the firewall, and how it should do so. +type CreateDecryptionRuleDetails struct { + + // Name for the decryption rule, must be unique within the policy. + Name *string `mandatory:"true" json:"name"` + + Condition *DecryptionRuleMatchCriteria `mandatory:"true" json:"condition"` + + // Action: + // * NO_DECRYPT - Matching traffic is not decrypted. + // * DECRYPT - Matching traffic is decrypted with the specified `secret` according to the specified `decryptionProfile`. + Action DecryptionActionTypeEnum `mandatory:"true" json:"action"` + + // The name of the decryption profile to use. + DecryptionProfile *string `mandatory:"false" json:"decryptionProfile"` + + // The name of a mapped secret. Its `type` must match that of the specified decryption profile. + Secret *string `mandatory:"false" json:"secret"` + + Position *RulePosition `mandatory:"false" json:"position"` +} + +func (m CreateDecryptionRuleDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateDecryptionRuleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDecryptionActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetDecryptionActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_decryption_rule_request_response.go b/networkfirewall/create_decryption_rule_request_response.go new file mode 100644 index 0000000000..9989487dc9 --- /dev/null +++ b/networkfirewall/create_decryption_rule_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDecryptionRuleRequest wrapper for the CreateDecryptionRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateDecryptionRule.go.html to see an example of how to use CreateDecryptionRuleRequest. +type CreateDecryptionRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Network Firewall Policy Resource. + CreateDecryptionRuleDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateDecryptionRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDecryptionRuleRequest) 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 CreateDecryptionRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDecryptionRuleRequest) 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 CreateDecryptionRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDecryptionRuleResponse wrapper for the CreateDecryptionRule operation +type CreateDecryptionRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DecryptionRule instance + DecryptionRule `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 CreateDecryptionRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDecryptionRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_icmp6_application_details.go b/networkfirewall/create_icmp6_application_details.go new file mode 100644 index 0000000000..d2da90a117 --- /dev/null +++ b/networkfirewall/create_icmp6_application_details.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateIcmp6ApplicationDetails Request for ICMP6 Application used on the firewall policy rules. +type CreateIcmp6ApplicationDetails struct { + + // Name of the application + Name *string `mandatory:"true" json:"name"` + + // The value of the ICMP6 message Type field as defined by RFC 4443 (https://www.rfc-editor.org/rfc/rfc4443.html#section-2.1). + IcmpType *int `mandatory:"true" json:"icmpType"` + + // The value of the ICMP6 message Code (subtype) field as defined by RFC 4443 (https://www.rfc-editor.org/rfc/rfc4443.html#section-2.1). + IcmpCode *int `mandatory:"false" json:"icmpCode"` +} + +// GetName returns Name +func (m CreateIcmp6ApplicationDetails) GetName() *string { + return m.Name +} + +func (m CreateIcmp6ApplicationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateIcmp6ApplicationDetails) 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 CreateIcmp6ApplicationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateIcmp6ApplicationDetails CreateIcmp6ApplicationDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateIcmp6ApplicationDetails + }{ + "ICMP_V6", + (MarshalTypeCreateIcmp6ApplicationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/create_icmp_application_details.go b/networkfirewall/create_icmp_application_details.go new file mode 100644 index 0000000000..b8447fa905 --- /dev/null +++ b/networkfirewall/create_icmp_application_details.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateIcmpApplicationDetails Request for ICMP Application used on the firewall policy rules. +type CreateIcmpApplicationDetails struct { + + // Name of the application + Name *string `mandatory:"true" json:"name"` + + // The value of the ICMP message Type field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpType *int `mandatory:"true" json:"icmpType"` + + // The value of the ICMP message Code (subtype) field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpCode *int `mandatory:"false" json:"icmpCode"` +} + +// GetName returns Name +func (m CreateIcmpApplicationDetails) GetName() *string { + return m.Name +} + +func (m CreateIcmpApplicationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateIcmpApplicationDetails) 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 CreateIcmpApplicationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateIcmpApplicationDetails CreateIcmpApplicationDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateIcmpApplicationDetails + }{ + "ICMP", + (MarshalTypeCreateIcmpApplicationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/create_mapped_secret_details.go b/networkfirewall/create_mapped_secret_details.go new file mode 100644 index 0000000000..a1c8c7447c --- /dev/null +++ b/networkfirewall/create_mapped_secret_details.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateMappedSecretDetails The Request for creating the Mapped Secret +type CreateMappedSecretDetails interface { + + // Unique name to identify the group of urls to be used in the policy rules. + GetName() *string + + // Type of the secrets mapped based on the policy. + // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. + // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. + GetType() InspectionTypeEnum +} + +type createmappedsecretdetails struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + Type InspectionTypeEnum `mandatory:"true" json:"type"` + Source string `json:"source"` +} + +// UnmarshalJSON unmarshals json +func (m *createmappedsecretdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatemappedsecretdetails createmappedsecretdetails + s := struct { + Model Unmarshalercreatemappedsecretdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.Type = s.Model.Type + m.Source = s.Model.Source + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createmappedsecretdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Source { + case "OCI_VAULT": + mm := CreateVaultMappedSecretDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateMappedSecretDetails: %s.", m.Source) + return *m, nil + } +} + +// GetName returns Name +func (m createmappedsecretdetails) GetName() *string { + return m.Name +} + +// GetType returns Type +func (m createmappedsecretdetails) GetType() InspectionTypeEnum { + return m.Type +} + +func (m createmappedsecretdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createmappedsecretdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_mapped_secret_request_response.go b/networkfirewall/create_mapped_secret_request_response.go new file mode 100644 index 0000000000..fe3c1ea7f5 --- /dev/null +++ b/networkfirewall/create_mapped_secret_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateMappedSecretRequest wrapper for the CreateMappedSecret operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateMappedSecret.go.html to see an example of how to use CreateMappedSecretRequest. +type CreateMappedSecretRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Network Firewall Policy Resource. + CreateMappedSecretDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateMappedSecretRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateMappedSecretRequest) 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 CreateMappedSecretRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateMappedSecretRequest) 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 CreateMappedSecretRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateMappedSecretResponse wrapper for the CreateMappedSecret operation +type CreateMappedSecretResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MappedSecret instance + MappedSecret `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 CreateMappedSecretResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateMappedSecretResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_network_firewall_details.go b/networkfirewall/create_network_firewall_details.go index 2955587925..a2aa8ba2bd 100644 --- a/networkfirewall/create_network_firewall_details.go +++ b/networkfirewall/create_network_firewall_details.go @@ -44,12 +44,14 @@ type CreateNetworkFirewallDetails struct { // An array of network security groups OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with the Network Firewall. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` - // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. - // Example: `{"bar-key": "value"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff --git a/networkfirewall/create_network_firewall_policy_details.go b/networkfirewall/create_network_firewall_policy_details.go index 3a1dc6dafd..dc24540a07 100644 --- a/networkfirewall/create_network_firewall_policy_details.go +++ b/networkfirewall/create_network_firewall_policy_details.go @@ -10,7 +10,6 @@ package networkfirewall import ( - "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -25,45 +24,14 @@ type CreateNetworkFirewallPolicyDetails struct { // A user-friendly optional name for the firewall policy. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` - // Map defining secrets of the policy. - // The value of an entry is a "mapped secret" consisting of a purpose and source. - // The associated key is the identifier by which the mapped secret is referenced. - MappedSecrets map[string]MappedSecret `mandatory:"false" json:"mappedSecrets"` - - // Map defining application lists of the policy. - // The value of an entry is a list of "applications", each consisting of a protocol identifier (such as TCP, UDP, or ICMP) and protocol-specific parameters (such as a port range). - // The associated key is the identifier by which the application list is referenced. - ApplicationLists map[string][]Application `mandatory:"false" json:"applicationLists"` - - // Map defining URL pattern lists of the policy. - // The value of an entry is a list of URL patterns. - // The associated key is the identifier by which the URL pattern list is referenced. - UrlLists map[string][]UrlPattern `mandatory:"false" json:"urlLists"` - - // Map defining IP address lists of the policy. - // The value of an entry is a list of IP addresses or prefixes in CIDR notation. - // The associated key is the identifier by which the IP address list is referenced. - IpAddressLists map[string][]string `mandatory:"false" json:"ipAddressLists"` - - // List of Security Rules defining the behavior of the policy. - // The first rule with a matching condition determines the action taken upon network traffic. - SecurityRules []SecurityRule `mandatory:"false" json:"securityRules"` - - // List of Decryption Rules defining the behavior of the policy. - // The first rule with a matching condition determines the action taken upon network traffic. - DecryptionRules []DecryptionRule `mandatory:"false" json:"decryptionRules"` - - // Map defining decryption profiles of the policy. - // The value of an entry is a decryption profile. - // The associated key is the identifier by which the decryption profile is referenced. - DecryptionProfiles map[string]DecryptionProfile `mandatory:"false" json:"decryptionProfiles"` - - // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. - // Example: `{"bar-key": "value"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -82,71 +50,3 @@ func (m CreateNetworkFirewallPolicyDetails) ValidateEnumValue() (bool, error) { } return false, nil } - -// UnmarshalJSON unmarshals from json -func (m *CreateNetworkFirewallPolicyDetails) UnmarshalJSON(data []byte) (e error) { - model := struct { - DisplayName *string `json:"displayName"` - MappedSecrets map[string]mappedsecret `json:"mappedSecrets"` - ApplicationLists map[string][]Application `json:"applicationLists"` - UrlLists map[string][]UrlPattern `json:"urlLists"` - IpAddressLists map[string][]string `json:"ipAddressLists"` - SecurityRules []SecurityRule `json:"securityRules"` - DecryptionRules []DecryptionRule `json:"decryptionRules"` - DecryptionProfiles map[string]decryptionprofile `json:"decryptionProfiles"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - CompartmentId *string `json:"compartmentId"` - }{} - - e = json.Unmarshal(data, &model) - if e != nil { - return - } - var nn interface{} - m.DisplayName = model.DisplayName - - m.MappedSecrets = make(map[string]MappedSecret) - for k, v := range model.MappedSecrets { - nn, e = v.UnmarshalPolymorphicJSON(v.JsonData) - if e != nil { - return e - } - if nn != nil { - m.MappedSecrets[k] = nn.(MappedSecret) - } else { - m.MappedSecrets[k] = nil - } - } - - m.ApplicationLists = model.ApplicationLists - - m.UrlLists = model.UrlLists - - m.IpAddressLists = model.IpAddressLists - - m.SecurityRules = make([]SecurityRule, len(model.SecurityRules)) - copy(m.SecurityRules, model.SecurityRules) - m.DecryptionRules = make([]DecryptionRule, len(model.DecryptionRules)) - copy(m.DecryptionRules, model.DecryptionRules) - m.DecryptionProfiles = make(map[string]DecryptionProfile) - for k, v := range model.DecryptionProfiles { - nn, e = v.UnmarshalPolymorphicJSON(v.JsonData) - if e != nil { - return e - } - if nn != nil { - m.DecryptionProfiles[k] = nn.(DecryptionProfile) - } else { - m.DecryptionProfiles[k] = nil - } - } - - m.FreeformTags = model.FreeformTags - - m.DefinedTags = model.DefinedTags - - m.CompartmentId = model.CompartmentId - - return -} diff --git a/networkfirewall/create_security_rule_details.go b/networkfirewall/create_security_rule_details.go new file mode 100644 index 0000000000..4a48ee4933 --- /dev/null +++ b/networkfirewall/create_security_rule_details.go @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSecurityRuleDetails Reqeust for creating Security Rule used in the firewall policy rules. +// Security Rules determine whether to block or allow a session based on traffic attributes, +// such as the source and destination IP address, protocol/port, and the HTTP(S) target URL. +type CreateSecurityRuleDetails struct { + + // Name for the Security rule, must be unique within the policy. + Name *string `mandatory:"true" json:"name"` + + Condition *SecurityRuleMatchCriteria `mandatory:"true" json:"condition"` + + // Types of Action on the Traffic flow. + // * ALLOW - Allows the traffic. + // * DROP - Silently drops the traffic, e.g. without sending a TCP reset. + // * REJECT - Rejects the traffic, sending a TCP reset to client and/or server as applicable. + // * INSPECT - Inspects traffic for vulnerability as specified in `inspection`, which may result in rejection. + Action TrafficActionTypeEnum `mandatory:"true" json:"action"` + + // Type of inspection to affect the Traffic flow. This is only applicable if action is INSPECT. + // * INTRUSION_DETECTION - Intrusion Detection. + // * INTRUSION_PREVENTION - Intrusion Detection and Prevention. Traffic classified as potentially malicious will be rejected as described in `type`. + Inspection TrafficInspectionTypeEnum `mandatory:"false" json:"inspection,omitempty"` + + Position *RulePosition `mandatory:"false" json:"position"` +} + +func (m CreateSecurityRuleDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateSecurityRuleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTrafficActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetTrafficActionTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingTrafficInspectionTypeEnum(string(m.Inspection)); !ok && m.Inspection != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Inspection: %s. Supported values are: %s.", m.Inspection, strings.Join(GetTrafficInspectionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_security_rule_request_response.go b/networkfirewall/create_security_rule_request_response.go new file mode 100644 index 0000000000..ec301e0255 --- /dev/null +++ b/networkfirewall/create_security_rule_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateSecurityRuleRequest wrapper for the CreateSecurityRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateSecurityRule.go.html to see an example of how to use CreateSecurityRuleRequest. +type CreateSecurityRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Network Firewall Policy Resource. + CreateSecurityRuleDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSecurityRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSecurityRuleRequest) 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 CreateSecurityRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSecurityRuleRequest) 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 CreateSecurityRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSecurityRuleResponse wrapper for the CreateSecurityRule operation +type CreateSecurityRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SecurityRule instance + SecurityRule `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 CreateSecurityRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSecurityRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_service_details.go b/networkfirewall/create_service_details.go new file mode 100644 index 0000000000..0dc5e1ce55 --- /dev/null +++ b/networkfirewall/create_service_details.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateServiceDetails Request for creating a service against a policy. +type CreateServiceDetails interface { + + // Name of the service + GetName() *string +} + +type createservicedetails struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *createservicedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateservicedetails createservicedetails + s := struct { + Model Unmarshalercreateservicedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createservicedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "UDP_SERVICE": + mm := CreateUdpServiceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "TCP_SERVICE": + mm := CreateTcpServiceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateServiceDetails: %s.", m.Type) + return *m, nil + } +} + +// GetName returns Name +func (m createservicedetails) GetName() *string { + return m.Name +} + +func (m createservicedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createservicedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_service_list_details.go b/networkfirewall/create_service_list_details.go new file mode 100644 index 0000000000..91acab285a --- /dev/null +++ b/networkfirewall/create_service_list_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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateServiceListDetails Request for creating a service list in a policy. +type CreateServiceListDetails struct { + + // Name of the service Group. + Name *string `mandatory:"true" json:"name"` + + // Collection of service names. + Services []string `mandatory:"true" json:"services"` +} + +func (m CreateServiceListDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateServiceListDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/create_service_list_request_response.go b/networkfirewall/create_service_list_request_response.go new file mode 100644 index 0000000000..3fc1be28c4 --- /dev/null +++ b/networkfirewall/create_service_list_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateServiceListRequest wrapper for the CreateServiceList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateServiceList.go.html to see an example of how to use CreateServiceListRequest. +type CreateServiceListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the ServiceList for the Network Firewall Policy Resource. + CreateServiceListDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateServiceListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateServiceListRequest) 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 CreateServiceListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateServiceListRequest) 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 CreateServiceListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateServiceListResponse wrapper for the CreateServiceList operation +type CreateServiceListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceList instance + ServiceList `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 CreateServiceListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateServiceListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_service_request_response.go b/networkfirewall/create_service_request_response.go new file mode 100644 index 0000000000..608f6d2a3f --- /dev/null +++ b/networkfirewall/create_service_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateServiceRequest wrapper for the CreateService operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateService.go.html to see an example of how to use CreateServiceRequest. +type CreateServiceRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Service for the Network Firewall Policy Resource. + CreateServiceDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateServiceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateServiceRequest) 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 CreateServiceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateServiceRequest) 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 CreateServiceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateServiceResponse wrapper for the CreateService operation +type CreateServiceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Service instance + Service `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 CreateServiceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateServiceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_ssl_forward_proxy_profile_details.go b/networkfirewall/create_ssl_forward_proxy_profile_details.go new file mode 100644 index 0000000000..f7fa8d6295 --- /dev/null +++ b/networkfirewall/create_ssl_forward_proxy_profile_details.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSslForwardProxyProfileDetails Request for creating SSLForwardProxy used on the firewall policy rules. +type CreateSslForwardProxyProfileDetails struct { + + // Name of the decryption profile. + Name *string `mandatory:"true" json:"name"` + + // Whether to block sessions if server's certificate is expired. + IsExpiredCertificateBlocked *bool `mandatory:"false" json:"isExpiredCertificateBlocked"` + + // Whether to block sessions if server's certificate is issued by an untrusted certificate authority (CA). + IsUntrustedIssuerBlocked *bool `mandatory:"false" json:"isUntrustedIssuerBlocked"` + + // Whether to block sessions if the revocation status check for server's certificate + // does not succeed within the maximum allowed time (defaulting to 5 seconds). + IsRevocationStatusTimeoutBlocked *bool `mandatory:"false" json:"isRevocationStatusTimeoutBlocked"` + + // Whether to block sessions if SSL version is not supported. + IsUnsupportedVersionBlocked *bool `mandatory:"false" json:"isUnsupportedVersionBlocked"` + + // Whether to block sessions if SSL cipher suite is not supported. + IsUnsupportedCipherBlocked *bool `mandatory:"false" json:"isUnsupportedCipherBlocked"` + + // Whether to block sessions if the revocation status check for server's certificate results in "unknown". + IsUnknownRevocationStatusBlocked *bool `mandatory:"false" json:"isUnknownRevocationStatusBlocked"` + + // Whether to block sessions if the server's certificate uses extensions other than key usage and/or extended key usage. + AreCertificateExtensionsRestricted *bool `mandatory:"false" json:"areCertificateExtensionsRestricted"` + + // Whether to automatically append SAN to impersonating certificate if server certificate is missing SAN. + IsAutoIncludeAltName *bool `mandatory:"false" json:"isAutoIncludeAltName"` + + // Whether to block sessions if the firewall is temporarily unable to decrypt their traffic. + IsOutOfCapacityBlocked *bool `mandatory:"false" json:"isOutOfCapacityBlocked"` +} + +// GetName returns Name +func (m CreateSslForwardProxyProfileDetails) GetName() *string { + return m.Name +} + +func (m CreateSslForwardProxyProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateSslForwardProxyProfileDetails) 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 CreateSslForwardProxyProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateSslForwardProxyProfileDetails CreateSslForwardProxyProfileDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateSslForwardProxyProfileDetails + }{ + "SSL_FORWARD_PROXY", + (MarshalTypeCreateSslForwardProxyProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/create_ssl_inbound_inspection_profile_details.go b/networkfirewall/create_ssl_inbound_inspection_profile_details.go new file mode 100644 index 0000000000..b643fbb49f --- /dev/null +++ b/networkfirewall/create_ssl_inbound_inspection_profile_details.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSslInboundInspectionProfileDetails Request for creating SSLInboundInspection used on the firewall policy rules. +type CreateSslInboundInspectionProfileDetails struct { + + // Name of the decryption profile. + Name *string `mandatory:"true" json:"name"` + + // Whether to block sessions if SSL version is not supported. + IsUnsupportedVersionBlocked *bool `mandatory:"false" json:"isUnsupportedVersionBlocked"` + + // Whether to block sessions if SSL cipher suite is not supported. + IsUnsupportedCipherBlocked *bool `mandatory:"false" json:"isUnsupportedCipherBlocked"` + + // Whether to block sessions if the firewall is temporarily unable to decrypt their traffic. + IsOutOfCapacityBlocked *bool `mandatory:"false" json:"isOutOfCapacityBlocked"` +} + +// GetName returns Name +func (m CreateSslInboundInspectionProfileDetails) GetName() *string { + return m.Name +} + +func (m CreateSslInboundInspectionProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateSslInboundInspectionProfileDetails) 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 CreateSslInboundInspectionProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateSslInboundInspectionProfileDetails CreateSslInboundInspectionProfileDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateSslInboundInspectionProfileDetails + }{ + "SSL_INBOUND_INSPECTION", + (MarshalTypeCreateSslInboundInspectionProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/create_tcp_service_details.go b/networkfirewall/create_tcp_service_details.go new file mode 100644 index 0000000000..b24b137f2a --- /dev/null +++ b/networkfirewall/create_tcp_service_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateTcpServiceDetails Request for TCP Service used on the firewall policy rules. +type CreateTcpServiceDetails struct { + + // Name of the service + Name *string `mandatory:"true" json:"name"` + + // List of port-ranges used. + PortRanges []PortRange `mandatory:"true" json:"portRanges"` +} + +// GetName returns Name +func (m CreateTcpServiceDetails) GetName() *string { + return m.Name +} + +func (m CreateTcpServiceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateTcpServiceDetails) 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 CreateTcpServiceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateTcpServiceDetails CreateTcpServiceDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateTcpServiceDetails + }{ + "TCP_SERVICE", + (MarshalTypeCreateTcpServiceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/create_udp_service_details.go b/networkfirewall/create_udp_service_details.go new file mode 100644 index 0000000000..5fff31a827 --- /dev/null +++ b/networkfirewall/create_udp_service_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateUdpServiceDetails Request for UDP Service used on the firewall policy rules. +type CreateUdpServiceDetails struct { + + // Name of the service + Name *string `mandatory:"true" json:"name"` + + // List of port-ranges to be used. + PortRanges []PortRange `mandatory:"true" json:"portRanges"` +} + +// GetName returns Name +func (m CreateUdpServiceDetails) GetName() *string { + return m.Name +} + +func (m CreateUdpServiceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateUdpServiceDetails) 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 CreateUdpServiceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateUdpServiceDetails CreateUdpServiceDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateUdpServiceDetails + }{ + "UDP_SERVICE", + (MarshalTypeCreateUdpServiceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/create_url_list_details.go b/networkfirewall/create_url_list_details.go new file mode 100644 index 0000000000..53326c2ff8 --- /dev/null +++ b/networkfirewall/create_url_list_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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateUrlListDetails The Request for creating the URL List +type CreateUrlListDetails struct { + + // Unique name to identify the group of urls to be used in the policy rules. + Name *string `mandatory:"true" json:"name"` + + // List of urls. + Urls []UrlPattern `mandatory:"true" json:"urls"` +} + +func (m CreateUrlListDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateUrlListDetails) 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 *CreateUrlListDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Name *string `json:"name"` + Urls []urlpattern `json:"urls"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Name = model.Name + + m.Urls = make([]UrlPattern, len(model.Urls)) + for i, n := range model.Urls { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Urls[i] = nn.(UrlPattern) + } else { + m.Urls[i] = nil + } + } + return +} diff --git a/networkfirewall/create_url_list_request_response.go b/networkfirewall/create_url_list_request_response.go new file mode 100644 index 0000000000..6afa0cb3d2 --- /dev/null +++ b/networkfirewall/create_url_list_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateUrlListRequest wrapper for the CreateUrlList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateUrlList.go.html to see an example of how to use CreateUrlListRequest. +type CreateUrlListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Request Details to create the Network Firewall Policy Resource. + CreateUrlListDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateUrlListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateUrlListRequest) 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 CreateUrlListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateUrlListRequest) 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 CreateUrlListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateUrlListResponse wrapper for the CreateUrlList operation +type CreateUrlListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The UrlList instance + UrlList `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 CreateUrlListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateUrlListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/create_vault_mapped_secret_details.go b/networkfirewall/create_vault_mapped_secret_details.go new file mode 100644 index 0000000000..fe3e6d590e --- /dev/null +++ b/networkfirewall/create_vault_mapped_secret_details.go @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateVaultMappedSecretDetails The request details to be created in the Vault Mapped Secret for the policy. +type CreateVaultMappedSecretDetails struct { + + // Unique name to identify the group of urls to be used in the policy rules. + Name *string `mandatory:"true" json:"name"` + + // OCID for the Vault Secret to be used. + VaultSecretId *string `mandatory:"true" json:"vaultSecretId"` + + // Version number of the secret to be used. + VersionNumber *int `mandatory:"true" json:"versionNumber"` + + // Type of the secrets mapped based on the policy. + // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. + // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. + Type InspectionTypeEnum `mandatory:"true" json:"type"` +} + +// GetName returns Name +func (m CreateVaultMappedSecretDetails) GetName() *string { + return m.Name +} + +// GetType returns Type +func (m CreateVaultMappedSecretDetails) GetType() InspectionTypeEnum { + return m.Type +} + +func (m CreateVaultMappedSecretDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateVaultMappedSecretDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateVaultMappedSecretDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateVaultMappedSecretDetails CreateVaultMappedSecretDetails + s := struct { + DiscriminatorParam string `json:"source"` + MarshalTypeCreateVaultMappedSecretDetails + }{ + "OCI_VAULT", + (MarshalTypeCreateVaultMappedSecretDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/decryption_action_type.go b/networkfirewall/decryption_action_type.go new file mode 100644 index 0000000000..02a1e4f851 --- /dev/null +++ b/networkfirewall/decryption_action_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// DecryptionActionTypeEnum Enum with underlying type: string +type DecryptionActionTypeEnum string + +// Set of constants representing the allowable values for DecryptionActionTypeEnum +const ( + DecryptionActionTypeNoDecrypt DecryptionActionTypeEnum = "NO_DECRYPT" + DecryptionActionTypeDecrypt DecryptionActionTypeEnum = "DECRYPT" +) + +var mappingDecryptionActionTypeEnum = map[string]DecryptionActionTypeEnum{ + "NO_DECRYPT": DecryptionActionTypeNoDecrypt, + "DECRYPT": DecryptionActionTypeDecrypt, +} + +var mappingDecryptionActionTypeEnumLowerCase = map[string]DecryptionActionTypeEnum{ + "no_decrypt": DecryptionActionTypeNoDecrypt, + "decrypt": DecryptionActionTypeDecrypt, +} + +// GetDecryptionActionTypeEnumValues Enumerates the set of values for DecryptionActionTypeEnum +func GetDecryptionActionTypeEnumValues() []DecryptionActionTypeEnum { + values := make([]DecryptionActionTypeEnum, 0) + for _, v := range mappingDecryptionActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetDecryptionActionTypeEnumStringValues Enumerates the set of values in String for DecryptionActionTypeEnum +func GetDecryptionActionTypeEnumStringValues() []string { + return []string{ + "NO_DECRYPT", + "DECRYPT", + } +} + +// GetMappingDecryptionActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDecryptionActionTypeEnum(val string) (DecryptionActionTypeEnum, bool) { + enum, ok := mappingDecryptionActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/decryption_profile.go b/networkfirewall/decryption_profile.go index e70c579871..1ac9729d17 100644 --- a/networkfirewall/decryption_profile.go +++ b/networkfirewall/decryption_profile.go @@ -18,11 +18,19 @@ import ( // DecryptionProfile Decryption Profile used on the firewall policy rules. type DecryptionProfile interface { + + // Unique Name of the decryption profile. + GetName() *string + + // OCID of the Network Firewall Policy this decryption profile belongs to. + GetParentResourceId() *string } type decryptionprofile struct { - JsonData []byte - Type string `json:"type"` + JsonData []byte + Name *string `mandatory:"true" json:"name"` + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + Type string `json:"type"` } // UnmarshalJSON unmarshals json @@ -36,6 +44,8 @@ func (m *decryptionprofile) UnmarshalJSON(data []byte) error { if err != nil { return err } + m.Name = s.Model.Name + m.ParentResourceId = s.Model.ParentResourceId m.Type = s.Model.Type return err @@ -64,6 +74,16 @@ func (m *decryptionprofile) UnmarshalPolymorphicJSON(data []byte) (interface{}, } } +// GetName returns Name +func (m decryptionprofile) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m decryptionprofile) GetParentResourceId() *string { + return m.ParentResourceId +} + func (m decryptionprofile) String() string { return common.PointerString(m) } @@ -79,45 +99,3 @@ func (m decryptionprofile) ValidateEnumValue() (bool, error) { } return false, nil } - -// DecryptionProfileTypeEnum Enum with underlying type: string -type DecryptionProfileTypeEnum string - -// Set of constants representing the allowable values for DecryptionProfileTypeEnum -const ( - DecryptionProfileTypeInboundInspection DecryptionProfileTypeEnum = "SSL_INBOUND_INSPECTION" - DecryptionProfileTypeForwardProxy DecryptionProfileTypeEnum = "SSL_FORWARD_PROXY" -) - -var mappingDecryptionProfileTypeEnum = map[string]DecryptionProfileTypeEnum{ - "SSL_INBOUND_INSPECTION": DecryptionProfileTypeInboundInspection, - "SSL_FORWARD_PROXY": DecryptionProfileTypeForwardProxy, -} - -var mappingDecryptionProfileTypeEnumLowerCase = map[string]DecryptionProfileTypeEnum{ - "ssl_inbound_inspection": DecryptionProfileTypeInboundInspection, - "ssl_forward_proxy": DecryptionProfileTypeForwardProxy, -} - -// GetDecryptionProfileTypeEnumValues Enumerates the set of values for DecryptionProfileTypeEnum -func GetDecryptionProfileTypeEnumValues() []DecryptionProfileTypeEnum { - values := make([]DecryptionProfileTypeEnum, 0) - for _, v := range mappingDecryptionProfileTypeEnum { - values = append(values, v) - } - return values -} - -// GetDecryptionProfileTypeEnumStringValues Enumerates the set of values in String for DecryptionProfileTypeEnum -func GetDecryptionProfileTypeEnumStringValues() []string { - return []string{ - "SSL_INBOUND_INSPECTION", - "SSL_FORWARD_PROXY", - } -} - -// GetMappingDecryptionProfileTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingDecryptionProfileTypeEnum(val string) (DecryptionProfileTypeEnum, bool) { - enum, ok := mappingDecryptionProfileTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/networkfirewall/decryption_profile_summary.go b/networkfirewall/decryption_profile_summary.go new file mode 100644 index 0000000000..bee3985d7f --- /dev/null +++ b/networkfirewall/decryption_profile_summary.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DecryptionProfileSummary Decryption Profile used on the firewall policy rules. +type DecryptionProfileSummary struct { + + // Name of the secret. + Name *string `mandatory:"true" json:"name"` + + // Type of the secrets mapped based on the policy. + // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. + // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. + Type InspectionTypeEnum `mandatory:"true" json:"type"` + + // OCID of the Network Firewall Policy this decryption profile belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m DecryptionProfileSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DecryptionProfileSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/decryption_profile_summary_collection.go b/networkfirewall/decryption_profile_summary_collection.go new file mode 100644 index 0000000000..78a309d9f5 --- /dev/null +++ b/networkfirewall/decryption_profile_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DecryptionProfileSummaryCollection Collection of Decryption Profiles in the network firewall policy +type DecryptionProfileSummaryCollection struct { + + // Collection of Decryption Profiles. + Items []DecryptionProfileSummary `mandatory:"true" json:"items"` +} + +func (m DecryptionProfileSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DecryptionProfileSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/decryption_rule.go b/networkfirewall/decryption_rule.go index bc5c8c465b..7cc7b4c67b 100644 --- a/networkfirewall/decryption_rule.go +++ b/networkfirewall/decryption_rule.go @@ -27,13 +27,18 @@ type DecryptionRule struct { // Action: // * NO_DECRYPT - Matching traffic is not decrypted. // * DECRYPT - Matching traffic is decrypted with the specified `secret` according to the specified `decryptionProfile`. - Action DecryptionRuleActionEnum `mandatory:"true" json:"action"` + Action DecryptionActionTypeEnum `mandatory:"true" json:"action"` + + // OCID of the Network Firewall Policy this decryption rule belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` // The name of the decryption profile to use. DecryptionProfile *string `mandatory:"false" json:"decryptionProfile"` // The name of a mapped secret. Its `type` must match that of the specified decryption profile. Secret *string `mandatory:"false" json:"secret"` + + Position *RulePosition `mandatory:"false" json:"position"` } func (m DecryptionRule) String() string { @@ -45,8 +50,8 @@ func (m DecryptionRule) String() string { // Not recommended for calling this function directly func (m DecryptionRule) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingDecryptionRuleActionEnum(string(m.Action)); !ok && m.Action != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetDecryptionRuleActionEnumStringValues(), ","))) + if _, ok := GetMappingDecryptionActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetDecryptionActionTypeEnumStringValues(), ","))) } if len(errMessage) > 0 { @@ -54,45 +59,3 @@ func (m DecryptionRule) ValidateEnumValue() (bool, error) { } return false, nil } - -// DecryptionRuleActionEnum Enum with underlying type: string -type DecryptionRuleActionEnum string - -// Set of constants representing the allowable values for DecryptionRuleActionEnum -const ( - DecryptionRuleActionNoDecrypt DecryptionRuleActionEnum = "NO_DECRYPT" - DecryptionRuleActionDecrypt DecryptionRuleActionEnum = "DECRYPT" -) - -var mappingDecryptionRuleActionEnum = map[string]DecryptionRuleActionEnum{ - "NO_DECRYPT": DecryptionRuleActionNoDecrypt, - "DECRYPT": DecryptionRuleActionDecrypt, -} - -var mappingDecryptionRuleActionEnumLowerCase = map[string]DecryptionRuleActionEnum{ - "no_decrypt": DecryptionRuleActionNoDecrypt, - "decrypt": DecryptionRuleActionDecrypt, -} - -// GetDecryptionRuleActionEnumValues Enumerates the set of values for DecryptionRuleActionEnum -func GetDecryptionRuleActionEnumValues() []DecryptionRuleActionEnum { - values := make([]DecryptionRuleActionEnum, 0) - for _, v := range mappingDecryptionRuleActionEnum { - values = append(values, v) - } - return values -} - -// GetDecryptionRuleActionEnumStringValues Enumerates the set of values in String for DecryptionRuleActionEnum -func GetDecryptionRuleActionEnumStringValues() []string { - return []string{ - "NO_DECRYPT", - "DECRYPT", - } -} - -// GetMappingDecryptionRuleActionEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingDecryptionRuleActionEnum(val string) (DecryptionRuleActionEnum, bool) { - enum, ok := mappingDecryptionRuleActionEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/networkfirewall/decryption_rule_match_criteria.go b/networkfirewall/decryption_rule_match_criteria.go index dbfdc5cdb8..653dd299cc 100644 --- a/networkfirewall/decryption_rule_match_criteria.go +++ b/networkfirewall/decryption_rule_match_criteria.go @@ -19,10 +19,10 @@ import ( type DecryptionRuleMatchCriteria struct { // An array of IP address list names to be evaluated against the traffic source address. - Sources []string `mandatory:"false" json:"sources"` + SourceAddress []string `mandatory:"false" json:"sourceAddress"` // An array of IP address list names to be evaluated against the traffic destination address. - Destinations []string `mandatory:"false" json:"destinations"` + DestinationAddress []string `mandatory:"false" json:"destinationAddress"` } func (m DecryptionRuleMatchCriteria) String() string { diff --git a/networkfirewall/decryption_rule_summary.go b/networkfirewall/decryption_rule_summary.go new file mode 100644 index 0000000000..afa3261438 --- /dev/null +++ b/networkfirewall/decryption_rule_summary.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DecryptionRuleSummary Summary for Decryption Rule used in the firewall policy rules. +// A Decryption Rule is used to define which traffic should be decrypted by the firewall, and how it should do so. +type DecryptionRuleSummary struct { + + // Name for the decryption rule, must be unique within the policy. + Name *string `mandatory:"true" json:"name"` + + // Action: + // * NO_DECRYPT - Matching traffic is not decrypted. + // * DECRYPT - Matching traffic is decrypted with the specified `secret` according to the specified `decryptionProfile`. + Action DecryptionActionTypeEnum `mandatory:"true" json:"action"` + + // The name of the decryption profile to use. + DecryptionProfile *string `mandatory:"true" json:"decryptionProfile"` + + // The name of a mapped secret. Its `type` must match that of the specified decryption profile. + Secret *string `mandatory:"true" json:"secret"` + + // The priority order in which this rule should be evaluated. + PriorityOrder *int64 `mandatory:"true" json:"priorityOrder"` + + // OCID of the Network Firewall Policy this application belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m DecryptionRuleSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DecryptionRuleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDecryptionActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetDecryptionActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/decryption_rule_summary_collection.go b/networkfirewall/decryption_rule_summary_collection.go new file mode 100644 index 0000000000..ba7bc4d407 --- /dev/null +++ b/networkfirewall/decryption_rule_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DecryptionRuleSummaryCollection Collection of Decryption Rule Summaries in the network firewall policy +type DecryptionRuleSummaryCollection struct { + + // Collection of Decryption Rule Summaries. + Items []DecryptionRuleSummary `mandatory:"true" json:"items"` +} + +func (m DecryptionRuleSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DecryptionRuleSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/delete_address_list_request_response.go b/networkfirewall/delete_address_list_request_response.go new file mode 100644 index 0000000000..6eeaa17c62 --- /dev/null +++ b/networkfirewall/delete_address_list_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteAddressListRequest wrapper for the DeleteAddressList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteAddressList.go.html to see an example of how to use DeleteAddressListRequest. +type DeleteAddressListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for address lists. + AddressListName *string `mandatory:"true" contributesTo:"path" name:"addressListName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAddressListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAddressListRequest) 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 DeleteAddressListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAddressListRequest) 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 DeleteAddressListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteAddressListResponse wrapper for the DeleteAddressList operation +type DeleteAddressListResponse 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 DeleteAddressListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAddressListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_application_group_request_response.go b/networkfirewall/delete_application_group_request_response.go new file mode 100644 index 0000000000..f9bb4fcdc7 --- /dev/null +++ b/networkfirewall/delete_application_group_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteApplicationGroupRequest wrapper for the DeleteApplicationGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteApplicationGroup.go.html to see an example of how to use DeleteApplicationGroupRequest. +type DeleteApplicationGroupRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for Application Lists in the scope of Network Firewall Policy. + ApplicationGroupName *string `mandatory:"true" contributesTo:"path" name:"applicationGroupName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteApplicationGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteApplicationGroupRequest) 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 DeleteApplicationGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteApplicationGroupRequest) 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 DeleteApplicationGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteApplicationGroupResponse wrapper for the DeleteApplicationGroup operation +type DeleteApplicationGroupResponse 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 DeleteApplicationGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteApplicationGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_application_request_response.go b/networkfirewall/delete_application_request_response.go new file mode 100644 index 0000000000..191ae34216 --- /dev/null +++ b/networkfirewall/delete_application_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteApplicationRequest wrapper for the DeleteApplication operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteApplication.go.html to see an example of how to use DeleteApplicationRequest. +type DeleteApplicationRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Applications. + ApplicationName *string `mandatory:"true" contributesTo:"path" name:"applicationName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteApplicationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteApplicationRequest) 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 DeleteApplicationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteApplicationRequest) 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 DeleteApplicationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteApplicationResponse wrapper for the DeleteApplication operation +type DeleteApplicationResponse 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 DeleteApplicationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteApplicationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_decryption_profile_request_response.go b/networkfirewall/delete_decryption_profile_request_response.go new file mode 100644 index 0000000000..25f05f5ad4 --- /dev/null +++ b/networkfirewall/delete_decryption_profile_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDecryptionProfileRequest wrapper for the DeleteDecryptionProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteDecryptionProfile.go.html to see an example of how to use DeleteDecryptionProfileRequest. +type DeleteDecryptionProfileRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Decryption Profiles. + DecryptionProfileName *string `mandatory:"true" contributesTo:"path" name:"decryptionProfileName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteDecryptionProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDecryptionProfileRequest) 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 DeleteDecryptionProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDecryptionProfileRequest) 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 DeleteDecryptionProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDecryptionProfileResponse wrapper for the DeleteDecryptionProfile operation +type DeleteDecryptionProfileResponse 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 DeleteDecryptionProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDecryptionProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_decryption_rule_request_response.go b/networkfirewall/delete_decryption_rule_request_response.go new file mode 100644 index 0000000000..a91fd8914b --- /dev/null +++ b/networkfirewall/delete_decryption_rule_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDecryptionRuleRequest wrapper for the DeleteDecryptionRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteDecryptionRule.go.html to see an example of how to use DeleteDecryptionRuleRequest. +type DeleteDecryptionRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Decryption Rules in the network firewall policy. + DecryptionRuleName *string `mandatory:"true" contributesTo:"path" name:"decryptionRuleName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteDecryptionRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDecryptionRuleRequest) 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 DeleteDecryptionRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDecryptionRuleRequest) 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 DeleteDecryptionRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDecryptionRuleResponse wrapper for the DeleteDecryptionRule operation +type DeleteDecryptionRuleResponse 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 DeleteDecryptionRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDecryptionRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_mapped_secret_request_response.go b/networkfirewall/delete_mapped_secret_request_response.go new file mode 100644 index 0000000000..310f1eca8c --- /dev/null +++ b/networkfirewall/delete_mapped_secret_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteMappedSecretRequest wrapper for the DeleteMappedSecret operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteMappedSecret.go.html to see an example of how to use DeleteMappedSecretRequest. +type DeleteMappedSecretRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Mapped Secrets. + MappedSecretName *string `mandatory:"true" contributesTo:"path" name:"mappedSecretName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteMappedSecretRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteMappedSecretRequest) 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 DeleteMappedSecretRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteMappedSecretRequest) 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 DeleteMappedSecretRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteMappedSecretResponse wrapper for the DeleteMappedSecret operation +type DeleteMappedSecretResponse 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 DeleteMappedSecretResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteMappedSecretResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_security_rule_request_response.go b/networkfirewall/delete_security_rule_request_response.go new file mode 100644 index 0000000000..cc19d8b19a --- /dev/null +++ b/networkfirewall/delete_security_rule_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteSecurityRuleRequest wrapper for the DeleteSecurityRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteSecurityRule.go.html to see an example of how to use DeleteSecurityRuleRequest. +type DeleteSecurityRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Security Rules in the network firewall policy. + SecurityRuleName *string `mandatory:"true" contributesTo:"path" name:"securityRuleName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteSecurityRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSecurityRuleRequest) 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 DeleteSecurityRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSecurityRuleRequest) 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 DeleteSecurityRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteSecurityRuleResponse wrapper for the DeleteSecurityRule operation +type DeleteSecurityRuleResponse 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 DeleteSecurityRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSecurityRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_service_list_request_response.go b/networkfirewall/delete_service_list_request_response.go new file mode 100644 index 0000000000..8a29dde563 --- /dev/null +++ b/networkfirewall/delete_service_list_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteServiceListRequest wrapper for the DeleteServiceList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteServiceList.go.html to see an example of how to use DeleteServiceListRequest. +type DeleteServiceListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for Service Lists in the scope of Network Firewall Policy. + ServiceListName *string `mandatory:"true" contributesTo:"path" name:"serviceListName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteServiceListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteServiceListRequest) 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 DeleteServiceListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteServiceListRequest) 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 DeleteServiceListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteServiceListResponse wrapper for the DeleteServiceList operation +type DeleteServiceListResponse 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 DeleteServiceListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteServiceListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_service_request_response.go b/networkfirewall/delete_service_request_response.go new file mode 100644 index 0000000000..910d74fa93 --- /dev/null +++ b/networkfirewall/delete_service_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteServiceRequest wrapper for the DeleteService operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteService.go.html to see an example of how to use DeleteServiceRequest. +type DeleteServiceRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Services. + ServiceName *string `mandatory:"true" contributesTo:"path" name:"serviceName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteServiceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteServiceRequest) 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 DeleteServiceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteServiceRequest) 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 DeleteServiceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteServiceResponse wrapper for the DeleteService operation +type DeleteServiceResponse 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 DeleteServiceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteServiceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/delete_url_list_request_response.go b/networkfirewall/delete_url_list_request_response.go new file mode 100644 index 0000000000..be8d4918a3 --- /dev/null +++ b/networkfirewall/delete_url_list_request_response.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. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteUrlListRequest wrapper for the DeleteUrlList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteUrlList.go.html to see an example of how to use DeleteUrlListRequest. +type DeleteUrlListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for url lists in the scope of Network Firewall Policy. + UrlListName *string `mandatory:"true" contributesTo:"path" name:"urlListName"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteUrlListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteUrlListRequest) 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 DeleteUrlListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteUrlListRequest) 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 DeleteUrlListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteUrlListResponse wrapper for the DeleteUrlList operation +type DeleteUrlListResponse 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 DeleteUrlListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteUrlListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_address_list_request_response.go b/networkfirewall/get_address_list_request_response.go new file mode 100644 index 0000000000..c98db7bc2f --- /dev/null +++ b/networkfirewall/get_address_list_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetAddressListRequest wrapper for the GetAddressList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetAddressList.go.html to see an example of how to use GetAddressListRequest. +type GetAddressListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for address lists. + AddressListName *string `mandatory:"true" contributesTo:"path" name:"addressListName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAddressListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAddressListRequest) 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 GetAddressListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAddressListRequest) 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 GetAddressListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetAddressListResponse wrapper for the GetAddressList operation +type GetAddressListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AddressList instance + AddressList `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 GetAddressListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAddressListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_application_group_request_response.go b/networkfirewall/get_application_group_request_response.go new file mode 100644 index 0000000000..924d94bc05 --- /dev/null +++ b/networkfirewall/get_application_group_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetApplicationGroupRequest wrapper for the GetApplicationGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetApplicationGroup.go.html to see an example of how to use GetApplicationGroupRequest. +type GetApplicationGroupRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for Application Lists in the scope of Network Firewall Policy. + ApplicationGroupName *string `mandatory:"true" contributesTo:"path" name:"applicationGroupName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetApplicationGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetApplicationGroupRequest) 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 GetApplicationGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetApplicationGroupRequest) 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 GetApplicationGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetApplicationGroupResponse wrapper for the GetApplicationGroup operation +type GetApplicationGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ApplicationGroup instance + ApplicationGroup `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 GetApplicationGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetApplicationGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_application_request_response.go b/networkfirewall/get_application_request_response.go new file mode 100644 index 0000000000..df390ba8c6 --- /dev/null +++ b/networkfirewall/get_application_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetApplicationRequest wrapper for the GetApplication operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetApplication.go.html to see an example of how to use GetApplicationRequest. +type GetApplicationRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Applications. + ApplicationName *string `mandatory:"true" contributesTo:"path" name:"applicationName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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` or `opc-prev-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetApplicationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetApplicationRequest) 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 GetApplicationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetApplicationRequest) 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 GetApplicationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetApplicationResponse wrapper for the GetApplication operation +type GetApplicationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of Application instances + Application `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 GetApplicationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetApplicationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_decryption_profile_request_response.go b/networkfirewall/get_decryption_profile_request_response.go new file mode 100644 index 0000000000..6e164ec211 --- /dev/null +++ b/networkfirewall/get_decryption_profile_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDecryptionProfileRequest wrapper for the GetDecryptionProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetDecryptionProfile.go.html to see an example of how to use GetDecryptionProfileRequest. +type GetDecryptionProfileRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Decryption Profiles. + DecryptionProfileName *string `mandatory:"true" contributesTo:"path" name:"decryptionProfileName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDecryptionProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDecryptionProfileRequest) 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 GetDecryptionProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDecryptionProfileRequest) 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 GetDecryptionProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDecryptionProfileResponse wrapper for the GetDecryptionProfile operation +type GetDecryptionProfileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DecryptionProfile instance + DecryptionProfile `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 GetDecryptionProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDecryptionProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_decryption_rule_request_response.go b/networkfirewall/get_decryption_rule_request_response.go new file mode 100644 index 0000000000..f2419d4719 --- /dev/null +++ b/networkfirewall/get_decryption_rule_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDecryptionRuleRequest wrapper for the GetDecryptionRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetDecryptionRule.go.html to see an example of how to use GetDecryptionRuleRequest. +type GetDecryptionRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Decryption Rules in the network firewall policy. + DecryptionRuleName *string `mandatory:"true" contributesTo:"path" name:"decryptionRuleName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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` or `opc-prev-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDecryptionRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDecryptionRuleRequest) 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 GetDecryptionRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDecryptionRuleRequest) 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 GetDecryptionRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDecryptionRuleResponse wrapper for the GetDecryptionRule operation +type GetDecryptionRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DecryptionRule instances + DecryptionRule `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 GetDecryptionRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDecryptionRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_mapped_secret_request_response.go b/networkfirewall/get_mapped_secret_request_response.go new file mode 100644 index 0000000000..a9de1f87c2 --- /dev/null +++ b/networkfirewall/get_mapped_secret_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetMappedSecretRequest wrapper for the GetMappedSecret operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetMappedSecret.go.html to see an example of how to use GetMappedSecretRequest. +type GetMappedSecretRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Mapped Secrets. + MappedSecretName *string `mandatory:"true" contributesTo:"path" name:"mappedSecretName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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` or `opc-prev-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetMappedSecretRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetMappedSecretRequest) 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 GetMappedSecretRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMappedSecretRequest) 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 GetMappedSecretRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetMappedSecretResponse wrapper for the GetMappedSecret operation +type GetMappedSecretResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of MappedSecret instances + MappedSecret `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 GetMappedSecretResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetMappedSecretResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_security_rule_request_response.go b/networkfirewall/get_security_rule_request_response.go new file mode 100644 index 0000000000..ff7f981fdb --- /dev/null +++ b/networkfirewall/get_security_rule_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSecurityRuleRequest wrapper for the GetSecurityRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetSecurityRule.go.html to see an example of how to use GetSecurityRuleRequest. +type GetSecurityRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Security Rules in the network firewall policy. + SecurityRuleName *string `mandatory:"true" contributesTo:"path" name:"securityRuleName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSecurityRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSecurityRuleRequest) 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 GetSecurityRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSecurityRuleRequest) 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 GetSecurityRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSecurityRuleResponse wrapper for the GetSecurityRule operation +type GetSecurityRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SecurityRule instance + SecurityRule `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 GetSecurityRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSecurityRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_service_list_request_response.go b/networkfirewall/get_service_list_request_response.go new file mode 100644 index 0000000000..f3c08dcada --- /dev/null +++ b/networkfirewall/get_service_list_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetServiceListRequest wrapper for the GetServiceList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetServiceList.go.html to see an example of how to use GetServiceListRequest. +type GetServiceListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for Service Lists in the scope of Network Firewall Policy. + ServiceListName *string `mandatory:"true" contributesTo:"path" name:"serviceListName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetServiceListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetServiceListRequest) 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 GetServiceListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetServiceListRequest) 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 GetServiceListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetServiceListResponse wrapper for the GetServiceList operation +type GetServiceListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceList instance + ServiceList `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 GetServiceListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetServiceListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_service_request_response.go b/networkfirewall/get_service_request_response.go new file mode 100644 index 0000000000..ba201c4336 --- /dev/null +++ b/networkfirewall/get_service_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetServiceRequest wrapper for the GetService operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetService.go.html to see an example of how to use GetServiceRequest. +type GetServiceRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Services. + ServiceName *string `mandatory:"true" contributesTo:"path" name:"serviceName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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` or `opc-prev-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetServiceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetServiceRequest) 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 GetServiceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetServiceRequest) 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 GetServiceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetServiceResponse wrapper for the GetService operation +type GetServiceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of Service instances + Service `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 GetServiceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetServiceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/get_url_list_request_response.go b/networkfirewall/get_url_list_request_response.go new file mode 100644 index 0000000000..3c3b3e8905 --- /dev/null +++ b/networkfirewall/get_url_list_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetUrlListRequest wrapper for the GetUrlList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetUrlList.go.html to see an example of how to use GetUrlListRequest. +type GetUrlListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for url lists in the scope of Network Firewall Policy. + UrlListName *string `mandatory:"true" contributesTo:"path" name:"urlListName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetUrlListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetUrlListRequest) 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 GetUrlListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetUrlListRequest) 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 GetUrlListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetUrlListResponse wrapper for the GetUrlList operation +type GetUrlListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The UrlList instance + UrlList `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 GetUrlListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetUrlListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/icmp6_application.go b/networkfirewall/icmp6_application.go index 71d10bbd0a..8210e0942d 100644 --- a/networkfirewall/icmp6_application.go +++ b/networkfirewall/icmp6_application.go @@ -19,6 +19,12 @@ import ( // Icmp6Application ICMP6 Application used on the firewall policy rules. type Icmp6Application struct { + // Name of the application. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this application belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + // The value of the ICMP6 message Type field as defined by RFC 4443 (https://www.rfc-editor.org/rfc/rfc4443.html#section-2.1). IcmpType *int `mandatory:"true" json:"icmpType"` @@ -26,6 +32,16 @@ type Icmp6Application struct { IcmpCode *int `mandatory:"false" json:"icmpCode"` } +// GetName returns Name +func (m Icmp6Application) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m Icmp6Application) GetParentResourceId() *string { + return m.ParentResourceId +} + func (m Icmp6Application) String() string { return common.PointerString(m) } @@ -49,7 +65,7 @@ func (m Icmp6Application) MarshalJSON() (buff []byte, e error) { DiscriminatorParam string `json:"type"` MarshalTypeIcmp6Application }{ - "ICMP6", + "ICMP_V6", (MarshalTypeIcmp6Application)(m), } diff --git a/networkfirewall/icmp6_application_summary.go b/networkfirewall/icmp6_application_summary.go new file mode 100644 index 0000000000..4ccc73a814 --- /dev/null +++ b/networkfirewall/icmp6_application_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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Icmp6ApplicationSummary Summary object for ICMP V6 application element in the network firewall policy. +type Icmp6ApplicationSummary struct { + + // Name of the application. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this application belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + + // The value of the ICMP message Type field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpType *int `mandatory:"true" json:"icmpType"` + + // The value of the ICMP message Code (subtype) field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpCode *int `mandatory:"false" json:"icmpCode"` +} + +// GetName returns Name +func (m Icmp6ApplicationSummary) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m Icmp6ApplicationSummary) GetParentResourceId() *string { + return m.ParentResourceId +} + +func (m Icmp6ApplicationSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Icmp6ApplicationSummary) 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 Icmp6ApplicationSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeIcmp6ApplicationSummary Icmp6ApplicationSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeIcmp6ApplicationSummary + }{ + "ICMP_V6", + (MarshalTypeIcmp6ApplicationSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/icmp_application.go b/networkfirewall/icmp_application.go index 85dd42cf74..047510425c 100644 --- a/networkfirewall/icmp_application.go +++ b/networkfirewall/icmp_application.go @@ -19,6 +19,12 @@ import ( // IcmpApplication ICMP Application used on the firewall policy rules. type IcmpApplication struct { + // Name of the application. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this application belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + // The value of the ICMP message Type field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). IcmpType *int `mandatory:"true" json:"icmpType"` @@ -26,6 +32,16 @@ type IcmpApplication struct { IcmpCode *int `mandatory:"false" json:"icmpCode"` } +// GetName returns Name +func (m IcmpApplication) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m IcmpApplication) GetParentResourceId() *string { + return m.ParentResourceId +} + func (m IcmpApplication) String() string { return common.PointerString(m) } diff --git a/networkfirewall/icmp_application_summary.go b/networkfirewall/icmp_application_summary.go new file mode 100644 index 0000000000..12388afab6 --- /dev/null +++ b/networkfirewall/icmp_application_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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// IcmpApplicationSummary Summary object for ICMP application element in the network firewall policy. +type IcmpApplicationSummary struct { + + // Name of the application. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this application belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + + // The value of the ICMP message Type field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpType *int `mandatory:"true" json:"icmpType"` + + // The value of the ICMP message Code (subtype) field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpCode *int `mandatory:"false" json:"icmpCode"` +} + +// GetName returns Name +func (m IcmpApplicationSummary) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m IcmpApplicationSummary) GetParentResourceId() *string { + return m.ParentResourceId +} + +func (m IcmpApplicationSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m IcmpApplicationSummary) 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 IcmpApplicationSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeIcmpApplicationSummary IcmpApplicationSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeIcmpApplicationSummary + }{ + "ICMP", + (MarshalTypeIcmpApplicationSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/inspection_type.go b/networkfirewall/inspection_type.go new file mode 100644 index 0000000000..b7900b5636 --- /dev/null +++ b/networkfirewall/inspection_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// InspectionTypeEnum Enum with underlying type: string +type InspectionTypeEnum string + +// Set of constants representing the allowable values for InspectionTypeEnum +const ( + InspectionTypeSslInboundInspection InspectionTypeEnum = "SSL_INBOUND_INSPECTION" + InspectionTypeSslForwardProxy InspectionTypeEnum = "SSL_FORWARD_PROXY" +) + +var mappingInspectionTypeEnum = map[string]InspectionTypeEnum{ + "SSL_INBOUND_INSPECTION": InspectionTypeSslInboundInspection, + "SSL_FORWARD_PROXY": InspectionTypeSslForwardProxy, +} + +var mappingInspectionTypeEnumLowerCase = map[string]InspectionTypeEnum{ + "ssl_inbound_inspection": InspectionTypeSslInboundInspection, + "ssl_forward_proxy": InspectionTypeSslForwardProxy, +} + +// GetInspectionTypeEnumValues Enumerates the set of values for InspectionTypeEnum +func GetInspectionTypeEnumValues() []InspectionTypeEnum { + values := make([]InspectionTypeEnum, 0) + for _, v := range mappingInspectionTypeEnum { + values = append(values, v) + } + return values +} + +// GetInspectionTypeEnumStringValues Enumerates the set of values in String for InspectionTypeEnum +func GetInspectionTypeEnumStringValues() []string { + return []string{ + "SSL_INBOUND_INSPECTION", + "SSL_FORWARD_PROXY", + } +} + +// GetMappingInspectionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingInspectionTypeEnum(val string) (InspectionTypeEnum, bool) { + enum, ok := mappingInspectionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/lifecycle_state.go b/networkfirewall/lifecycle_state.go index 46c9c986a9..00b5c652ec 100644 --- a/networkfirewall/lifecycle_state.go +++ b/networkfirewall/lifecycle_state.go @@ -18,30 +18,39 @@ type LifecycleStateEnum string // Set of constants representing the allowable values for LifecycleStateEnum const ( - LifecycleStateCreating LifecycleStateEnum = "CREATING" - LifecycleStateUpdating LifecycleStateEnum = "UPDATING" - LifecycleStateActive LifecycleStateEnum = "ACTIVE" - LifecycleStateDeleting LifecycleStateEnum = "DELETING" - LifecycleStateDeleted LifecycleStateEnum = "DELETED" - LifecycleStateFailed LifecycleStateEnum = "FAILED" + LifecycleStateCreating LifecycleStateEnum = "CREATING" + LifecycleStateUpdating LifecycleStateEnum = "UPDATING" + LifecycleStateActive LifecycleStateEnum = "ACTIVE" + LifecycleStateDeleting LifecycleStateEnum = "DELETING" + LifecycleStateDeleted LifecycleStateEnum = "DELETED" + LifecycleStateFailed LifecycleStateEnum = "FAILED" + LifecycleStateNeedsAttention LifecycleStateEnum = "NEEDS_ATTENTION" + LifecycleStateAttaching LifecycleStateEnum = "ATTACHING" + LifecycleStateDetaching LifecycleStateEnum = "DETACHING" ) var mappingLifecycleStateEnum = map[string]LifecycleStateEnum{ - "CREATING": LifecycleStateCreating, - "UPDATING": LifecycleStateUpdating, - "ACTIVE": LifecycleStateActive, - "DELETING": LifecycleStateDeleting, - "DELETED": LifecycleStateDeleted, - "FAILED": LifecycleStateFailed, + "CREATING": LifecycleStateCreating, + "UPDATING": LifecycleStateUpdating, + "ACTIVE": LifecycleStateActive, + "DELETING": LifecycleStateDeleting, + "DELETED": LifecycleStateDeleted, + "FAILED": LifecycleStateFailed, + "NEEDS_ATTENTION": LifecycleStateNeedsAttention, + "ATTACHING": LifecycleStateAttaching, + "DETACHING": LifecycleStateDetaching, } var mappingLifecycleStateEnumLowerCase = map[string]LifecycleStateEnum{ - "creating": LifecycleStateCreating, - "updating": LifecycleStateUpdating, - "active": LifecycleStateActive, - "deleting": LifecycleStateDeleting, - "deleted": LifecycleStateDeleted, - "failed": LifecycleStateFailed, + "creating": LifecycleStateCreating, + "updating": LifecycleStateUpdating, + "active": LifecycleStateActive, + "deleting": LifecycleStateDeleting, + "deleted": LifecycleStateDeleted, + "failed": LifecycleStateFailed, + "needs_attention": LifecycleStateNeedsAttention, + "attaching": LifecycleStateAttaching, + "detaching": LifecycleStateDetaching, } // GetLifecycleStateEnumValues Enumerates the set of values for LifecycleStateEnum @@ -62,6 +71,9 @@ func GetLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "NEEDS_ATTENTION", + "ATTACHING", + "DETACHING", } } diff --git a/networkfirewall/list_address_lists_request_response.go b/networkfirewall/list_address_lists_request_response.go new file mode 100644 index 0000000000..bf8e4fcc79 --- /dev/null +++ b/networkfirewall/list_address_lists_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListAddressListsRequest wrapper for the ListAddressLists operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListAddressLists.go.html to see an example of how to use ListAddressListsRequest. +type ListAddressListsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListAddressListsSortOrderEnum `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 ListAddressListsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAddressListsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAddressListsRequest) 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 ListAddressListsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAddressListsRequest) 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 ListAddressListsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListAddressListsSortOrderEnum(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(GetListAddressListsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListAddressListsSortByEnum(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(GetListAddressListsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListAddressListsResponse wrapper for the ListAddressLists operation +type ListAddressListsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of AddressListSummaryCollection instances + AddressListSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListAddressListsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAddressListsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAddressListsSortOrderEnum Enum with underlying type: string +type ListAddressListsSortOrderEnum string + +// Set of constants representing the allowable values for ListAddressListsSortOrderEnum +const ( + ListAddressListsSortOrderAsc ListAddressListsSortOrderEnum = "ASC" + ListAddressListsSortOrderDesc ListAddressListsSortOrderEnum = "DESC" +) + +var mappingListAddressListsSortOrderEnum = map[string]ListAddressListsSortOrderEnum{ + "ASC": ListAddressListsSortOrderAsc, + "DESC": ListAddressListsSortOrderDesc, +} + +var mappingListAddressListsSortOrderEnumLowerCase = map[string]ListAddressListsSortOrderEnum{ + "asc": ListAddressListsSortOrderAsc, + "desc": ListAddressListsSortOrderDesc, +} + +// GetListAddressListsSortOrderEnumValues Enumerates the set of values for ListAddressListsSortOrderEnum +func GetListAddressListsSortOrderEnumValues() []ListAddressListsSortOrderEnum { + values := make([]ListAddressListsSortOrderEnum, 0) + for _, v := range mappingListAddressListsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListAddressListsSortOrderEnumStringValues Enumerates the set of values in String for ListAddressListsSortOrderEnum +func GetListAddressListsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListAddressListsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListAddressListsSortOrderEnum(val string) (ListAddressListsSortOrderEnum, bool) { + enum, ok := mappingListAddressListsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListAddressListsSortByEnum Enum with underlying type: string +type ListAddressListsSortByEnum string + +// Set of constants representing the allowable values for ListAddressListsSortByEnum +const ( + ListAddressListsSortByTimecreated ListAddressListsSortByEnum = "timeCreated" + ListAddressListsSortByDisplayname ListAddressListsSortByEnum = "displayName" +) + +var mappingListAddressListsSortByEnum = map[string]ListAddressListsSortByEnum{ + "timeCreated": ListAddressListsSortByTimecreated, + "displayName": ListAddressListsSortByDisplayname, +} + +var mappingListAddressListsSortByEnumLowerCase = map[string]ListAddressListsSortByEnum{ + "timecreated": ListAddressListsSortByTimecreated, + "displayname": ListAddressListsSortByDisplayname, +} + +// GetListAddressListsSortByEnumValues Enumerates the set of values for ListAddressListsSortByEnum +func GetListAddressListsSortByEnumValues() []ListAddressListsSortByEnum { + values := make([]ListAddressListsSortByEnum, 0) + for _, v := range mappingListAddressListsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListAddressListsSortByEnumStringValues Enumerates the set of values in String for ListAddressListsSortByEnum +func GetListAddressListsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListAddressListsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListAddressListsSortByEnum(val string) (ListAddressListsSortByEnum, bool) { + enum, ok := mappingListAddressListsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_application_groups_request_response.go b/networkfirewall/list_application_groups_request_response.go new file mode 100644 index 0000000000..6886c22044 --- /dev/null +++ b/networkfirewall/list_application_groups_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListApplicationGroupsRequest wrapper for the ListApplicationGroups operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListApplicationGroups.go.html to see an example of how to use ListApplicationGroupsRequest. +type ListApplicationGroupsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListApplicationGroupsSortOrderEnum `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 ListApplicationGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListApplicationGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListApplicationGroupsRequest) 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 ListApplicationGroupsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListApplicationGroupsRequest) 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 ListApplicationGroupsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListApplicationGroupsSortOrderEnum(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(GetListApplicationGroupsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListApplicationGroupsSortByEnum(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(GetListApplicationGroupsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListApplicationGroupsResponse wrapper for the ListApplicationGroups operation +type ListApplicationGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ApplicationGroupSummaryCollection instances + ApplicationGroupSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListApplicationGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListApplicationGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListApplicationGroupsSortOrderEnum Enum with underlying type: string +type ListApplicationGroupsSortOrderEnum string + +// Set of constants representing the allowable values for ListApplicationGroupsSortOrderEnum +const ( + ListApplicationGroupsSortOrderAsc ListApplicationGroupsSortOrderEnum = "ASC" + ListApplicationGroupsSortOrderDesc ListApplicationGroupsSortOrderEnum = "DESC" +) + +var mappingListApplicationGroupsSortOrderEnum = map[string]ListApplicationGroupsSortOrderEnum{ + "ASC": ListApplicationGroupsSortOrderAsc, + "DESC": ListApplicationGroupsSortOrderDesc, +} + +var mappingListApplicationGroupsSortOrderEnumLowerCase = map[string]ListApplicationGroupsSortOrderEnum{ + "asc": ListApplicationGroupsSortOrderAsc, + "desc": ListApplicationGroupsSortOrderDesc, +} + +// GetListApplicationGroupsSortOrderEnumValues Enumerates the set of values for ListApplicationGroupsSortOrderEnum +func GetListApplicationGroupsSortOrderEnumValues() []ListApplicationGroupsSortOrderEnum { + values := make([]ListApplicationGroupsSortOrderEnum, 0) + for _, v := range mappingListApplicationGroupsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListApplicationGroupsSortOrderEnumStringValues Enumerates the set of values in String for ListApplicationGroupsSortOrderEnum +func GetListApplicationGroupsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListApplicationGroupsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListApplicationGroupsSortOrderEnum(val string) (ListApplicationGroupsSortOrderEnum, bool) { + enum, ok := mappingListApplicationGroupsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListApplicationGroupsSortByEnum Enum with underlying type: string +type ListApplicationGroupsSortByEnum string + +// Set of constants representing the allowable values for ListApplicationGroupsSortByEnum +const ( + ListApplicationGroupsSortByTimecreated ListApplicationGroupsSortByEnum = "timeCreated" + ListApplicationGroupsSortByDisplayname ListApplicationGroupsSortByEnum = "displayName" +) + +var mappingListApplicationGroupsSortByEnum = map[string]ListApplicationGroupsSortByEnum{ + "timeCreated": ListApplicationGroupsSortByTimecreated, + "displayName": ListApplicationGroupsSortByDisplayname, +} + +var mappingListApplicationGroupsSortByEnumLowerCase = map[string]ListApplicationGroupsSortByEnum{ + "timecreated": ListApplicationGroupsSortByTimecreated, + "displayname": ListApplicationGroupsSortByDisplayname, +} + +// GetListApplicationGroupsSortByEnumValues Enumerates the set of values for ListApplicationGroupsSortByEnum +func GetListApplicationGroupsSortByEnumValues() []ListApplicationGroupsSortByEnum { + values := make([]ListApplicationGroupsSortByEnum, 0) + for _, v := range mappingListApplicationGroupsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListApplicationGroupsSortByEnumStringValues Enumerates the set of values in String for ListApplicationGroupsSortByEnum +func GetListApplicationGroupsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListApplicationGroupsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListApplicationGroupsSortByEnum(val string) (ListApplicationGroupsSortByEnum, bool) { + enum, ok := mappingListApplicationGroupsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_applications_request_response.go b/networkfirewall/list_applications_request_response.go new file mode 100644 index 0000000000..27e346b48c --- /dev/null +++ b/networkfirewall/list_applications_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListApplicationsRequest wrapper for the ListApplications operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListApplications.go.html to see an example of how to use ListApplicationsRequest. +type ListApplicationsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListApplicationsSortOrderEnum `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 ListApplicationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListApplicationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListApplicationsRequest) 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 ListApplicationsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListApplicationsRequest) 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 ListApplicationsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListApplicationsSortOrderEnum(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(GetListApplicationsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListApplicationsSortByEnum(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(GetListApplicationsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListApplicationsResponse wrapper for the ListApplications operation +type ListApplicationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ApplicationSummaryCollection instances + ApplicationSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListApplicationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListApplicationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListApplicationsSortOrderEnum Enum with underlying type: string +type ListApplicationsSortOrderEnum string + +// Set of constants representing the allowable values for ListApplicationsSortOrderEnum +const ( + ListApplicationsSortOrderAsc ListApplicationsSortOrderEnum = "ASC" + ListApplicationsSortOrderDesc ListApplicationsSortOrderEnum = "DESC" +) + +var mappingListApplicationsSortOrderEnum = map[string]ListApplicationsSortOrderEnum{ + "ASC": ListApplicationsSortOrderAsc, + "DESC": ListApplicationsSortOrderDesc, +} + +var mappingListApplicationsSortOrderEnumLowerCase = map[string]ListApplicationsSortOrderEnum{ + "asc": ListApplicationsSortOrderAsc, + "desc": ListApplicationsSortOrderDesc, +} + +// GetListApplicationsSortOrderEnumValues Enumerates the set of values for ListApplicationsSortOrderEnum +func GetListApplicationsSortOrderEnumValues() []ListApplicationsSortOrderEnum { + values := make([]ListApplicationsSortOrderEnum, 0) + for _, v := range mappingListApplicationsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListApplicationsSortOrderEnumStringValues Enumerates the set of values in String for ListApplicationsSortOrderEnum +func GetListApplicationsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListApplicationsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListApplicationsSortOrderEnum(val string) (ListApplicationsSortOrderEnum, bool) { + enum, ok := mappingListApplicationsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListApplicationsSortByEnum Enum with underlying type: string +type ListApplicationsSortByEnum string + +// Set of constants representing the allowable values for ListApplicationsSortByEnum +const ( + ListApplicationsSortByTimecreated ListApplicationsSortByEnum = "timeCreated" + ListApplicationsSortByDisplayname ListApplicationsSortByEnum = "displayName" +) + +var mappingListApplicationsSortByEnum = map[string]ListApplicationsSortByEnum{ + "timeCreated": ListApplicationsSortByTimecreated, + "displayName": ListApplicationsSortByDisplayname, +} + +var mappingListApplicationsSortByEnumLowerCase = map[string]ListApplicationsSortByEnum{ + "timecreated": ListApplicationsSortByTimecreated, + "displayname": ListApplicationsSortByDisplayname, +} + +// GetListApplicationsSortByEnumValues Enumerates the set of values for ListApplicationsSortByEnum +func GetListApplicationsSortByEnumValues() []ListApplicationsSortByEnum { + values := make([]ListApplicationsSortByEnum, 0) + for _, v := range mappingListApplicationsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListApplicationsSortByEnumStringValues Enumerates the set of values in String for ListApplicationsSortByEnum +func GetListApplicationsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListApplicationsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListApplicationsSortByEnum(val string) (ListApplicationsSortByEnum, bool) { + enum, ok := mappingListApplicationsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_decryption_profiles_request_response.go b/networkfirewall/list_decryption_profiles_request_response.go new file mode 100644 index 0000000000..8801df16c2 --- /dev/null +++ b/networkfirewall/list_decryption_profiles_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDecryptionProfilesRequest wrapper for the ListDecryptionProfiles operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListDecryptionProfiles.go.html to see an example of how to use ListDecryptionProfilesRequest. +type ListDecryptionProfilesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListDecryptionProfilesSortOrderEnum `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 ListDecryptionProfilesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListDecryptionProfilesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDecryptionProfilesRequest) 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 ListDecryptionProfilesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDecryptionProfilesRequest) 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 ListDecryptionProfilesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListDecryptionProfilesSortOrderEnum(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(GetListDecryptionProfilesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDecryptionProfilesSortByEnum(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(GetListDecryptionProfilesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDecryptionProfilesResponse wrapper for the ListDecryptionProfiles operation +type ListDecryptionProfilesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DecryptionProfileSummaryCollection instances + DecryptionProfileSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListDecryptionProfilesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDecryptionProfilesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDecryptionProfilesSortOrderEnum Enum with underlying type: string +type ListDecryptionProfilesSortOrderEnum string + +// Set of constants representing the allowable values for ListDecryptionProfilesSortOrderEnum +const ( + ListDecryptionProfilesSortOrderAsc ListDecryptionProfilesSortOrderEnum = "ASC" + ListDecryptionProfilesSortOrderDesc ListDecryptionProfilesSortOrderEnum = "DESC" +) + +var mappingListDecryptionProfilesSortOrderEnum = map[string]ListDecryptionProfilesSortOrderEnum{ + "ASC": ListDecryptionProfilesSortOrderAsc, + "DESC": ListDecryptionProfilesSortOrderDesc, +} + +var mappingListDecryptionProfilesSortOrderEnumLowerCase = map[string]ListDecryptionProfilesSortOrderEnum{ + "asc": ListDecryptionProfilesSortOrderAsc, + "desc": ListDecryptionProfilesSortOrderDesc, +} + +// GetListDecryptionProfilesSortOrderEnumValues Enumerates the set of values for ListDecryptionProfilesSortOrderEnum +func GetListDecryptionProfilesSortOrderEnumValues() []ListDecryptionProfilesSortOrderEnum { + values := make([]ListDecryptionProfilesSortOrderEnum, 0) + for _, v := range mappingListDecryptionProfilesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDecryptionProfilesSortOrderEnumStringValues Enumerates the set of values in String for ListDecryptionProfilesSortOrderEnum +func GetListDecryptionProfilesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDecryptionProfilesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDecryptionProfilesSortOrderEnum(val string) (ListDecryptionProfilesSortOrderEnum, bool) { + enum, ok := mappingListDecryptionProfilesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDecryptionProfilesSortByEnum Enum with underlying type: string +type ListDecryptionProfilesSortByEnum string + +// Set of constants representing the allowable values for ListDecryptionProfilesSortByEnum +const ( + ListDecryptionProfilesSortByTimecreated ListDecryptionProfilesSortByEnum = "timeCreated" + ListDecryptionProfilesSortByDisplayname ListDecryptionProfilesSortByEnum = "displayName" +) + +var mappingListDecryptionProfilesSortByEnum = map[string]ListDecryptionProfilesSortByEnum{ + "timeCreated": ListDecryptionProfilesSortByTimecreated, + "displayName": ListDecryptionProfilesSortByDisplayname, +} + +var mappingListDecryptionProfilesSortByEnumLowerCase = map[string]ListDecryptionProfilesSortByEnum{ + "timecreated": ListDecryptionProfilesSortByTimecreated, + "displayname": ListDecryptionProfilesSortByDisplayname, +} + +// GetListDecryptionProfilesSortByEnumValues Enumerates the set of values for ListDecryptionProfilesSortByEnum +func GetListDecryptionProfilesSortByEnumValues() []ListDecryptionProfilesSortByEnum { + values := make([]ListDecryptionProfilesSortByEnum, 0) + for _, v := range mappingListDecryptionProfilesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDecryptionProfilesSortByEnumStringValues Enumerates the set of values in String for ListDecryptionProfilesSortByEnum +func GetListDecryptionProfilesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListDecryptionProfilesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDecryptionProfilesSortByEnum(val string) (ListDecryptionProfilesSortByEnum, bool) { + enum, ok := mappingListDecryptionProfilesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_decryption_rules_request_response.go b/networkfirewall/list_decryption_rules_request_response.go new file mode 100644 index 0000000000..63989076e7 --- /dev/null +++ b/networkfirewall/list_decryption_rules_request_response.go @@ -0,0 +1,211 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDecryptionRulesRequest wrapper for the ListDecryptionRules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListDecryptionRules.go.html to see an example of how to use ListDecryptionRulesRequest. +type ListDecryptionRulesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListDecryptionRulesSortOrderEnum `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 ListDecryptionRulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique priority order for Decryption Rules in the network firewall policy. + DecryptionRulePriorityOrder *int `mandatory:"false" contributesTo:"query" name:"decryptionRulePriorityOrder"` + + // 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 ListDecryptionRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDecryptionRulesRequest) 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 ListDecryptionRulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDecryptionRulesRequest) 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 ListDecryptionRulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListDecryptionRulesSortOrderEnum(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(GetListDecryptionRulesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDecryptionRulesSortByEnum(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(GetListDecryptionRulesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDecryptionRulesResponse wrapper for the ListDecryptionRules operation +type ListDecryptionRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DecryptionRuleSummaryCollection instances + DecryptionRuleSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListDecryptionRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDecryptionRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDecryptionRulesSortOrderEnum Enum with underlying type: string +type ListDecryptionRulesSortOrderEnum string + +// Set of constants representing the allowable values for ListDecryptionRulesSortOrderEnum +const ( + ListDecryptionRulesSortOrderAsc ListDecryptionRulesSortOrderEnum = "ASC" + ListDecryptionRulesSortOrderDesc ListDecryptionRulesSortOrderEnum = "DESC" +) + +var mappingListDecryptionRulesSortOrderEnum = map[string]ListDecryptionRulesSortOrderEnum{ + "ASC": ListDecryptionRulesSortOrderAsc, + "DESC": ListDecryptionRulesSortOrderDesc, +} + +var mappingListDecryptionRulesSortOrderEnumLowerCase = map[string]ListDecryptionRulesSortOrderEnum{ + "asc": ListDecryptionRulesSortOrderAsc, + "desc": ListDecryptionRulesSortOrderDesc, +} + +// GetListDecryptionRulesSortOrderEnumValues Enumerates the set of values for ListDecryptionRulesSortOrderEnum +func GetListDecryptionRulesSortOrderEnumValues() []ListDecryptionRulesSortOrderEnum { + values := make([]ListDecryptionRulesSortOrderEnum, 0) + for _, v := range mappingListDecryptionRulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDecryptionRulesSortOrderEnumStringValues Enumerates the set of values in String for ListDecryptionRulesSortOrderEnum +func GetListDecryptionRulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDecryptionRulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDecryptionRulesSortOrderEnum(val string) (ListDecryptionRulesSortOrderEnum, bool) { + enum, ok := mappingListDecryptionRulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDecryptionRulesSortByEnum Enum with underlying type: string +type ListDecryptionRulesSortByEnum string + +// Set of constants representing the allowable values for ListDecryptionRulesSortByEnum +const ( + ListDecryptionRulesSortByTimecreated ListDecryptionRulesSortByEnum = "timeCreated" + ListDecryptionRulesSortByDisplayname ListDecryptionRulesSortByEnum = "displayName" +) + +var mappingListDecryptionRulesSortByEnum = map[string]ListDecryptionRulesSortByEnum{ + "timeCreated": ListDecryptionRulesSortByTimecreated, + "displayName": ListDecryptionRulesSortByDisplayname, +} + +var mappingListDecryptionRulesSortByEnumLowerCase = map[string]ListDecryptionRulesSortByEnum{ + "timecreated": ListDecryptionRulesSortByTimecreated, + "displayname": ListDecryptionRulesSortByDisplayname, +} + +// GetListDecryptionRulesSortByEnumValues Enumerates the set of values for ListDecryptionRulesSortByEnum +func GetListDecryptionRulesSortByEnumValues() []ListDecryptionRulesSortByEnum { + values := make([]ListDecryptionRulesSortByEnum, 0) + for _, v := range mappingListDecryptionRulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDecryptionRulesSortByEnumStringValues Enumerates the set of values in String for ListDecryptionRulesSortByEnum +func GetListDecryptionRulesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListDecryptionRulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDecryptionRulesSortByEnum(val string) (ListDecryptionRulesSortByEnum, bool) { + enum, ok := mappingListDecryptionRulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_mapped_secrets_request_response.go b/networkfirewall/list_mapped_secrets_request_response.go new file mode 100644 index 0000000000..337daa5f7b --- /dev/null +++ b/networkfirewall/list_mapped_secrets_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListMappedSecretsRequest wrapper for the ListMappedSecrets operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListMappedSecrets.go.html to see an example of how to use ListMappedSecretsRequest. +type ListMappedSecretsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListMappedSecretsSortOrderEnum `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 ListMappedSecretsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListMappedSecretsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListMappedSecretsRequest) 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 ListMappedSecretsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMappedSecretsRequest) 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 ListMappedSecretsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListMappedSecretsSortOrderEnum(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(GetListMappedSecretsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListMappedSecretsSortByEnum(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(GetListMappedSecretsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListMappedSecretsResponse wrapper for the ListMappedSecrets operation +type ListMappedSecretsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of MappedSecretSummaryCollection instances + MappedSecretSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListMappedSecretsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListMappedSecretsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListMappedSecretsSortOrderEnum Enum with underlying type: string +type ListMappedSecretsSortOrderEnum string + +// Set of constants representing the allowable values for ListMappedSecretsSortOrderEnum +const ( + ListMappedSecretsSortOrderAsc ListMappedSecretsSortOrderEnum = "ASC" + ListMappedSecretsSortOrderDesc ListMappedSecretsSortOrderEnum = "DESC" +) + +var mappingListMappedSecretsSortOrderEnum = map[string]ListMappedSecretsSortOrderEnum{ + "ASC": ListMappedSecretsSortOrderAsc, + "DESC": ListMappedSecretsSortOrderDesc, +} + +var mappingListMappedSecretsSortOrderEnumLowerCase = map[string]ListMappedSecretsSortOrderEnum{ + "asc": ListMappedSecretsSortOrderAsc, + "desc": ListMappedSecretsSortOrderDesc, +} + +// GetListMappedSecretsSortOrderEnumValues Enumerates the set of values for ListMappedSecretsSortOrderEnum +func GetListMappedSecretsSortOrderEnumValues() []ListMappedSecretsSortOrderEnum { + values := make([]ListMappedSecretsSortOrderEnum, 0) + for _, v := range mappingListMappedSecretsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListMappedSecretsSortOrderEnumStringValues Enumerates the set of values in String for ListMappedSecretsSortOrderEnum +func GetListMappedSecretsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListMappedSecretsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMappedSecretsSortOrderEnum(val string) (ListMappedSecretsSortOrderEnum, bool) { + enum, ok := mappingListMappedSecretsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListMappedSecretsSortByEnum Enum with underlying type: string +type ListMappedSecretsSortByEnum string + +// Set of constants representing the allowable values for ListMappedSecretsSortByEnum +const ( + ListMappedSecretsSortByTimecreated ListMappedSecretsSortByEnum = "timeCreated" + ListMappedSecretsSortByDisplayname ListMappedSecretsSortByEnum = "displayName" +) + +var mappingListMappedSecretsSortByEnum = map[string]ListMappedSecretsSortByEnum{ + "timeCreated": ListMappedSecretsSortByTimecreated, + "displayName": ListMappedSecretsSortByDisplayname, +} + +var mappingListMappedSecretsSortByEnumLowerCase = map[string]ListMappedSecretsSortByEnum{ + "timecreated": ListMappedSecretsSortByTimecreated, + "displayname": ListMappedSecretsSortByDisplayname, +} + +// GetListMappedSecretsSortByEnumValues Enumerates the set of values for ListMappedSecretsSortByEnum +func GetListMappedSecretsSortByEnumValues() []ListMappedSecretsSortByEnum { + values := make([]ListMappedSecretsSortByEnum, 0) + for _, v := range mappingListMappedSecretsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListMappedSecretsSortByEnumStringValues Enumerates the set of values in String for ListMappedSecretsSortByEnum +func GetListMappedSecretsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListMappedSecretsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMappedSecretsSortByEnum(val string) (ListMappedSecretsSortByEnum, bool) { + enum, ok := mappingListMappedSecretsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_network_firewall_policies_request_response.go b/networkfirewall/list_network_firewall_policies_request_response.go index 13b5437d9a..da75a85b38 100644 --- a/networkfirewall/list_network_firewall_policies_request_response.go +++ b/networkfirewall/list_network_firewall_policies_request_response.go @@ -109,14 +109,10 @@ type ListNetworkFirewallPoliciesResponse struct { // 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. + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - // 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. + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` // For pagination of a list of items. When paging through a list, if this header appears in the response, @@ -141,30 +137,39 @@ type ListNetworkFirewallPoliciesLifecycleStateEnum string // Set of constants representing the allowable values for ListNetworkFirewallPoliciesLifecycleStateEnum const ( - ListNetworkFirewallPoliciesLifecycleStateCreating ListNetworkFirewallPoliciesLifecycleStateEnum = "CREATING" - ListNetworkFirewallPoliciesLifecycleStateUpdating ListNetworkFirewallPoliciesLifecycleStateEnum = "UPDATING" - ListNetworkFirewallPoliciesLifecycleStateActive ListNetworkFirewallPoliciesLifecycleStateEnum = "ACTIVE" - ListNetworkFirewallPoliciesLifecycleStateDeleting ListNetworkFirewallPoliciesLifecycleStateEnum = "DELETING" - ListNetworkFirewallPoliciesLifecycleStateDeleted ListNetworkFirewallPoliciesLifecycleStateEnum = "DELETED" - ListNetworkFirewallPoliciesLifecycleStateFailed ListNetworkFirewallPoliciesLifecycleStateEnum = "FAILED" + ListNetworkFirewallPoliciesLifecycleStateCreating ListNetworkFirewallPoliciesLifecycleStateEnum = "CREATING" + ListNetworkFirewallPoliciesLifecycleStateUpdating ListNetworkFirewallPoliciesLifecycleStateEnum = "UPDATING" + ListNetworkFirewallPoliciesLifecycleStateActive ListNetworkFirewallPoliciesLifecycleStateEnum = "ACTIVE" + ListNetworkFirewallPoliciesLifecycleStateDeleting ListNetworkFirewallPoliciesLifecycleStateEnum = "DELETING" + ListNetworkFirewallPoliciesLifecycleStateDeleted ListNetworkFirewallPoliciesLifecycleStateEnum = "DELETED" + ListNetworkFirewallPoliciesLifecycleStateFailed ListNetworkFirewallPoliciesLifecycleStateEnum = "FAILED" + ListNetworkFirewallPoliciesLifecycleStateNeedsAttention ListNetworkFirewallPoliciesLifecycleStateEnum = "NEEDS_ATTENTION" + ListNetworkFirewallPoliciesLifecycleStateAttaching ListNetworkFirewallPoliciesLifecycleStateEnum = "ATTACHING" + ListNetworkFirewallPoliciesLifecycleStateDetaching ListNetworkFirewallPoliciesLifecycleStateEnum = "DETACHING" ) var mappingListNetworkFirewallPoliciesLifecycleStateEnum = map[string]ListNetworkFirewallPoliciesLifecycleStateEnum{ - "CREATING": ListNetworkFirewallPoliciesLifecycleStateCreating, - "UPDATING": ListNetworkFirewallPoliciesLifecycleStateUpdating, - "ACTIVE": ListNetworkFirewallPoliciesLifecycleStateActive, - "DELETING": ListNetworkFirewallPoliciesLifecycleStateDeleting, - "DELETED": ListNetworkFirewallPoliciesLifecycleStateDeleted, - "FAILED": ListNetworkFirewallPoliciesLifecycleStateFailed, + "CREATING": ListNetworkFirewallPoliciesLifecycleStateCreating, + "UPDATING": ListNetworkFirewallPoliciesLifecycleStateUpdating, + "ACTIVE": ListNetworkFirewallPoliciesLifecycleStateActive, + "DELETING": ListNetworkFirewallPoliciesLifecycleStateDeleting, + "DELETED": ListNetworkFirewallPoliciesLifecycleStateDeleted, + "FAILED": ListNetworkFirewallPoliciesLifecycleStateFailed, + "NEEDS_ATTENTION": ListNetworkFirewallPoliciesLifecycleStateNeedsAttention, + "ATTACHING": ListNetworkFirewallPoliciesLifecycleStateAttaching, + "DETACHING": ListNetworkFirewallPoliciesLifecycleStateDetaching, } var mappingListNetworkFirewallPoliciesLifecycleStateEnumLowerCase = map[string]ListNetworkFirewallPoliciesLifecycleStateEnum{ - "creating": ListNetworkFirewallPoliciesLifecycleStateCreating, - "updating": ListNetworkFirewallPoliciesLifecycleStateUpdating, - "active": ListNetworkFirewallPoliciesLifecycleStateActive, - "deleting": ListNetworkFirewallPoliciesLifecycleStateDeleting, - "deleted": ListNetworkFirewallPoliciesLifecycleStateDeleted, - "failed": ListNetworkFirewallPoliciesLifecycleStateFailed, + "creating": ListNetworkFirewallPoliciesLifecycleStateCreating, + "updating": ListNetworkFirewallPoliciesLifecycleStateUpdating, + "active": ListNetworkFirewallPoliciesLifecycleStateActive, + "deleting": ListNetworkFirewallPoliciesLifecycleStateDeleting, + "deleted": ListNetworkFirewallPoliciesLifecycleStateDeleted, + "failed": ListNetworkFirewallPoliciesLifecycleStateFailed, + "needs_attention": ListNetworkFirewallPoliciesLifecycleStateNeedsAttention, + "attaching": ListNetworkFirewallPoliciesLifecycleStateAttaching, + "detaching": ListNetworkFirewallPoliciesLifecycleStateDetaching, } // GetListNetworkFirewallPoliciesLifecycleStateEnumValues Enumerates the set of values for ListNetworkFirewallPoliciesLifecycleStateEnum @@ -185,6 +190,9 @@ func GetListNetworkFirewallPoliciesLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "NEEDS_ATTENTION", + "ATTACHING", + "DETACHING", } } diff --git a/networkfirewall/list_network_firewalls_request_response.go b/networkfirewall/list_network_firewalls_request_response.go index b0f64b62b9..28ae73dbe0 100644 --- a/networkfirewall/list_network_firewalls_request_response.go +++ b/networkfirewall/list_network_firewalls_request_response.go @@ -117,14 +117,10 @@ type ListNetworkFirewallsResponse struct { // 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. + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - // 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. + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` // For pagination of a list of items. When paging through a list, if this header appears in the response, @@ -149,30 +145,39 @@ type ListNetworkFirewallsLifecycleStateEnum string // Set of constants representing the allowable values for ListNetworkFirewallsLifecycleStateEnum const ( - ListNetworkFirewallsLifecycleStateCreating ListNetworkFirewallsLifecycleStateEnum = "CREATING" - ListNetworkFirewallsLifecycleStateUpdating ListNetworkFirewallsLifecycleStateEnum = "UPDATING" - ListNetworkFirewallsLifecycleStateActive ListNetworkFirewallsLifecycleStateEnum = "ACTIVE" - ListNetworkFirewallsLifecycleStateDeleting ListNetworkFirewallsLifecycleStateEnum = "DELETING" - ListNetworkFirewallsLifecycleStateDeleted ListNetworkFirewallsLifecycleStateEnum = "DELETED" - ListNetworkFirewallsLifecycleStateFailed ListNetworkFirewallsLifecycleStateEnum = "FAILED" + ListNetworkFirewallsLifecycleStateCreating ListNetworkFirewallsLifecycleStateEnum = "CREATING" + ListNetworkFirewallsLifecycleStateUpdating ListNetworkFirewallsLifecycleStateEnum = "UPDATING" + ListNetworkFirewallsLifecycleStateActive ListNetworkFirewallsLifecycleStateEnum = "ACTIVE" + ListNetworkFirewallsLifecycleStateDeleting ListNetworkFirewallsLifecycleStateEnum = "DELETING" + ListNetworkFirewallsLifecycleStateDeleted ListNetworkFirewallsLifecycleStateEnum = "DELETED" + ListNetworkFirewallsLifecycleStateFailed ListNetworkFirewallsLifecycleStateEnum = "FAILED" + ListNetworkFirewallsLifecycleStateNeedsAttention ListNetworkFirewallsLifecycleStateEnum = "NEEDS_ATTENTION" + ListNetworkFirewallsLifecycleStateAttaching ListNetworkFirewallsLifecycleStateEnum = "ATTACHING" + ListNetworkFirewallsLifecycleStateDetaching ListNetworkFirewallsLifecycleStateEnum = "DETACHING" ) var mappingListNetworkFirewallsLifecycleStateEnum = map[string]ListNetworkFirewallsLifecycleStateEnum{ - "CREATING": ListNetworkFirewallsLifecycleStateCreating, - "UPDATING": ListNetworkFirewallsLifecycleStateUpdating, - "ACTIVE": ListNetworkFirewallsLifecycleStateActive, - "DELETING": ListNetworkFirewallsLifecycleStateDeleting, - "DELETED": ListNetworkFirewallsLifecycleStateDeleted, - "FAILED": ListNetworkFirewallsLifecycleStateFailed, + "CREATING": ListNetworkFirewallsLifecycleStateCreating, + "UPDATING": ListNetworkFirewallsLifecycleStateUpdating, + "ACTIVE": ListNetworkFirewallsLifecycleStateActive, + "DELETING": ListNetworkFirewallsLifecycleStateDeleting, + "DELETED": ListNetworkFirewallsLifecycleStateDeleted, + "FAILED": ListNetworkFirewallsLifecycleStateFailed, + "NEEDS_ATTENTION": ListNetworkFirewallsLifecycleStateNeedsAttention, + "ATTACHING": ListNetworkFirewallsLifecycleStateAttaching, + "DETACHING": ListNetworkFirewallsLifecycleStateDetaching, } var mappingListNetworkFirewallsLifecycleStateEnumLowerCase = map[string]ListNetworkFirewallsLifecycleStateEnum{ - "creating": ListNetworkFirewallsLifecycleStateCreating, - "updating": ListNetworkFirewallsLifecycleStateUpdating, - "active": ListNetworkFirewallsLifecycleStateActive, - "deleting": ListNetworkFirewallsLifecycleStateDeleting, - "deleted": ListNetworkFirewallsLifecycleStateDeleted, - "failed": ListNetworkFirewallsLifecycleStateFailed, + "creating": ListNetworkFirewallsLifecycleStateCreating, + "updating": ListNetworkFirewallsLifecycleStateUpdating, + "active": ListNetworkFirewallsLifecycleStateActive, + "deleting": ListNetworkFirewallsLifecycleStateDeleting, + "deleted": ListNetworkFirewallsLifecycleStateDeleted, + "failed": ListNetworkFirewallsLifecycleStateFailed, + "needs_attention": ListNetworkFirewallsLifecycleStateNeedsAttention, + "attaching": ListNetworkFirewallsLifecycleStateAttaching, + "detaching": ListNetworkFirewallsLifecycleStateDetaching, } // GetListNetworkFirewallsLifecycleStateEnumValues Enumerates the set of values for ListNetworkFirewallsLifecycleStateEnum @@ -193,6 +198,9 @@ func GetListNetworkFirewallsLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "NEEDS_ATTENTION", + "ATTACHING", + "DETACHING", } } diff --git a/networkfirewall/list_security_rules_request_response.go b/networkfirewall/list_security_rules_request_response.go new file mode 100644 index 0000000000..7aa0b51a07 --- /dev/null +++ b/networkfirewall/list_security_rules_request_response.go @@ -0,0 +1,211 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSecurityRulesRequest wrapper for the ListSecurityRules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListSecurityRules.go.html to see an example of how to use ListSecurityRulesRequest. +type ListSecurityRulesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListSecurityRulesSortOrderEnum `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 ListSecurityRulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique priority order for Security Rules in the network firewall policy. + SecurityRulePriorityOrder *int `mandatory:"false" contributesTo:"query" name:"securityRulePriorityOrder"` + + // 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 ListSecurityRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSecurityRulesRequest) 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 ListSecurityRulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSecurityRulesRequest) 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 ListSecurityRulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSecurityRulesSortOrderEnum(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(GetListSecurityRulesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListSecurityRulesSortByEnum(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(GetListSecurityRulesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSecurityRulesResponse wrapper for the ListSecurityRules operation +type ListSecurityRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SecurityRuleSummaryCollection instances + SecurityRuleSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListSecurityRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSecurityRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSecurityRulesSortOrderEnum Enum with underlying type: string +type ListSecurityRulesSortOrderEnum string + +// Set of constants representing the allowable values for ListSecurityRulesSortOrderEnum +const ( + ListSecurityRulesSortOrderAsc ListSecurityRulesSortOrderEnum = "ASC" + ListSecurityRulesSortOrderDesc ListSecurityRulesSortOrderEnum = "DESC" +) + +var mappingListSecurityRulesSortOrderEnum = map[string]ListSecurityRulesSortOrderEnum{ + "ASC": ListSecurityRulesSortOrderAsc, + "DESC": ListSecurityRulesSortOrderDesc, +} + +var mappingListSecurityRulesSortOrderEnumLowerCase = map[string]ListSecurityRulesSortOrderEnum{ + "asc": ListSecurityRulesSortOrderAsc, + "desc": ListSecurityRulesSortOrderDesc, +} + +// GetListSecurityRulesSortOrderEnumValues Enumerates the set of values for ListSecurityRulesSortOrderEnum +func GetListSecurityRulesSortOrderEnumValues() []ListSecurityRulesSortOrderEnum { + values := make([]ListSecurityRulesSortOrderEnum, 0) + for _, v := range mappingListSecurityRulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSecurityRulesSortOrderEnumStringValues Enumerates the set of values in String for ListSecurityRulesSortOrderEnum +func GetListSecurityRulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSecurityRulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSecurityRulesSortOrderEnum(val string) (ListSecurityRulesSortOrderEnum, bool) { + enum, ok := mappingListSecurityRulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSecurityRulesSortByEnum Enum with underlying type: string +type ListSecurityRulesSortByEnum string + +// Set of constants representing the allowable values for ListSecurityRulesSortByEnum +const ( + ListSecurityRulesSortByTimecreated ListSecurityRulesSortByEnum = "timeCreated" + ListSecurityRulesSortByDisplayname ListSecurityRulesSortByEnum = "displayName" +) + +var mappingListSecurityRulesSortByEnum = map[string]ListSecurityRulesSortByEnum{ + "timeCreated": ListSecurityRulesSortByTimecreated, + "displayName": ListSecurityRulesSortByDisplayname, +} + +var mappingListSecurityRulesSortByEnumLowerCase = map[string]ListSecurityRulesSortByEnum{ + "timecreated": ListSecurityRulesSortByTimecreated, + "displayname": ListSecurityRulesSortByDisplayname, +} + +// GetListSecurityRulesSortByEnumValues Enumerates the set of values for ListSecurityRulesSortByEnum +func GetListSecurityRulesSortByEnumValues() []ListSecurityRulesSortByEnum { + values := make([]ListSecurityRulesSortByEnum, 0) + for _, v := range mappingListSecurityRulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSecurityRulesSortByEnumStringValues Enumerates the set of values in String for ListSecurityRulesSortByEnum +func GetListSecurityRulesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListSecurityRulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSecurityRulesSortByEnum(val string) (ListSecurityRulesSortByEnum, bool) { + enum, ok := mappingListSecurityRulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_service_lists_request_response.go b/networkfirewall/list_service_lists_request_response.go new file mode 100644 index 0000000000..e4cf14ec62 --- /dev/null +++ b/networkfirewall/list_service_lists_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListServiceListsRequest wrapper for the ListServiceLists operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListServiceLists.go.html to see an example of how to use ListServiceListsRequest. +type ListServiceListsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListServiceListsSortOrderEnum `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 ListServiceListsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListServiceListsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServiceListsRequest) 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 ListServiceListsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServiceListsRequest) 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 ListServiceListsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListServiceListsSortOrderEnum(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(GetListServiceListsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListServiceListsSortByEnum(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(GetListServiceListsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListServiceListsResponse wrapper for the ListServiceLists operation +type ListServiceListsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ServiceListSummaryCollection instances + ServiceListSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListServiceListsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServiceListsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListServiceListsSortOrderEnum Enum with underlying type: string +type ListServiceListsSortOrderEnum string + +// Set of constants representing the allowable values for ListServiceListsSortOrderEnum +const ( + ListServiceListsSortOrderAsc ListServiceListsSortOrderEnum = "ASC" + ListServiceListsSortOrderDesc ListServiceListsSortOrderEnum = "DESC" +) + +var mappingListServiceListsSortOrderEnum = map[string]ListServiceListsSortOrderEnum{ + "ASC": ListServiceListsSortOrderAsc, + "DESC": ListServiceListsSortOrderDesc, +} + +var mappingListServiceListsSortOrderEnumLowerCase = map[string]ListServiceListsSortOrderEnum{ + "asc": ListServiceListsSortOrderAsc, + "desc": ListServiceListsSortOrderDesc, +} + +// GetListServiceListsSortOrderEnumValues Enumerates the set of values for ListServiceListsSortOrderEnum +func GetListServiceListsSortOrderEnumValues() []ListServiceListsSortOrderEnum { + values := make([]ListServiceListsSortOrderEnum, 0) + for _, v := range mappingListServiceListsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListServiceListsSortOrderEnumStringValues Enumerates the set of values in String for ListServiceListsSortOrderEnum +func GetListServiceListsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListServiceListsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceListsSortOrderEnum(val string) (ListServiceListsSortOrderEnum, bool) { + enum, ok := mappingListServiceListsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServiceListsSortByEnum Enum with underlying type: string +type ListServiceListsSortByEnum string + +// Set of constants representing the allowable values for ListServiceListsSortByEnum +const ( + ListServiceListsSortByTimecreated ListServiceListsSortByEnum = "timeCreated" + ListServiceListsSortByDisplayname ListServiceListsSortByEnum = "displayName" +) + +var mappingListServiceListsSortByEnum = map[string]ListServiceListsSortByEnum{ + "timeCreated": ListServiceListsSortByTimecreated, + "displayName": ListServiceListsSortByDisplayname, +} + +var mappingListServiceListsSortByEnumLowerCase = map[string]ListServiceListsSortByEnum{ + "timecreated": ListServiceListsSortByTimecreated, + "displayname": ListServiceListsSortByDisplayname, +} + +// GetListServiceListsSortByEnumValues Enumerates the set of values for ListServiceListsSortByEnum +func GetListServiceListsSortByEnumValues() []ListServiceListsSortByEnum { + values := make([]ListServiceListsSortByEnum, 0) + for _, v := range mappingListServiceListsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListServiceListsSortByEnumStringValues Enumerates the set of values in String for ListServiceListsSortByEnum +func GetListServiceListsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListServiceListsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceListsSortByEnum(val string) (ListServiceListsSortByEnum, bool) { + enum, ok := mappingListServiceListsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_services_request_response.go b/networkfirewall/list_services_request_response.go new file mode 100644 index 0000000000..cbc372856f --- /dev/null +++ b/networkfirewall/list_services_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListServicesRequest wrapper for the ListServices operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListServices.go.html to see an example of how to use ListServicesRequest. +type ListServicesRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListServicesSortOrderEnum `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 ListServicesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListServicesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServicesRequest) 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 ListServicesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServicesRequest) 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 ListServicesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListServicesSortOrderEnum(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(GetListServicesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListServicesSortByEnum(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(GetListServicesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListServicesResponse wrapper for the ListServices operation +type ListServicesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ServiceSummaryCollection instances + ServiceSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListServicesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServicesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListServicesSortOrderEnum Enum with underlying type: string +type ListServicesSortOrderEnum string + +// Set of constants representing the allowable values for ListServicesSortOrderEnum +const ( + ListServicesSortOrderAsc ListServicesSortOrderEnum = "ASC" + ListServicesSortOrderDesc ListServicesSortOrderEnum = "DESC" +) + +var mappingListServicesSortOrderEnum = map[string]ListServicesSortOrderEnum{ + "ASC": ListServicesSortOrderAsc, + "DESC": ListServicesSortOrderDesc, +} + +var mappingListServicesSortOrderEnumLowerCase = map[string]ListServicesSortOrderEnum{ + "asc": ListServicesSortOrderAsc, + "desc": ListServicesSortOrderDesc, +} + +// GetListServicesSortOrderEnumValues Enumerates the set of values for ListServicesSortOrderEnum +func GetListServicesSortOrderEnumValues() []ListServicesSortOrderEnum { + values := make([]ListServicesSortOrderEnum, 0) + for _, v := range mappingListServicesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListServicesSortOrderEnumStringValues Enumerates the set of values in String for ListServicesSortOrderEnum +func GetListServicesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListServicesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServicesSortOrderEnum(val string) (ListServicesSortOrderEnum, bool) { + enum, ok := mappingListServicesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServicesSortByEnum Enum with underlying type: string +type ListServicesSortByEnum string + +// Set of constants representing the allowable values for ListServicesSortByEnum +const ( + ListServicesSortByTimecreated ListServicesSortByEnum = "timeCreated" + ListServicesSortByDisplayname ListServicesSortByEnum = "displayName" +) + +var mappingListServicesSortByEnum = map[string]ListServicesSortByEnum{ + "timeCreated": ListServicesSortByTimecreated, + "displayName": ListServicesSortByDisplayname, +} + +var mappingListServicesSortByEnumLowerCase = map[string]ListServicesSortByEnum{ + "timecreated": ListServicesSortByTimecreated, + "displayname": ListServicesSortByDisplayname, +} + +// GetListServicesSortByEnumValues Enumerates the set of values for ListServicesSortByEnum +func GetListServicesSortByEnumValues() []ListServicesSortByEnum { + values := make([]ListServicesSortByEnum, 0) + for _, v := range mappingListServicesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListServicesSortByEnumStringValues Enumerates the set of values in String for ListServicesSortByEnum +func GetListServicesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListServicesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServicesSortByEnum(val string) (ListServicesSortByEnum, bool) { + enum, ok := mappingListServicesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_url_lists_request_response.go b/networkfirewall/list_url_lists_request_response.go new file mode 100644 index 0000000000..3fc22f1800 --- /dev/null +++ b/networkfirewall/list_url_lists_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListUrlListsRequest wrapper for the ListUrlLists operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListUrlLists.go.html to see an example of how to use ListUrlListsRequest. +type ListUrlListsRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // 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` or `opc-prev-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 ListUrlListsSortOrderEnum `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 ListUrlListsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListUrlListsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListUrlListsRequest) 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 ListUrlListsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListUrlListsRequest) 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 ListUrlListsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListUrlListsSortOrderEnum(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(GetListUrlListsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListUrlListsSortByEnum(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(GetListUrlListsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListUrlListsResponse wrapper for the ListUrlLists operation +type ListUrlListsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of UrlListSummaryCollection instances + UrlListSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` +} + +func (response ListUrlListsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListUrlListsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListUrlListsSortOrderEnum Enum with underlying type: string +type ListUrlListsSortOrderEnum string + +// Set of constants representing the allowable values for ListUrlListsSortOrderEnum +const ( + ListUrlListsSortOrderAsc ListUrlListsSortOrderEnum = "ASC" + ListUrlListsSortOrderDesc ListUrlListsSortOrderEnum = "DESC" +) + +var mappingListUrlListsSortOrderEnum = map[string]ListUrlListsSortOrderEnum{ + "ASC": ListUrlListsSortOrderAsc, + "DESC": ListUrlListsSortOrderDesc, +} + +var mappingListUrlListsSortOrderEnumLowerCase = map[string]ListUrlListsSortOrderEnum{ + "asc": ListUrlListsSortOrderAsc, + "desc": ListUrlListsSortOrderDesc, +} + +// GetListUrlListsSortOrderEnumValues Enumerates the set of values for ListUrlListsSortOrderEnum +func GetListUrlListsSortOrderEnumValues() []ListUrlListsSortOrderEnum { + values := make([]ListUrlListsSortOrderEnum, 0) + for _, v := range mappingListUrlListsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListUrlListsSortOrderEnumStringValues Enumerates the set of values in String for ListUrlListsSortOrderEnum +func GetListUrlListsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListUrlListsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListUrlListsSortOrderEnum(val string) (ListUrlListsSortOrderEnum, bool) { + enum, ok := mappingListUrlListsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListUrlListsSortByEnum Enum with underlying type: string +type ListUrlListsSortByEnum string + +// Set of constants representing the allowable values for ListUrlListsSortByEnum +const ( + ListUrlListsSortByTimecreated ListUrlListsSortByEnum = "timeCreated" + ListUrlListsSortByDisplayname ListUrlListsSortByEnum = "displayName" +) + +var mappingListUrlListsSortByEnum = map[string]ListUrlListsSortByEnum{ + "timeCreated": ListUrlListsSortByTimecreated, + "displayName": ListUrlListsSortByDisplayname, +} + +var mappingListUrlListsSortByEnumLowerCase = map[string]ListUrlListsSortByEnum{ + "timecreated": ListUrlListsSortByTimecreated, + "displayname": ListUrlListsSortByDisplayname, +} + +// GetListUrlListsSortByEnumValues Enumerates the set of values for ListUrlListsSortByEnum +func GetListUrlListsSortByEnumValues() []ListUrlListsSortByEnum { + values := make([]ListUrlListsSortByEnum, 0) + for _, v := range mappingListUrlListsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListUrlListsSortByEnumStringValues Enumerates the set of values in String for ListUrlListsSortByEnum +func GetListUrlListsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListUrlListsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListUrlListsSortByEnum(val string) (ListUrlListsSortByEnum, bool) { + enum, ok := mappingListUrlListsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/list_work_request_errors_request_response.go b/networkfirewall/list_work_request_errors_request_response.go index 93332de45a..a85c22ccbe 100644 --- a/networkfirewall/list_work_request_errors_request_response.go +++ b/networkfirewall/list_work_request_errors_request_response.go @@ -93,18 +93,14 @@ type ListWorkRequestErrorsResponse struct { // A list of WorkRequestErrorCollection instances WorkRequestErrorCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // 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. + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` } diff --git a/networkfirewall/list_work_request_logs_request_response.go b/networkfirewall/list_work_request_logs_request_response.go index d3826d1df7..af051ad283 100644 --- a/networkfirewall/list_work_request_logs_request_response.go +++ b/networkfirewall/list_work_request_logs_request_response.go @@ -93,18 +93,14 @@ type ListWorkRequestLogsResponse struct { // A list of WorkRequestLogEntryCollection instances WorkRequestLogEntryCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // 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. + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` } diff --git a/networkfirewall/list_work_requests_request_response.go b/networkfirewall/list_work_requests_request_response.go index 228b25d77e..9aeaa5361f 100644 --- a/networkfirewall/list_work_requests_request_response.go +++ b/networkfirewall/list_work_requests_request_response.go @@ -109,14 +109,10 @@ type ListWorkRequestsResponse struct { // 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. + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - // 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. + // For list pagination. When this header appears in the response, previous pages of results exist. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` } @@ -134,33 +130,36 @@ type ListWorkRequestsStatusEnum string // Set of constants representing the allowable values for ListWorkRequestsStatusEnum const ( - ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" - ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" - ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" - ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" - ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" - ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" - ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" ) var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ - "ACCEPTED": ListWorkRequestsStatusAccepted, - "IN_PROGRESS": ListWorkRequestsStatusInProgress, - "WAITING": ListWorkRequestsStatusWaiting, - "FAILED": ListWorkRequestsStatusFailed, - "SUCCEEDED": ListWorkRequestsStatusSucceeded, - "CANCELING": ListWorkRequestsStatusCanceling, - "CANCELED": ListWorkRequestsStatusCanceled, + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, } var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ - "accepted": ListWorkRequestsStatusAccepted, - "in_progress": ListWorkRequestsStatusInProgress, - "waiting": ListWorkRequestsStatusWaiting, - "failed": ListWorkRequestsStatusFailed, - "succeeded": ListWorkRequestsStatusSucceeded, - "canceling": ListWorkRequestsStatusCanceling, - "canceled": ListWorkRequestsStatusCanceled, + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "needs_attention": ListWorkRequestsStatusNeedsAttention, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, } // GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum @@ -180,6 +179,7 @@ func GetListWorkRequestsStatusEnumStringValues() []string { "WAITING", "FAILED", "SUCCEEDED", + "NEEDS_ATTENTION", "CANCELING", "CANCELED", } diff --git a/networkfirewall/mapped_secret.go b/networkfirewall/mapped_secret.go index 8884a35b21..8c0008bcbf 100644 --- a/networkfirewall/mapped_secret.go +++ b/networkfirewall/mapped_secret.go @@ -19,16 +19,24 @@ import ( // MappedSecret Mapped secret used on the firewall policy rules. type MappedSecret interface { + // Name of the secret. + GetName() *string + // Type of the secrets mapped based on the policy. // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. - GetType() MappedSecretTypeEnum + GetType() InspectionTypeEnum + + // OCID of the Network Firewall Policy this Mapped Secret belongs to. + GetParentResourceId() *string } type mappedsecret struct { - JsonData []byte - Type MappedSecretTypeEnum `mandatory:"true" json:"type"` - Source string `json:"source"` + JsonData []byte + Name *string `mandatory:"true" json:"name"` + Type InspectionTypeEnum `mandatory:"true" json:"type"` + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + Source string `json:"source"` } // UnmarshalJSON unmarshals json @@ -42,7 +50,9 @@ func (m *mappedsecret) UnmarshalJSON(data []byte) error { if err != nil { return err } + m.Name = s.Model.Name m.Type = s.Model.Type + m.ParentResourceId = s.Model.ParentResourceId m.Source = s.Model.Source return err @@ -67,11 +77,21 @@ func (m *mappedsecret) UnmarshalPolymorphicJSON(data []byte) (interface{}, error } } +// GetName returns Name +func (m mappedsecret) GetName() *string { + return m.Name +} + // GetType returns Type -func (m mappedsecret) GetType() MappedSecretTypeEnum { +func (m mappedsecret) GetType() InspectionTypeEnum { return m.Type } +// GetParentResourceId returns ParentResourceId +func (m mappedsecret) GetParentResourceId() *string { + return m.ParentResourceId +} + func (m mappedsecret) String() string { return common.PointerString(m) } @@ -81,8 +101,8 @@ func (m mappedsecret) String() string { // Not recommended for calling this function directly func (m mappedsecret) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingMappedSecretTypeEnum(string(m.Type)); !ok && m.Type != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetMappedSecretTypeEnumStringValues(), ","))) + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) } if len(errMessage) > 0 { @@ -90,45 +110,3 @@ func (m mappedsecret) ValidateEnumValue() (bool, error) { } return false, nil } - -// MappedSecretTypeEnum Enum with underlying type: string -type MappedSecretTypeEnum string - -// Set of constants representing the allowable values for MappedSecretTypeEnum -const ( - MappedSecretTypeInboundInspection MappedSecretTypeEnum = "SSL_INBOUND_INSPECTION" - MappedSecretTypeForwardProxy MappedSecretTypeEnum = "SSL_FORWARD_PROXY" -) - -var mappingMappedSecretTypeEnum = map[string]MappedSecretTypeEnum{ - "SSL_INBOUND_INSPECTION": MappedSecretTypeInboundInspection, - "SSL_FORWARD_PROXY": MappedSecretTypeForwardProxy, -} - -var mappingMappedSecretTypeEnumLowerCase = map[string]MappedSecretTypeEnum{ - "ssl_inbound_inspection": MappedSecretTypeInboundInspection, - "ssl_forward_proxy": MappedSecretTypeForwardProxy, -} - -// GetMappedSecretTypeEnumValues Enumerates the set of values for MappedSecretTypeEnum -func GetMappedSecretTypeEnumValues() []MappedSecretTypeEnum { - values := make([]MappedSecretTypeEnum, 0) - for _, v := range mappingMappedSecretTypeEnum { - values = append(values, v) - } - return values -} - -// GetMappedSecretTypeEnumStringValues Enumerates the set of values in String for MappedSecretTypeEnum -func GetMappedSecretTypeEnumStringValues() []string { - return []string{ - "SSL_INBOUND_INSPECTION", - "SSL_FORWARD_PROXY", - } -} - -// GetMappingMappedSecretTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingMappedSecretTypeEnum(val string) (MappedSecretTypeEnum, bool) { - enum, ok := mappingMappedSecretTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/networkfirewall/mapped_secret_summary.go b/networkfirewall/mapped_secret_summary.go new file mode 100644 index 0000000000..0c3af2e28b --- /dev/null +++ b/networkfirewall/mapped_secret_summary.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MappedSecretSummary Mapped secret used on the firewall policy rules. +type MappedSecretSummary struct { + + // Name of the secret. + Name *string `mandatory:"true" json:"name"` + + // Source of the secrets, where the secrets are stored. + Source *string `mandatory:"true" json:"source"` + + // Type of the secrets mapped based on the policy. + // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. + // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. + Type InspectionTypeEnum `mandatory:"true" json:"type"` + + // OCID of the Network Firewall Policy this mapped secret belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m MappedSecretSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MappedSecretSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/mapped_secret_summary_collection.go b/networkfirewall/mapped_secret_summary_collection.go new file mode 100644 index 0000000000..00a7d33ec8 --- /dev/null +++ b/networkfirewall/mapped_secret_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MappedSecretSummaryCollection Collection of Mapped Secrets in the network firewall policy +type MappedSecretSummaryCollection struct { + + // Collection of Mapped Secrets. + Items []MappedSecretSummary `mandatory:"true" json:"items"` +} + +func (m MappedSecretSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MappedSecretSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/mapped_secret_type.go b/networkfirewall/mapped_secret_type.go new file mode 100644 index 0000000000..61e03627ca --- /dev/null +++ b/networkfirewall/mapped_secret_type.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// MappedSecretTypeEnum Enum with underlying type: string +type MappedSecretTypeEnum string + +// Set of constants representing the allowable values for MappedSecretTypeEnum +const ( + MappedSecretTypeOciVault MappedSecretTypeEnum = "OCI_VAULT" +) + +var mappingMappedSecretTypeEnum = map[string]MappedSecretTypeEnum{ + "OCI_VAULT": MappedSecretTypeOciVault, +} + +var mappingMappedSecretTypeEnumLowerCase = map[string]MappedSecretTypeEnum{ + "oci_vault": MappedSecretTypeOciVault, +} + +// GetMappedSecretTypeEnumValues Enumerates the set of values for MappedSecretTypeEnum +func GetMappedSecretTypeEnumValues() []MappedSecretTypeEnum { + values := make([]MappedSecretTypeEnum, 0) + for _, v := range mappingMappedSecretTypeEnum { + values = append(values, v) + } + return values +} + +// GetMappedSecretTypeEnumStringValues Enumerates the set of values in String for MappedSecretTypeEnum +func GetMappedSecretTypeEnumStringValues() []string { + return []string{ + "OCI_VAULT", + } +} + +// GetMappingMappedSecretTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingMappedSecretTypeEnum(val string) (MappedSecretTypeEnum, bool) { + enum, ok := mappingMappedSecretTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/migrate_network_firewall_policy_request_response.go b/networkfirewall/migrate_network_firewall_policy_request_response.go new file mode 100644 index 0000000000..894a6bb17e --- /dev/null +++ b/networkfirewall/migrate_network_firewall_policy_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 networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// MigrateNetworkFirewallPolicyRequest wrapper for the MigrateNetworkFirewallPolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/MigrateNetworkFirewallPolicy.go.html to see an example of how to use MigrateNetworkFirewallPolicyRequest. +type MigrateNetworkFirewallPolicyRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request MigrateNetworkFirewallPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request MigrateNetworkFirewallPolicyRequest) 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 MigrateNetworkFirewallPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request MigrateNetworkFirewallPolicyRequest) 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 MigrateNetworkFirewallPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MigrateNetworkFirewallPolicyResponse wrapper for the MigrateNetworkFirewallPolicy operation +type MigrateNetworkFirewallPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response MigrateNetworkFirewallPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response MigrateNetworkFirewallPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/network_firewall.go b/networkfirewall/network_firewall.go index d3900dad47..9dc3f94582 100644 --- a/networkfirewall/network_firewall.go +++ b/networkfirewall/network_firewall.go @@ -15,7 +15,7 @@ import ( "strings" ) -// NetworkFirewall Description of Network Firewall. +// NetworkFirewall A network firewall is a security resource that exists in a subnet of your choice and controls incoming and outgoing network traffic based on a set of security rules. Each firewall is associated with a policy. Traffic is routed to and from the firewall from resources such as internet gateways and dynamic routing gateways (DRGs). For more information, see Overview of Network Firewall (https://docs.cloud.oracle.com/iaas/Content/network-firewall/overview.htm) type NetworkFirewall struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Network Firewall resource. @@ -33,23 +33,25 @@ type NetworkFirewall struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Network Firewall Policy. NetworkFirewallPolicyId *string `mandatory:"true" json:"networkFirewallPolicyId"` - // The time instant at which the Network Firewall was created in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // The time at which the Network Firewall was created in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The time instant at which the Network Firewall was updated in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // The time at which the Network Firewall was updated in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). // Example: `2016-08-25T21:10:29.600Z` TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` // The current state of the Network Firewall. LifecycleState LifecycleStateEnum `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"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` // IPv4 address for the Network Firewall. @@ -59,14 +61,14 @@ type NetworkFirewall struct { Ipv6Address *string `mandatory:"false" json:"ipv6Address"` // Availability Domain where Network Firewall instance is created. - // To get a list of availability domains for a tenancy, use ListAvailabilityDomains operation. + // To get a list of availability domains for a tenancy, use the ListAvailabilityDomains operation. // Example: `kIdk:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // An array of network security groups OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with the Network Firewall. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` - // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. + // A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in 'FAILED' state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` // Usage of system tag keys. These predefined keys are scoped to namespaces. diff --git a/networkfirewall/network_firewall_policy.go b/networkfirewall/network_firewall_policy.go index 4aa334e705..ce99723b48 100644 --- a/networkfirewall/network_firewall_policy.go +++ b/networkfirewall/network_firewall_policy.go @@ -10,7 +10,6 @@ package networkfirewall import ( - "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -39,52 +38,21 @@ type NetworkFirewallPolicy struct { // The current state of the Network Firewall Policy. LifecycleState LifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // To determine if any Network Firewall is associated with this Network Firewall Policy. - IsFirewallAttached *bool `mandatory:"true" json:"isFirewallAttached"` - - // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. - // Example: `{"bar-key": "value"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` // 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"` - // Map defining secrets of the policy. - // The value of an entry is a "mapped secret" consisting of a purpose and source. - // The associated key is the identifier by which the mapped secret is referenced. - MappedSecrets map[string]MappedSecret `mandatory:"false" json:"mappedSecrets"` - - // Map defining application lists of the policy. - // The value of an entry is a list of "applications", each consisting of a protocol identifier (such as TCP, UDP, or ICMP) and protocol-specific parameters (such as a port range). - // The associated key is the identifier by which the application list is referenced. - ApplicationLists map[string][]Application `mandatory:"false" json:"applicationLists"` - - // Map defining URL pattern lists of the policy. - // The value of an entry is a list of URL patterns. - // The associated key is the identifier by which the URL pattern list is referenced. - UrlLists map[string][]UrlPattern `mandatory:"false" json:"urlLists"` - - // Map defining IP address lists of the policy. - // The value of an entry is a list of IP addresses or prefixes in CIDR notation. - // The associated key is the identifier by which the IP address list is referenced. - IpAddressLists map[string][]string `mandatory:"false" json:"ipAddressLists"` - - // List of Security Rules defining the behavior of the policy. - // The first rule with a matching condition determines the action taken upon network traffic. - SecurityRules []SecurityRule `mandatory:"false" json:"securityRules"` - - // List of Decryption Rules defining the behavior of the policy. - // The first rule with a matching condition determines the action taken upon network traffic. - DecryptionRules []DecryptionRule `mandatory:"false" json:"decryptionRules"` - - // Map defining decryption profiles of the policy. - // The value of an entry is a decryption profile. - // The associated key is the identifier by which the decryption profile is referenced. - DecryptionProfiles map[string]DecryptionProfile `mandatory:"false" json:"decryptionProfiles"` + // Count of number of Network Firewall attached to the Policy. + AttachedNetworkFirewallCount *int `mandatory:"false" json:"attachedNetworkFirewallCount"` // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` @@ -109,92 +77,3 @@ func (m NetworkFirewallPolicy) ValidateEnumValue() (bool, error) { } return false, nil } - -// UnmarshalJSON unmarshals from json -func (m *NetworkFirewallPolicy) UnmarshalJSON(data []byte) (e error) { - model := struct { - LifecycleDetails *string `json:"lifecycleDetails"` - MappedSecrets map[string]mappedsecret `json:"mappedSecrets"` - ApplicationLists map[string][]Application `json:"applicationLists"` - UrlLists map[string][]UrlPattern `json:"urlLists"` - IpAddressLists map[string][]string `json:"ipAddressLists"` - SecurityRules []SecurityRule `json:"securityRules"` - DecryptionRules []DecryptionRule `json:"decryptionRules"` - DecryptionProfiles map[string]decryptionprofile `json:"decryptionProfiles"` - SystemTags map[string]map[string]interface{} `json:"systemTags"` - Id *string `json:"id"` - CompartmentId *string `json:"compartmentId"` - DisplayName *string `json:"displayName"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - LifecycleState LifecycleStateEnum `json:"lifecycleState"` - IsFirewallAttached *bool `json:"isFirewallAttached"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - }{} - - e = json.Unmarshal(data, &model) - if e != nil { - return - } - var nn interface{} - m.LifecycleDetails = model.LifecycleDetails - - m.MappedSecrets = make(map[string]MappedSecret) - for k, v := range model.MappedSecrets { - nn, e = v.UnmarshalPolymorphicJSON(v.JsonData) - if e != nil { - return e - } - if nn != nil { - m.MappedSecrets[k] = nn.(MappedSecret) - } else { - m.MappedSecrets[k] = nil - } - } - - m.ApplicationLists = model.ApplicationLists - - m.UrlLists = model.UrlLists - - m.IpAddressLists = model.IpAddressLists - - m.SecurityRules = make([]SecurityRule, len(model.SecurityRules)) - copy(m.SecurityRules, model.SecurityRules) - m.DecryptionRules = make([]DecryptionRule, len(model.DecryptionRules)) - copy(m.DecryptionRules, model.DecryptionRules) - m.DecryptionProfiles = make(map[string]DecryptionProfile) - for k, v := range model.DecryptionProfiles { - nn, e = v.UnmarshalPolymorphicJSON(v.JsonData) - if e != nil { - return e - } - if nn != nil { - m.DecryptionProfiles[k] = nn.(DecryptionProfile) - } else { - m.DecryptionProfiles[k] = nil - } - } - - m.SystemTags = model.SystemTags - - m.Id = model.Id - - m.CompartmentId = model.CompartmentId - - m.DisplayName = model.DisplayName - - m.TimeCreated = model.TimeCreated - - m.TimeUpdated = model.TimeUpdated - - m.LifecycleState = model.LifecycleState - - m.IsFirewallAttached = model.IsFirewallAttached - - m.FreeformTags = model.FreeformTags - - m.DefinedTags = model.DefinedTags - - return -} diff --git a/networkfirewall/network_firewall_policy_summary.go b/networkfirewall/network_firewall_policy_summary.go index 2f2a9ff4bb..0499be5fc9 100644 --- a/networkfirewall/network_firewall_policy_summary.go +++ b/networkfirewall/network_firewall_policy_summary.go @@ -34,12 +34,14 @@ type NetworkFirewallPolicySummary struct { // The current lifecycle state of the Network Firewall Policy. LifecycleState LifecycleStateEnum `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"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` // The time instant at which the Network Firewall Policy was updated in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). diff --git a/networkfirewall/network_firewall_summary.go b/networkfirewall/network_firewall_summary.go index 24336e9cf2..9098c9c4c2 100644 --- a/networkfirewall/network_firewall_summary.go +++ b/networkfirewall/network_firewall_summary.go @@ -40,12 +40,14 @@ type NetworkFirewallSummary struct { // The current state of the Network Firewall. LifecycleState LifecycleStateEnum `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"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` // Availability Domain where Network Firewall instance is created. diff --git a/networkfirewall/networkfirewall_client.go b/networkfirewall/networkfirewall_client.go index c1fa024004..e8a09ee4ce 100644 --- a/networkfirewall/networkfirewall_client.go +++ b/networkfirewall/networkfirewall_client.go @@ -60,7 +60,7 @@ func newNetworkFirewallClientFromBaseClient(baseClient common.BaseClient, config common.ConfigCircuitBreakerFromGlobalVar(&baseClient) client = NetworkFirewallClient{BaseClient: baseClient} - client.BasePath = "20211001" + client.BasePath = "20230501" err = client.setConfigurationProvider(configProvider) return } @@ -91,13 +91,13 @@ func (client *NetworkFirewallClient) ConfigurationProvider() *common.Configurati return client.config } -// CancelWorkRequest Cancel work request with the given ID. +// ApplyNetworkFirewallPolicy Applies the candidate version of the NetworkFirewallPolicy resource. When provided, If-Match is checked against ETag values of the resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequest API. -// A default retry strategy applies to this operation CancelWorkRequest() -func (client NetworkFirewallClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ApplyNetworkFirewallPolicy.go.html to see an example of how to use ApplyNetworkFirewallPolicy API. +// A default retry strategy applies to this operation ApplyNetworkFirewallPolicy() +func (client NetworkFirewallClient) ApplyNetworkFirewallPolicy(ctx context.Context, request ApplyNetworkFirewallPolicyRequest) (response ApplyNetworkFirewallPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -106,42 +106,47 @@ func (client NetworkFirewallClient) CancelWorkRequest(ctx context.Context, reque if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.cancelWorkRequest, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.applyNetworkFirewallPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CancelWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ApplyNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CancelWorkRequestResponse{} + response = ApplyNetworkFirewallPolicyResponse{} } } return } - if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + if convertedResponse, ok := ociResponse.(ApplyNetworkFirewallPolicyResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + err = fmt.Errorf("failed to convert OCIResponse into ApplyNetworkFirewallPolicyResponse") } return } -// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// applyNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) applyNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/actions/applyPolicy", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CancelWorkRequestResponse + var response ApplyNetworkFirewallPolicyResponse 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/network-firewall/20211001/WorkRequest/CancelWorkRequest" - err = common.PostProcessServiceError(err, "NetworkFirewall", "CancelWorkRequest", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/NetworkFirewallPolicy/ApplyNetworkFirewallPolicy" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ApplyNetworkFirewallPolicy", apiReferenceLink) return response, err } @@ -149,13 +154,13 @@ func (client NetworkFirewallClient) cancelWorkRequest(ctx context.Context, reque return response, err } -// ChangeNetworkFirewallCompartment Moves a NetworkFirewall resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// BulkUploadAddressLists Creates a new Address Lists at bulk for the Network Firewall Policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ChangeNetworkFirewallCompartment.go.html to see an example of how to use ChangeNetworkFirewallCompartment API. -// A default retry strategy applies to this operation ChangeNetworkFirewallCompartment() -func (client NetworkFirewallClient) ChangeNetworkFirewallCompartment(ctx context.Context, request ChangeNetworkFirewallCompartmentRequest) (response ChangeNetworkFirewallCompartmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadAddressLists.go.html to see an example of how to use BulkUploadAddressLists API. +// A default retry strategy applies to this operation BulkUploadAddressLists() +func (client NetworkFirewallClient) BulkUploadAddressLists(ctx context.Context, request BulkUploadAddressListsRequest) (response BulkUploadAddressListsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -164,42 +169,47 @@ func (client NetworkFirewallClient) ChangeNetworkFirewallCompartment(ctx context if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.changeNetworkFirewallCompartment, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.bulkUploadAddressLists, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ChangeNetworkFirewallCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = BulkUploadAddressListsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ChangeNetworkFirewallCompartmentResponse{} + response = BulkUploadAddressListsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ChangeNetworkFirewallCompartmentResponse); ok { + if convertedResponse, ok := ociResponse.(BulkUploadAddressListsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ChangeNetworkFirewallCompartmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadAddressListsResponse") } return } -// changeNetworkFirewallCompartment implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) changeNetworkFirewallCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// bulkUploadAddressLists implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadAddressLists(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewalls/{networkFirewallId}/actions/changeCompartment", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/addressLists/actions/bulkUpload", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ChangeNetworkFirewallCompartmentResponse + var response BulkUploadAddressListsResponse 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/network-firewall/20211001/NetworkFirewall/ChangeNetworkFirewallCompartment" - err = common.PostProcessServiceError(err, "NetworkFirewall", "ChangeNetworkFirewallCompartment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/AddressList/BulkUploadAddressLists" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadAddressLists", apiReferenceLink) return response, err } @@ -207,13 +217,13 @@ func (client NetworkFirewallClient) changeNetworkFirewallCompartment(ctx context return response, err } -// ChangeNetworkFirewallPolicyCompartment Moves a NetworkFirewallPolicy resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// BulkUploadApplicationGroups Creates a new Application Group at bulk for the Network Firewall Policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ChangeNetworkFirewallPolicyCompartment.go.html to see an example of how to use ChangeNetworkFirewallPolicyCompartment API. -// A default retry strategy applies to this operation ChangeNetworkFirewallPolicyCompartment() -func (client NetworkFirewallClient) ChangeNetworkFirewallPolicyCompartment(ctx context.Context, request ChangeNetworkFirewallPolicyCompartmentRequest) (response ChangeNetworkFirewallPolicyCompartmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadApplicationGroups.go.html to see an example of how to use BulkUploadApplicationGroups API. +// A default retry strategy applies to this operation BulkUploadApplicationGroups() +func (client NetworkFirewallClient) BulkUploadApplicationGroups(ctx context.Context, request BulkUploadApplicationGroupsRequest) (response BulkUploadApplicationGroupsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -227,42 +237,3811 @@ func (client NetworkFirewallClient) ChangeNetworkFirewallPolicyCompartment(ctx c request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.changeNetworkFirewallPolicyCompartment, policy) + ociResponse, err = common.Retry(ctx, request, client.bulkUploadApplicationGroups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ChangeNetworkFirewallPolicyCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = BulkUploadApplicationGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ChangeNetworkFirewallPolicyCompartmentResponse{} + response = BulkUploadApplicationGroupsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ChangeNetworkFirewallPolicyCompartmentResponse); ok { + if convertedResponse, ok := ociResponse.(BulkUploadApplicationGroupsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ChangeNetworkFirewallPolicyCompartmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadApplicationGroupsResponse") } return } -// changeNetworkFirewallPolicyCompartment implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) changeNetworkFirewallPolicyCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// bulkUploadApplicationGroups implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadApplicationGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/applicationGroups/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadApplicationGroupsResponse + 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/network-firewall/20230501/ApplicationGroup/BulkUploadApplicationGroups" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadApplicationGroups", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadApplications Creates new Applications at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadApplications.go.html to see an example of how to use BulkUploadApplications API. +// A default retry strategy applies to this operation BulkUploadApplications() +func (client NetworkFirewallClient) BulkUploadApplications(ctx context.Context, request BulkUploadApplicationsRequest) (response BulkUploadApplicationsResponse, 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.bulkUploadApplications, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadApplicationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadApplicationsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadApplicationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadApplicationsResponse") + } + return +} + +// bulkUploadApplications implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadApplications(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/applications/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadApplicationsResponse + 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/network-firewall/20230501/Application/BulkUploadApplications" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadApplications", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadDecryptionProfiles Creates new Decryption Profiles at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadDecryptionProfiles.go.html to see an example of how to use BulkUploadDecryptionProfiles API. +// A default retry strategy applies to this operation BulkUploadDecryptionProfiles() +func (client NetworkFirewallClient) BulkUploadDecryptionProfiles(ctx context.Context, request BulkUploadDecryptionProfilesRequest) (response BulkUploadDecryptionProfilesResponse, 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.bulkUploadDecryptionProfiles, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadDecryptionProfilesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadDecryptionProfilesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadDecryptionProfilesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadDecryptionProfilesResponse") + } + return +} + +// bulkUploadDecryptionProfiles implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadDecryptionProfiles(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionProfiles/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadDecryptionProfilesResponse + 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/network-firewall/20230501/DecryptionProfile/BulkUploadDecryptionProfiles" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadDecryptionProfiles", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadDecryptionRules Creates Decryption Rules at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadDecryptionRules.go.html to see an example of how to use BulkUploadDecryptionRules API. +// A default retry strategy applies to this operation BulkUploadDecryptionRules() +func (client NetworkFirewallClient) BulkUploadDecryptionRules(ctx context.Context, request BulkUploadDecryptionRulesRequest) (response BulkUploadDecryptionRulesResponse, 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.bulkUploadDecryptionRules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadDecryptionRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadDecryptionRulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadDecryptionRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadDecryptionRulesResponse") + } + return +} + +// bulkUploadDecryptionRules implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadDecryptionRules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionRules/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadDecryptionRulesResponse + 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/network-firewall/20230501/DecryptionRule/BulkUploadDecryptionRules" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadDecryptionRules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadMappedSecrets Creates new Mapped Secrets at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadMappedSecrets.go.html to see an example of how to use BulkUploadMappedSecrets API. +// A default retry strategy applies to this operation BulkUploadMappedSecrets() +func (client NetworkFirewallClient) BulkUploadMappedSecrets(ctx context.Context, request BulkUploadMappedSecretsRequest) (response BulkUploadMappedSecretsResponse, 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.bulkUploadMappedSecrets, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadMappedSecretsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadMappedSecretsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadMappedSecretsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadMappedSecretsResponse") + } + return +} + +// bulkUploadMappedSecrets implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadMappedSecrets(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/mappedSecrets/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadMappedSecretsResponse + 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/network-firewall/20230501/MappedSecret/BulkUploadMappedSecrets" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadMappedSecrets", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadSecurityRules Creates a new Security Rule at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadSecurityRules.go.html to see an example of how to use BulkUploadSecurityRules API. +// A default retry strategy applies to this operation BulkUploadSecurityRules() +func (client NetworkFirewallClient) BulkUploadSecurityRules(ctx context.Context, request BulkUploadSecurityRulesRequest) (response BulkUploadSecurityRulesResponse, 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.bulkUploadSecurityRules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadSecurityRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadSecurityRulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadSecurityRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadSecurityRulesResponse") + } + return +} + +// bulkUploadSecurityRules implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadSecurityRules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/securityRules/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadSecurityRulesResponse + 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/network-firewall/20230501/SecurityRule/BulkUploadSecurityRules" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadSecurityRules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadServiceLists Creates a new Service List at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadServiceLists.go.html to see an example of how to use BulkUploadServiceLists API. +// A default retry strategy applies to this operation BulkUploadServiceLists() +func (client NetworkFirewallClient) BulkUploadServiceLists(ctx context.Context, request BulkUploadServiceListsRequest) (response BulkUploadServiceListsResponse, 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.bulkUploadServiceLists, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadServiceListsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadServiceListsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadServiceListsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadServiceListsResponse") + } + return +} + +// bulkUploadServiceLists implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadServiceLists(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/serviceLists/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadServiceListsResponse + 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/network-firewall/20230501/ServiceList/BulkUploadServiceLists" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadServiceLists", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadServices Creates new Services at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadServices.go.html to see an example of how to use BulkUploadServices API. +// A default retry strategy applies to this operation BulkUploadServices() +func (client NetworkFirewallClient) BulkUploadServices(ctx context.Context, request BulkUploadServicesRequest) (response BulkUploadServicesResponse, 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.bulkUploadServices, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadServicesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadServicesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadServicesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadServicesResponse") + } + return +} + +// bulkUploadServices implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadServices(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/services/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadServicesResponse + 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/network-firewall/20230501/Service/BulkUploadServices" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadServices", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// BulkUploadUrlLists Creates a new Url Lists at bulk for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/BulkUploadUrlLists.go.html to see an example of how to use BulkUploadUrlLists API. +// A default retry strategy applies to this operation BulkUploadUrlLists() +func (client NetworkFirewallClient) BulkUploadUrlLists(ctx context.Context, request BulkUploadUrlListsRequest) (response BulkUploadUrlListsResponse, 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.bulkUploadUrlLists, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BulkUploadUrlListsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BulkUploadUrlListsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BulkUploadUrlListsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BulkUploadUrlListsResponse") + } + return +} + +// bulkUploadUrlLists implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) bulkUploadUrlLists(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/urlLists/actions/bulkUpload", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BulkUploadUrlListsResponse + 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/network-firewall/20230501/UrlList/BulkUploadUrlLists" + err = common.PostProcessServiceError(err, "NetworkFirewall", "BulkUploadUrlLists", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CancelWorkRequest Cancel work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequest API. +// A default retry strategy applies to this operation CancelWorkRequest() +func (client NetworkFirewallClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, 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.cancelWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + } + return +} + +// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelWorkRequestResponse + 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/network-firewall/20230501/WorkRequest/CancelWorkRequest" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CancelWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeNetworkFirewallCompartment Moves a NetworkFirewall resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ChangeNetworkFirewallCompartment.go.html to see an example of how to use ChangeNetworkFirewallCompartment API. +// A default retry strategy applies to this operation ChangeNetworkFirewallCompartment() +func (client NetworkFirewallClient) ChangeNetworkFirewallCompartment(ctx context.Context, request ChangeNetworkFirewallCompartmentRequest) (response ChangeNetworkFirewallCompartmentResponse, 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.changeNetworkFirewallCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeNetworkFirewallCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeNetworkFirewallCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeNetworkFirewallCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeNetworkFirewallCompartmentResponse") + } + return +} + +// changeNetworkFirewallCompartment implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) changeNetworkFirewallCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewalls/{networkFirewallId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeNetworkFirewallCompartmentResponse + 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/network-firewall/20230501/NetworkFirewall/ChangeNetworkFirewallCompartment" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ChangeNetworkFirewallCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeNetworkFirewallPolicyCompartment Moves a NetworkFirewallPolicy resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ChangeNetworkFirewallPolicyCompartment.go.html to see an example of how to use ChangeNetworkFirewallPolicyCompartment API. +// A default retry strategy applies to this operation ChangeNetworkFirewallPolicyCompartment() +func (client NetworkFirewallClient) ChangeNetworkFirewallPolicyCompartment(ctx context.Context, request ChangeNetworkFirewallPolicyCompartmentRequest) (response ChangeNetworkFirewallPolicyCompartmentResponse, 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.changeNetworkFirewallPolicyCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeNetworkFirewallPolicyCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeNetworkFirewallPolicyCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeNetworkFirewallPolicyCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeNetworkFirewallPolicyCompartmentResponse") + } + return +} + +// changeNetworkFirewallPolicyCompartment implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) changeNetworkFirewallPolicyCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeNetworkFirewallPolicyCompartmentResponse + 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/network-firewall/20230501/NetworkFirewallPolicy/ChangeNetworkFirewallPolicyCompartment" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ChangeNetworkFirewallPolicyCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CloneNetworkFirewallPolicy Moves a NetworkFirewallPolicy resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CloneNetworkFirewallPolicy.go.html to see an example of how to use CloneNetworkFirewallPolicy API. +// A default retry strategy applies to this operation CloneNetworkFirewallPolicy() +func (client NetworkFirewallClient) CloneNetworkFirewallPolicy(ctx context.Context, request CloneNetworkFirewallPolicyRequest) (response CloneNetworkFirewallPolicyResponse, 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.cloneNetworkFirewallPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CloneNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CloneNetworkFirewallPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CloneNetworkFirewallPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CloneNetworkFirewallPolicyResponse") + } + return +} + +// cloneNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) cloneNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/actions/clonePolicy", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CloneNetworkFirewallPolicyResponse + 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/network-firewall/20230501/NetworkFirewallPolicy/CloneNetworkFirewallPolicy" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CloneNetworkFirewallPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAddressList Creates a new Address List for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateAddressList.go.html to see an example of how to use CreateAddressList API. +// A default retry strategy applies to this operation CreateAddressList() +func (client NetworkFirewallClient) CreateAddressList(ctx context.Context, request CreateAddressListRequest) (response CreateAddressListResponse, 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.createAddressList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateAddressListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateAddressListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateAddressListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAddressListResponse") + } + return +} + +// createAddressList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createAddressList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/addressLists", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateAddressListResponse + 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/network-firewall/20230501/AddressList/CreateAddressList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateAddressList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateApplication Creates a new Application for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateApplication.go.html to see an example of how to use CreateApplication API. +// A default retry strategy applies to this operation CreateApplication() +func (client NetworkFirewallClient) CreateApplication(ctx context.Context, request CreateApplicationRequest) (response CreateApplicationResponse, 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.createApplication, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateApplicationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateApplicationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateApplicationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateApplicationResponse") + } + return +} + +// createApplication implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createApplication(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/applications", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateApplicationResponse + 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/network-firewall/20230501/Application/CreateApplication" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateApplication", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &application{}) + return response, err +} + +// CreateApplicationGroup Creates a new ApplicationGroup for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateApplicationGroup.go.html to see an example of how to use CreateApplicationGroup API. +// A default retry strategy applies to this operation CreateApplicationGroup() +func (client NetworkFirewallClient) CreateApplicationGroup(ctx context.Context, request CreateApplicationGroupRequest) (response CreateApplicationGroupResponse, 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.createApplicationGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateApplicationGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateApplicationGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateApplicationGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateApplicationGroupResponse") + } + return +} + +// createApplicationGroup implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createApplicationGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/applicationGroups", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateApplicationGroupResponse + 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/network-firewall/20230501/ApplicationGroup/CreateApplicationGroup" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateApplicationGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateDecryptionProfile Creates a new Decryption Profile for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateDecryptionProfile.go.html to see an example of how to use CreateDecryptionProfile API. +// A default retry strategy applies to this operation CreateDecryptionProfile() +func (client NetworkFirewallClient) CreateDecryptionProfile(ctx context.Context, request CreateDecryptionProfileRequest) (response CreateDecryptionProfileResponse, 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.createDecryptionProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDecryptionProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDecryptionProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDecryptionProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDecryptionProfileResponse") + } + return +} + +// createDecryptionProfile implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createDecryptionProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionProfiles", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDecryptionProfileResponse + 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/network-firewall/20230501/DecryptionProfile/CreateDecryptionProfile" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateDecryptionProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &decryptionprofile{}) + return response, err +} + +// CreateDecryptionRule Creates a new Decryption Rule for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateDecryptionRule.go.html to see an example of how to use CreateDecryptionRule API. +// A default retry strategy applies to this operation CreateDecryptionRule() +func (client NetworkFirewallClient) CreateDecryptionRule(ctx context.Context, request CreateDecryptionRuleRequest) (response CreateDecryptionRuleResponse, 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.createDecryptionRule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDecryptionRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDecryptionRuleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDecryptionRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDecryptionRuleResponse") + } + return +} + +// createDecryptionRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createDecryptionRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionRules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDecryptionRuleResponse + 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/network-firewall/20230501/DecryptionRule/CreateDecryptionRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateDecryptionRule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateMappedSecret Creates a new Mapped Secret for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateMappedSecret.go.html to see an example of how to use CreateMappedSecret API. +// A default retry strategy applies to this operation CreateMappedSecret() +func (client NetworkFirewallClient) CreateMappedSecret(ctx context.Context, request CreateMappedSecretRequest) (response CreateMappedSecretResponse, 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.createMappedSecret, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateMappedSecretResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateMappedSecretResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateMappedSecretResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMappedSecretResponse") + } + return +} + +// createMappedSecret implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createMappedSecret(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/mappedSecrets", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateMappedSecretResponse + 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/network-firewall/20230501/MappedSecret/CreateMappedSecret" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateMappedSecret", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &mappedsecret{}) + return response, err +} + +// CreateNetworkFirewall Creates a new NetworkFirewall. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateNetworkFirewall.go.html to see an example of how to use CreateNetworkFirewall API. +// A default retry strategy applies to this operation CreateNetworkFirewall() +func (client NetworkFirewallClient) CreateNetworkFirewall(ctx context.Context, request CreateNetworkFirewallRequest) (response CreateNetworkFirewallResponse, 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.createNetworkFirewall, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateNetworkFirewallResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateNetworkFirewallResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNetworkFirewallResponse") + } + return +} + +// createNetworkFirewall implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewalls", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateNetworkFirewallResponse + 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/network-firewall/20230501/NetworkFirewall/CreateNetworkFirewall" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateNetworkFirewall", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateNetworkFirewallPolicy Creates a new Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateNetworkFirewallPolicy.go.html to see an example of how to use CreateNetworkFirewallPolicy API. +// A default retry strategy applies to this operation CreateNetworkFirewallPolicy() +func (client NetworkFirewallClient) CreateNetworkFirewallPolicy(ctx context.Context, request CreateNetworkFirewallPolicyRequest) (response CreateNetworkFirewallPolicyResponse, 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.createNetworkFirewallPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateNetworkFirewallPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateNetworkFirewallPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNetworkFirewallPolicyResponse") + } + return +} + +// createNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateNetworkFirewallPolicyResponse + 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/network-firewall/20230501/NetworkFirewallPolicy/CreateNetworkFirewallPolicy" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateNetworkFirewallPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateSecurityRule Creates a new Security Rule for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateSecurityRule.go.html to see an example of how to use CreateSecurityRule API. +// A default retry strategy applies to this operation CreateSecurityRule() +func (client NetworkFirewallClient) CreateSecurityRule(ctx context.Context, request CreateSecurityRuleRequest) (response CreateSecurityRuleResponse, 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.createSecurityRule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateSecurityRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateSecurityRuleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateSecurityRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSecurityRuleResponse") + } + return +} + +// createSecurityRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createSecurityRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/securityRules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateSecurityRuleResponse + 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/network-firewall/20230501/SecurityRule/CreateSecurityRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateSecurityRule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateService Creates a new Service for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateService.go.html to see an example of how to use CreateService API. +// A default retry strategy applies to this operation CreateService() +func (client NetworkFirewallClient) CreateService(ctx context.Context, request CreateServiceRequest) (response CreateServiceResponse, 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.createService, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateServiceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateServiceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateServiceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateServiceResponse") + } + return +} + +// createService implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createService(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/services", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateServiceResponse + 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/network-firewall/20230501/Service/CreateService" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateService", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &service{}) + return response, err +} + +// CreateServiceList Creates a new ServiceList for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateServiceList.go.html to see an example of how to use CreateServiceList API. +// A default retry strategy applies to this operation CreateServiceList() +func (client NetworkFirewallClient) CreateServiceList(ctx context.Context, request CreateServiceListRequest) (response CreateServiceListResponse, 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.createServiceList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateServiceListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateServiceListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateServiceListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateServiceListResponse") + } + return +} + +// createServiceList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createServiceList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/serviceLists", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateServiceListResponse + 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/network-firewall/20230501/ServiceList/CreateServiceList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateServiceList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateUrlList Creates a new Url List for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateUrlList.go.html to see an example of how to use CreateUrlList API. +// A default retry strategy applies to this operation CreateUrlList() +func (client NetworkFirewallClient) CreateUrlList(ctx context.Context, request CreateUrlListRequest) (response CreateUrlListResponse, 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.createUrlList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateUrlListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateUrlListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateUrlListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateUrlListResponse") + } + return +} + +// createUrlList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) createUrlList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/urlLists", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateUrlListResponse + 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/network-firewall/20230501/UrlList/CreateUrlList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateUrlList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAddressList Deletes a Address List resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteAddressList.go.html to see an example of how to use DeleteAddressList API. +// A default retry strategy applies to this operation DeleteAddressList() +func (client NetworkFirewallClient) DeleteAddressList(ctx context.Context, request DeleteAddressListRequest) (response DeleteAddressListResponse, 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.deleteAddressList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteAddressListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteAddressListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAddressListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAddressListResponse") + } + return +} + +// deleteAddressList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteAddressList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/addressLists/{addressListName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteAddressListResponse + 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/network-firewall/20230501/AddressList/DeleteAddressList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteAddressList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteApplication Deletes a Application resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteApplication.go.html to see an example of how to use DeleteApplication API. +// A default retry strategy applies to this operation DeleteApplication() +func (client NetworkFirewallClient) DeleteApplication(ctx context.Context, request DeleteApplicationRequest) (response DeleteApplicationResponse, 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.deleteApplication, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteApplicationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteApplicationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteApplicationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteApplicationResponse") + } + return +} + +// deleteApplication implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteApplication(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/applications/{applicationName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteApplicationResponse + 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/network-firewall/20230501/Application/DeleteApplication" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteApplication", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteApplicationGroup Deletes a ApplicationGroup resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteApplicationGroup.go.html to see an example of how to use DeleteApplicationGroup API. +// A default retry strategy applies to this operation DeleteApplicationGroup() +func (client NetworkFirewallClient) DeleteApplicationGroup(ctx context.Context, request DeleteApplicationGroupRequest) (response DeleteApplicationGroupResponse, 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.deleteApplicationGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteApplicationGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteApplicationGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteApplicationGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteApplicationGroupResponse") + } + return +} + +// deleteApplicationGroup implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteApplicationGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/applicationGroups/{applicationGroupName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteApplicationGroupResponse + 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/network-firewall/20230501/ApplicationGroup/DeleteApplicationGroup" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteApplicationGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteDecryptionProfile Deletes a Decryption Profile resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteDecryptionProfile.go.html to see an example of how to use DeleteDecryptionProfile API. +// A default retry strategy applies to this operation DeleteDecryptionProfile() +func (client NetworkFirewallClient) DeleteDecryptionProfile(ctx context.Context, request DeleteDecryptionProfileRequest) (response DeleteDecryptionProfileResponse, 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.deleteDecryptionProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDecryptionProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDecryptionProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDecryptionProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDecryptionProfileResponse") + } + return +} + +// deleteDecryptionProfile implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteDecryptionProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionProfiles/{decryptionProfileName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDecryptionProfileResponse + 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/network-firewall/20230501/DecryptionProfile/DeleteDecryptionProfile" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteDecryptionProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteDecryptionRule Deletes a Decryption Rule resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteDecryptionRule.go.html to see an example of how to use DeleteDecryptionRule API. +// A default retry strategy applies to this operation DeleteDecryptionRule() +func (client NetworkFirewallClient) DeleteDecryptionRule(ctx context.Context, request DeleteDecryptionRuleRequest) (response DeleteDecryptionRuleResponse, 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.deleteDecryptionRule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDecryptionRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDecryptionRuleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDecryptionRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDecryptionRuleResponse") + } + return +} + +// deleteDecryptionRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteDecryptionRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionRules/{decryptionRuleName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDecryptionRuleResponse + 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/network-firewall/20230501/DecryptionRule/DeleteDecryptionRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteDecryptionRule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteMappedSecret Deletes a Mapped Secret resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteMappedSecret.go.html to see an example of how to use DeleteMappedSecret API. +// A default retry strategy applies to this operation DeleteMappedSecret() +func (client NetworkFirewallClient) DeleteMappedSecret(ctx context.Context, request DeleteMappedSecretRequest) (response DeleteMappedSecretResponse, 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.deleteMappedSecret, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteMappedSecretResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteMappedSecretResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteMappedSecretResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMappedSecretResponse") + } + return +} + +// deleteMappedSecret implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteMappedSecret(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/mappedSecrets/{mappedSecretName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteMappedSecretResponse + 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/network-firewall/20230501/MappedSecret/DeleteMappedSecret" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteMappedSecret", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteNetworkFirewall Deletes a NetworkFirewall resource by identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteNetworkFirewall.go.html to see an example of how to use DeleteNetworkFirewall API. +// A default retry strategy applies to this operation DeleteNetworkFirewall() +func (client NetworkFirewallClient) DeleteNetworkFirewall(ctx context.Context, request DeleteNetworkFirewallRequest) (response DeleteNetworkFirewallResponse, 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.deleteNetworkFirewall, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteNetworkFirewallResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteNetworkFirewallResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteNetworkFirewallResponse") + } + return +} + +// deleteNetworkFirewall implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewalls/{networkFirewallId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteNetworkFirewallResponse + 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/network-firewall/20230501/NetworkFirewall/DeleteNetworkFirewall" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteNetworkFirewall", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteNetworkFirewallPolicy Deletes a NetworkFirewallPolicy resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteNetworkFirewallPolicy.go.html to see an example of how to use DeleteNetworkFirewallPolicy API. +// A default retry strategy applies to this operation DeleteNetworkFirewallPolicy() +func (client NetworkFirewallClient) DeleteNetworkFirewallPolicy(ctx context.Context, request DeleteNetworkFirewallPolicyRequest) (response DeleteNetworkFirewallPolicyResponse, 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.deleteNetworkFirewallPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteNetworkFirewallPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteNetworkFirewallPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteNetworkFirewallPolicyResponse") + } + return +} + +// deleteNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteNetworkFirewallPolicyResponse + 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/network-firewall/20230501/NetworkFirewallPolicy/DeleteNetworkFirewallPolicy" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteNetworkFirewallPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteSecurityRule Deletes a Security Rule resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteSecurityRule.go.html to see an example of how to use DeleteSecurityRule API. +// A default retry strategy applies to this operation DeleteSecurityRule() +func (client NetworkFirewallClient) DeleteSecurityRule(ctx context.Context, request DeleteSecurityRuleRequest) (response DeleteSecurityRuleResponse, 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.deleteSecurityRule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteSecurityRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteSecurityRuleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteSecurityRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSecurityRuleResponse") + } + return +} + +// deleteSecurityRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteSecurityRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/securityRules/{securityRuleName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteSecurityRuleResponse + 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/network-firewall/20230501/SecurityRule/DeleteSecurityRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteSecurityRule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteService Deletes a Service resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteService.go.html to see an example of how to use DeleteService API. +// A default retry strategy applies to this operation DeleteService() +func (client NetworkFirewallClient) DeleteService(ctx context.Context, request DeleteServiceRequest) (response DeleteServiceResponse, 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.deleteService, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteServiceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteServiceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteServiceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteServiceResponse") + } + return +} + +// deleteService implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteService(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/services/{serviceName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteServiceResponse + 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/network-firewall/20230501/Service/DeleteService" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteService", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteServiceList Deletes a ServiceList resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteServiceList.go.html to see an example of how to use DeleteServiceList API. +// A default retry strategy applies to this operation DeleteServiceList() +func (client NetworkFirewallClient) DeleteServiceList(ctx context.Context, request DeleteServiceListRequest) (response DeleteServiceListResponse, 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.deleteServiceList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteServiceListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteServiceListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteServiceListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteServiceListResponse") + } + return +} + +// deleteServiceList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteServiceList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/serviceLists/{serviceListName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteServiceListResponse + 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/network-firewall/20230501/ServiceList/DeleteServiceList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteServiceList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteUrlList Deletes a Url List resource with the given identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteUrlList.go.html to see an example of how to use DeleteUrlList API. +// A default retry strategy applies to this operation DeleteUrlList() +func (client NetworkFirewallClient) DeleteUrlList(ctx context.Context, request DeleteUrlListRequest) (response DeleteUrlListResponse, 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.deleteUrlList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteUrlListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteUrlListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteUrlListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteUrlListResponse") + } + return +} + +// deleteUrlList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) deleteUrlList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}/urlLists/{urlListName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteUrlListResponse + 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/network-firewall/20230501/UrlList/DeleteUrlList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteUrlList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAddressList Get Address List by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetAddressList.go.html to see an example of how to use GetAddressList API. +// A default retry strategy applies to this operation GetAddressList() +func (client NetworkFirewallClient) GetAddressList(ctx context.Context, request GetAddressListRequest) (response GetAddressListResponse, 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.getAddressList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetAddressListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetAddressListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetAddressListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAddressListResponse") + } + return +} + +// getAddressList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getAddressList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/addressLists/{addressListName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetAddressListResponse + 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/network-firewall/20230501/AddressList/GetAddressList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetAddressList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetApplication Get Application by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetApplication.go.html to see an example of how to use GetApplication API. +// A default retry strategy applies to this operation GetApplication() +func (client NetworkFirewallClient) GetApplication(ctx context.Context, request GetApplicationRequest) (response GetApplicationResponse, 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.getApplication, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetApplicationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetApplicationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetApplicationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetApplicationResponse") + } + return +} + +// getApplication implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getApplication(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/applications/{applicationName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetApplicationResponse + 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/network-firewall/20230501/Application/GetApplication" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetApplication", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &application{}) + return response, err +} + +// GetApplicationGroup Get ApplicationGroup by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetApplicationGroup.go.html to see an example of how to use GetApplicationGroup API. +// A default retry strategy applies to this operation GetApplicationGroup() +func (client NetworkFirewallClient) GetApplicationGroup(ctx context.Context, request GetApplicationGroupRequest) (response GetApplicationGroupResponse, 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.getApplicationGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetApplicationGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetApplicationGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetApplicationGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetApplicationGroupResponse") + } + return +} + +// getApplicationGroup implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getApplicationGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/applicationGroups/{applicationGroupName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetApplicationGroupResponse + 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/network-firewall/20230501/ApplicationGroup/GetApplicationGroup" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetApplicationGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDecryptionProfile Get Decryption Profile by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetDecryptionProfile.go.html to see an example of how to use GetDecryptionProfile API. +// A default retry strategy applies to this operation GetDecryptionProfile() +func (client NetworkFirewallClient) GetDecryptionProfile(ctx context.Context, request GetDecryptionProfileRequest) (response GetDecryptionProfileResponse, 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.getDecryptionProfile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDecryptionProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDecryptionProfileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDecryptionProfileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDecryptionProfileResponse") + } + return +} + +// getDecryptionProfile implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getDecryptionProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionProfiles/{decryptionProfileName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDecryptionProfileResponse + 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/network-firewall/20230501/DecryptionProfile/GetDecryptionProfile" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetDecryptionProfile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &decryptionprofile{}) + return response, err +} + +// GetDecryptionRule Get Decryption Rule by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetDecryptionRule.go.html to see an example of how to use GetDecryptionRule API. +// A default retry strategy applies to this operation GetDecryptionRule() +func (client NetworkFirewallClient) GetDecryptionRule(ctx context.Context, request GetDecryptionRuleRequest) (response GetDecryptionRuleResponse, 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.getDecryptionRule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDecryptionRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDecryptionRuleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDecryptionRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDecryptionRuleResponse") + } + return +} + +// getDecryptionRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getDecryptionRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionRules/{decryptionRuleName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDecryptionRuleResponse + 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/network-firewall/20230501/DecryptionRule/GetDecryptionRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetDecryptionRule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetMappedSecret Get Mapped Secret by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetMappedSecret.go.html to see an example of how to use GetMappedSecret API. +// A default retry strategy applies to this operation GetMappedSecret() +func (client NetworkFirewallClient) GetMappedSecret(ctx context.Context, request GetMappedSecretRequest) (response GetMappedSecretResponse, 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.getMappedSecret, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetMappedSecretResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetMappedSecretResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetMappedSecretResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMappedSecretResponse") + } + return +} + +// getMappedSecret implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getMappedSecret(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/mappedSecrets/{mappedSecretName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetMappedSecretResponse + 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/network-firewall/20230501/MappedSecret/GetMappedSecret" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetMappedSecret", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &mappedsecret{}) + return response, err +} + +// GetNetworkFirewall Gets a NetworkFirewall by identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetNetworkFirewall.go.html to see an example of how to use GetNetworkFirewall API. +// A default retry strategy applies to this operation GetNetworkFirewall() +func (client NetworkFirewallClient) GetNetworkFirewall(ctx context.Context, request GetNetworkFirewallRequest) (response GetNetworkFirewallResponse, 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.getNetworkFirewall, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetNetworkFirewallResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetNetworkFirewallResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNetworkFirewallResponse") + } + return +} + +// getNetworkFirewall implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewalls/{networkFirewallId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetNetworkFirewallResponse + 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/network-firewall/20230501/NetworkFirewall/GetNetworkFirewall" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetNetworkFirewall", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetNetworkFirewallPolicy Gets a NetworkFirewallPolicy given the network firewall policy identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetNetworkFirewallPolicy.go.html to see an example of how to use GetNetworkFirewallPolicy API. +// A default retry strategy applies to this operation GetNetworkFirewallPolicy() +func (client NetworkFirewallClient) GetNetworkFirewallPolicy(ctx context.Context, request GetNetworkFirewallPolicyRequest) (response GetNetworkFirewallPolicyResponse, 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.getNetworkFirewallPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetNetworkFirewallPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetNetworkFirewallPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNetworkFirewallPolicyResponse") + } + return +} + +// getNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetNetworkFirewallPolicyResponse + 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/network-firewall/20230501/NetworkFirewallPolicy/GetNetworkFirewallPolicy" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetNetworkFirewallPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSecurityRule Get Security Rule by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetSecurityRule.go.html to see an example of how to use GetSecurityRule API. +// A default retry strategy applies to this operation GetSecurityRule() +func (client NetworkFirewallClient) GetSecurityRule(ctx context.Context, request GetSecurityRuleRequest) (response GetSecurityRuleResponse, 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.getSecurityRule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetSecurityRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetSecurityRuleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetSecurityRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSecurityRuleResponse") + } + return +} + +// getSecurityRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getSecurityRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/securityRules/{securityRuleName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetSecurityRuleResponse + 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/network-firewall/20230501/SecurityRule/GetSecurityRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetSecurityRule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetService Get Service by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetService.go.html to see an example of how to use GetService API. +// A default retry strategy applies to this operation GetService() +func (client NetworkFirewallClient) GetService(ctx context.Context, request GetServiceRequest) (response GetServiceResponse, 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.getService, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetServiceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetServiceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetServiceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetServiceResponse") + } + return +} + +// getService implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getService(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/services/{serviceName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetServiceResponse + 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/network-firewall/20230501/Service/GetService" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetService", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &service{}) + return response, err +} + +// GetServiceList Get ServiceList by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetServiceList.go.html to see an example of how to use GetServiceList API. +// A default retry strategy applies to this operation GetServiceList() +func (client NetworkFirewallClient) GetServiceList(ctx context.Context, request GetServiceListRequest) (response GetServiceListResponse, 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.getServiceList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetServiceListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetServiceListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetServiceListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetServiceListResponse") + } + return +} + +// getServiceList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getServiceList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/serviceLists/{serviceListName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetServiceListResponse + 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/network-firewall/20230501/ServiceList/GetServiceList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetServiceList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetUrlList Get Url List by the given name in the context of network firewall policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetUrlList.go.html to see an example of how to use GetUrlList API. +// A default retry strategy applies to this operation GetUrlList() +func (client NetworkFirewallClient) GetUrlList(ctx context.Context, request GetUrlListRequest) (response GetUrlListResponse, 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.getUrlList, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetUrlListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetUrlListResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetUrlListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetUrlListResponse") + } + return +} + +// getUrlList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getUrlList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/urlLists/{urlListName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetUrlListResponse + 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/network-firewall/20230501/UrlList/GetUrlList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetUrlList", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the status of the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client NetworkFirewallClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/WorkRequest/GetWorkRequest" + err = common.PostProcessServiceError(err, "NetworkFirewall", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAddressLists Returns a list of Network Firewall Policies. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListAddressLists.go.html to see an example of how to use ListAddressLists API. +// A default retry strategy applies to this operation ListAddressLists() +func (client NetworkFirewallClient) ListAddressLists(ctx context.Context, request ListAddressListsRequest) (response ListAddressListsResponse, 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.listAddressLists, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListAddressListsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListAddressListsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListAddressListsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAddressListsResponse") + } + return +} + +// listAddressLists implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listAddressLists(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/addressLists", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListAddressListsResponse + 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/network-firewall/20230501/AddressList/ListAddressLists" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListAddressLists", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListApplicationGroups Returns a list of ApplicationGroups for the policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListApplicationGroups.go.html to see an example of how to use ListApplicationGroups API. +// A default retry strategy applies to this operation ListApplicationGroups() +func (client NetworkFirewallClient) ListApplicationGroups(ctx context.Context, request ListApplicationGroupsRequest) (response ListApplicationGroupsResponse, 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.listApplicationGroups, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListApplicationGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListApplicationGroupsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListApplicationGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListApplicationGroupsResponse") + } + return +} + +// listApplicationGroups implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listApplicationGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/applicationGroups", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListApplicationGroupsResponse + 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/network-firewall/20230501/ApplicationGroup/ListApplicationGroups" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListApplicationGroups", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListApplications Returns a list of Applications for the policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListApplications.go.html to see an example of how to use ListApplications API. +// A default retry strategy applies to this operation ListApplications() +func (client NetworkFirewallClient) ListApplications(ctx context.Context, request ListApplicationsRequest) (response ListApplicationsResponse, 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.listApplications, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListApplicationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListApplicationsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListApplicationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListApplicationsResponse") + } + return +} + +// listApplications implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listApplications(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/applications", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListApplicationsResponse + 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/network-firewall/20230501/Application/ListApplications" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListApplications", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDecryptionProfiles Returns a list of Decryption Profile for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListDecryptionProfiles.go.html to see an example of how to use ListDecryptionProfiles API. +// A default retry strategy applies to this operation ListDecryptionProfiles() +func (client NetworkFirewallClient) ListDecryptionProfiles(ctx context.Context, request ListDecryptionProfilesRequest) (response ListDecryptionProfilesResponse, 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.listDecryptionProfiles, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDecryptionProfilesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDecryptionProfilesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDecryptionProfilesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDecryptionProfilesResponse") + } + return +} + +// listDecryptionProfiles implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listDecryptionProfiles(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionProfiles", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDecryptionProfilesResponse + 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/network-firewall/20230501/DecryptionProfile/ListDecryptionProfiles" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListDecryptionProfiles", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDecryptionRules Returns a list of Decryption Rule for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListDecryptionRules.go.html to see an example of how to use ListDecryptionRules API. +// A default retry strategy applies to this operation ListDecryptionRules() +func (client NetworkFirewallClient) ListDecryptionRules(ctx context.Context, request ListDecryptionRulesRequest) (response ListDecryptionRulesResponse, 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.listDecryptionRules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDecryptionRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDecryptionRulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDecryptionRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDecryptionRulesResponse") + } + return +} + +// listDecryptionRules implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listDecryptionRules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionRules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDecryptionRulesResponse + 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/network-firewall/20230501/DecryptionRule/ListDecryptionRules" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListDecryptionRules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMappedSecrets Returns a list of Mapped Secret for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListMappedSecrets.go.html to see an example of how to use ListMappedSecrets API. +// A default retry strategy applies to this operation ListMappedSecrets() +func (client NetworkFirewallClient) ListMappedSecrets(ctx context.Context, request ListMappedSecretsRequest) (response ListMappedSecretsResponse, 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.listMappedSecrets, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMappedSecretsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMappedSecretsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMappedSecretsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMappedSecretsResponse") + } + return +} + +// listMappedSecrets implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listMappedSecrets(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/mappedSecrets", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMappedSecretsResponse + 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/network-firewall/20230501/MappedSecret/ListMappedSecrets" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListMappedSecrets", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListNetworkFirewallPolicies Returns a list of Network Firewall Policies. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListNetworkFirewallPolicies.go.html to see an example of how to use ListNetworkFirewallPolicies API. +// A default retry strategy applies to this operation ListNetworkFirewallPolicies() +func (client NetworkFirewallClient) ListNetworkFirewallPolicies(ctx context.Context, request ListNetworkFirewallPoliciesRequest) (response ListNetworkFirewallPoliciesResponse, 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.listNetworkFirewallPolicies, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListNetworkFirewallPoliciesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListNetworkFirewallPoliciesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListNetworkFirewallPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListNetworkFirewallPoliciesResponse") + } + return +} + +// listNetworkFirewallPolicies implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listNetworkFirewallPolicies(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListNetworkFirewallPoliciesResponse + 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/network-firewall/20230501/NetworkFirewallPolicy/ListNetworkFirewallPolicies" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListNetworkFirewallPolicies", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListNetworkFirewalls Returns a list of NetworkFirewalls. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListNetworkFirewalls.go.html to see an example of how to use ListNetworkFirewalls API. +// A default retry strategy applies to this operation ListNetworkFirewalls() +func (client NetworkFirewallClient) ListNetworkFirewalls(ctx context.Context, request ListNetworkFirewallsRequest) (response ListNetworkFirewallsResponse, 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.listNetworkFirewalls, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListNetworkFirewallsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListNetworkFirewallsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListNetworkFirewallsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListNetworkFirewallsResponse") + } + return +} + +// listNetworkFirewalls implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listNetworkFirewalls(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewalls", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListNetworkFirewallsResponse + 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/network-firewall/20230501/NetworkFirewall/ListNetworkFirewalls" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListNetworkFirewalls", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSecurityRules Returns a list of Security Rule for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListSecurityRules.go.html to see an example of how to use ListSecurityRules API. +// A default retry strategy applies to this operation ListSecurityRules() +func (client NetworkFirewallClient) ListSecurityRules(ctx context.Context, request ListSecurityRulesRequest) (response ListSecurityRulesResponse, 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.listSecurityRules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListSecurityRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListSecurityRulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListSecurityRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSecurityRulesResponse") + } + return +} + +// listSecurityRules implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listSecurityRules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/securityRules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListSecurityRulesResponse + 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/network-firewall/20230501/SecurityRule/ListSecurityRules" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListSecurityRules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListServiceLists Returns a list of ServiceLists for the policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListServiceLists.go.html to see an example of how to use ListServiceLists API. +// A default retry strategy applies to this operation ListServiceLists() +func (client NetworkFirewallClient) ListServiceLists(ctx context.Context, request ListServiceListsRequest) (response ListServiceListsResponse, 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.listServiceLists, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListServiceListsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListServiceListsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListServiceListsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServiceListsResponse") + } + return +} + +// listServiceLists implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listServiceLists(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/serviceLists", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListServiceListsResponse + 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/network-firewall/20230501/ServiceList/ListServiceLists" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListServiceLists", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListServices Returns a list of Services for the policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListServices.go.html to see an example of how to use ListServices API. +// A default retry strategy applies to this operation ListServices() +func (client NetworkFirewallClient) ListServices(ctx context.Context, request ListServicesRequest) (response ListServicesResponse, 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.listServices, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListServicesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListServicesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListServicesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServicesResponse") + } + return +} + +// listServices implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listServices(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/services", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListServicesResponse + 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/network-firewall/20230501/Service/ListServices" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListServices", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListUrlLists Returns a list of URL lists for the Network Firewall Policy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListUrlLists.go.html to see an example of how to use ListUrlLists API. +// A default retry strategy applies to this operation ListUrlLists() +func (client NetworkFirewallClient) ListUrlLists(ctx context.Context, request ListUrlListsRequest) (response ListUrlListsResponse, 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.listUrlLists, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListUrlListsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListUrlListsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListUrlListsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListUrlListsResponse") + } + return +} + +// listUrlLists implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listUrlLists(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}/urlLists", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListUrlListsResponse + 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/network-firewall/20230501/UrlList/ListUrlLists" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListUrlLists", 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 +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client NetworkFirewallClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/WorkRequestError/ListWorkRequestErrors" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Return a (paginated) list of logs for a given work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client NetworkFirewallClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} - httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/actions/changeCompartment", binaryReqBody, extraHeaders) +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ChangeNetworkFirewallPolicyCompartmentResponse + var response ListWorkRequestLogsResponse 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/network-firewall/20211001/NetworkFirewallPolicy/ChangeNetworkFirewallPolicyCompartment" - err = common.PostProcessServiceError(err, "NetworkFirewall", "ChangeNetworkFirewallPolicyCompartment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/WorkRequestLogEntry/ListWorkRequestLogs" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -270,13 +4049,13 @@ func (client NetworkFirewallClient) changeNetworkFirewallPolicyCompartment(ctx c return response, err } -// CreateNetworkFirewall Creates a new NetworkFirewall. +// ListWorkRequests Lists the work requests in a compartment. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateNetworkFirewall.go.html to see an example of how to use CreateNetworkFirewall API. -// A default retry strategy applies to this operation CreateNetworkFirewall() -func (client NetworkFirewallClient) CreateNetworkFirewall(ctx context.Context, request CreateNetworkFirewallRequest) (response CreateNetworkFirewallResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client NetworkFirewallClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -285,47 +4064,42 @@ func (client NetworkFirewallClient) CreateNetworkFirewall(ctx context.Context, r 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.createNetworkFirewall, policy) + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateNetworkFirewallResponse{} + response = ListWorkRequestsResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateNetworkFirewallResponse); ok { + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateNetworkFirewallResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") } return } -// createNetworkFirewall implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) createNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewalls", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateNetworkFirewallResponse + var response ListWorkRequestsResponse 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/network-firewall/20211001/NetworkFirewall/CreateNetworkFirewall" - err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateNetworkFirewall", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/WorkRequest/ListWorkRequests" + err = common.PostProcessServiceError(err, "NetworkFirewall", "ListWorkRequests", apiReferenceLink) return response, err } @@ -333,13 +4107,13 @@ func (client NetworkFirewallClient) createNetworkFirewall(ctx context.Context, r return response, err } -// CreateNetworkFirewallPolicy Creates a new Network Firewall Policy. +// MigrateNetworkFirewallPolicy Moves a NetworkFirewallPolicy resource from one version to latest version. When provided, If-Match is checked against ETag values of the resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/CreateNetworkFirewallPolicy.go.html to see an example of how to use CreateNetworkFirewallPolicy API. -// A default retry strategy applies to this operation CreateNetworkFirewallPolicy() -func (client NetworkFirewallClient) CreateNetworkFirewallPolicy(ctx context.Context, request CreateNetworkFirewallPolicyRequest) (response CreateNetworkFirewallPolicyResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/MigrateNetworkFirewallPolicy.go.html to see an example of how to use MigrateNetworkFirewallPolicy API. +// A default retry strategy applies to this operation MigrateNetworkFirewallPolicy() +func (client NetworkFirewallClient) MigrateNetworkFirewallPolicy(ctx context.Context, request MigrateNetworkFirewallPolicyRequest) (response MigrateNetworkFirewallPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -353,42 +4127,42 @@ func (client NetworkFirewallClient) CreateNetworkFirewallPolicy(ctx context.Cont request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createNetworkFirewallPolicy, policy) + ociResponse, err = common.Retry(ctx, request, client.migrateNetworkFirewallPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = MigrateNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateNetworkFirewallPolicyResponse{} + response = MigrateNetworkFirewallPolicyResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateNetworkFirewallPolicyResponse); ok { + if convertedResponse, ok := ociResponse.(MigrateNetworkFirewallPolicyResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateNetworkFirewallPolicyResponse") + err = fmt.Errorf("failed to convert OCIResponse into MigrateNetworkFirewallPolicyResponse") } return } -// createNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) createNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// migrateNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) migrateNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkFirewallPolicies/{networkFirewallPolicyId}/actions/migrate", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateNetworkFirewallPolicyResponse + var response MigrateNetworkFirewallPolicyResponse 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/network-firewall/20211001/NetworkFirewallPolicy/CreateNetworkFirewallPolicy" - err = common.PostProcessServiceError(err, "NetworkFirewall", "CreateNetworkFirewallPolicy", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/NetworkFirewallPolicy/MigrateNetworkFirewallPolicy" + err = common.PostProcessServiceError(err, "NetworkFirewall", "MigrateNetworkFirewallPolicy", apiReferenceLink) return response, err } @@ -396,13 +4170,13 @@ func (client NetworkFirewallClient) createNetworkFirewallPolicy(ctx context.Cont return response, err } -// DeleteNetworkFirewall Deletes a NetworkFirewall resource by identifier +// UpdateAddressList Updates the Address list with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteNetworkFirewall.go.html to see an example of how to use DeleteNetworkFirewall API. -// A default retry strategy applies to this operation DeleteNetworkFirewall() -func (client NetworkFirewallClient) DeleteNetworkFirewall(ctx context.Context, request DeleteNetworkFirewallRequest) (response DeleteNetworkFirewallResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateAddressList.go.html to see an example of how to use UpdateAddressList API. +// A default retry strategy applies to this operation UpdateAddressList() +func (client NetworkFirewallClient) UpdateAddressList(ctx context.Context, request UpdateAddressListRequest) (response UpdateAddressListResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -411,42 +4185,42 @@ func (client NetworkFirewallClient) DeleteNetworkFirewall(ctx context.Context, r if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteNetworkFirewall, policy) + ociResponse, err = common.Retry(ctx, request, client.updateAddressList, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateAddressListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteNetworkFirewallResponse{} + response = UpdateAddressListResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteNetworkFirewallResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateAddressListResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteNetworkFirewallResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateAddressListResponse") } return } -// deleteNetworkFirewall implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) deleteNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateAddressList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateAddressList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewalls/{networkFirewallId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/addressLists/{addressListName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteNetworkFirewallResponse + var response UpdateAddressListResponse 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/network-firewall/20211001/NetworkFirewall/DeleteNetworkFirewall" - err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteNetworkFirewall", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/AddressList/UpdateAddressList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateAddressList", apiReferenceLink) return response, err } @@ -454,13 +4228,13 @@ func (client NetworkFirewallClient) deleteNetworkFirewall(ctx context.Context, r return response, err } -// DeleteNetworkFirewallPolicy Deletes a NetworkFirewallPolicy resource with the given identifier. +// UpdateApplication Updates the Application with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/DeleteNetworkFirewallPolicy.go.html to see an example of how to use DeleteNetworkFirewallPolicy API. -// A default retry strategy applies to this operation DeleteNetworkFirewallPolicy() -func (client NetworkFirewallClient) DeleteNetworkFirewallPolicy(ctx context.Context, request DeleteNetworkFirewallPolicyRequest) (response DeleteNetworkFirewallPolicyResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateApplication.go.html to see an example of how to use UpdateApplication API. +// A default retry strategy applies to this operation UpdateApplication() +func (client NetworkFirewallClient) UpdateApplication(ctx context.Context, request UpdateApplicationRequest) (response UpdateApplicationResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -469,56 +4243,56 @@ func (client NetworkFirewallClient) DeleteNetworkFirewallPolicy(ctx context.Cont if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteNetworkFirewallPolicy, policy) + ociResponse, err = common.Retry(ctx, request, client.updateApplication, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateApplicationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteNetworkFirewallPolicyResponse{} + response = UpdateApplicationResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteNetworkFirewallPolicyResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateApplicationResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteNetworkFirewallPolicyResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateApplicationResponse") } return } -// deleteNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) deleteNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateApplication implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateApplication(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkFirewallPolicies/{networkFirewallPolicyId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/applications/{applicationName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteNetworkFirewallPolicyResponse + var response UpdateApplicationResponse 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/network-firewall/20211001/NetworkFirewallPolicy/DeleteNetworkFirewallPolicy" - err = common.PostProcessServiceError(err, "NetworkFirewall", "DeleteNetworkFirewallPolicy", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/Application/UpdateApplication" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateApplication", apiReferenceLink) return response, err } - err = common.UnmarshalResponse(httpResponse, &response) + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &application{}) return response, err } -// GetNetworkFirewall Gets a NetworkFirewall by identifier +// UpdateApplicationGroup Updates the ApplicationGroup with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetNetworkFirewall.go.html to see an example of how to use GetNetworkFirewall API. -// A default retry strategy applies to this operation GetNetworkFirewall() -func (client NetworkFirewallClient) GetNetworkFirewall(ctx context.Context, request GetNetworkFirewallRequest) (response GetNetworkFirewallResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateApplicationGroup.go.html to see an example of how to use UpdateApplicationGroup API. +// A default retry strategy applies to this operation UpdateApplicationGroup() +func (client NetworkFirewallClient) UpdateApplicationGroup(ctx context.Context, request UpdateApplicationGroupRequest) (response UpdateApplicationGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -527,42 +4301,42 @@ func (client NetworkFirewallClient) GetNetworkFirewall(ctx context.Context, requ if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getNetworkFirewall, policy) + ociResponse, err = common.Retry(ctx, request, client.updateApplicationGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateApplicationGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetNetworkFirewallResponse{} + response = UpdateApplicationGroupResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetNetworkFirewallResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateApplicationGroupResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetNetworkFirewallResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateApplicationGroupResponse") } return } -// getNetworkFirewall implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) getNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateApplicationGroup implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateApplicationGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewalls/{networkFirewallId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/applicationGroups/{applicationGroupName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetNetworkFirewallResponse + var response UpdateApplicationGroupResponse 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/network-firewall/20211001/NetworkFirewall/GetNetworkFirewall" - err = common.PostProcessServiceError(err, "NetworkFirewall", "GetNetworkFirewall", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/ApplicationGroup/UpdateApplicationGroup" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateApplicationGroup", apiReferenceLink) return response, err } @@ -570,13 +4344,13 @@ func (client NetworkFirewallClient) getNetworkFirewall(ctx context.Context, requ return response, err } -// GetNetworkFirewallPolicy Gets a NetworkFirewallPolicy given the network firewall policy identifier. +// UpdateDecryptionProfile Updates the Decryption Profile with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetNetworkFirewallPolicy.go.html to see an example of how to use GetNetworkFirewallPolicy API. -// A default retry strategy applies to this operation GetNetworkFirewallPolicy() -func (client NetworkFirewallClient) GetNetworkFirewallPolicy(ctx context.Context, request GetNetworkFirewallPolicyRequest) (response GetNetworkFirewallPolicyResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateDecryptionProfile.go.html to see an example of how to use UpdateDecryptionProfile API. +// A default retry strategy applies to this operation UpdateDecryptionProfile() +func (client NetworkFirewallClient) UpdateDecryptionProfile(ctx context.Context, request UpdateDecryptionProfileRequest) (response UpdateDecryptionProfileResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -585,56 +4359,56 @@ func (client NetworkFirewallClient) GetNetworkFirewallPolicy(ctx context.Context if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getNetworkFirewallPolicy, policy) + ociResponse, err = common.Retry(ctx, request, client.updateDecryptionProfile, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateDecryptionProfileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetNetworkFirewallPolicyResponse{} + response = UpdateDecryptionProfileResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetNetworkFirewallPolicyResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateDecryptionProfileResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetNetworkFirewallPolicyResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateDecryptionProfileResponse") } return } -// getNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) getNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateDecryptionProfile implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateDecryptionProfile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies/{networkFirewallPolicyId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionProfiles/{decryptionProfileName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetNetworkFirewallPolicyResponse + var response UpdateDecryptionProfileResponse 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/network-firewall/20211001/NetworkFirewallPolicy/GetNetworkFirewallPolicy" - err = common.PostProcessServiceError(err, "NetworkFirewall", "GetNetworkFirewallPolicy", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/DecryptionProfile/UpdateDecryptionProfile" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateDecryptionProfile", apiReferenceLink) return response, err } - err = common.UnmarshalResponse(httpResponse, &response) + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &decryptionprofile{}) return response, err } -// GetWorkRequest Gets the status of the work request with the given ID. +// UpdateDecryptionRule Updates the Decryption Rule with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. -// A default retry strategy applies to this operation GetWorkRequest() -func (client NetworkFirewallClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateDecryptionRule.go.html to see an example of how to use UpdateDecryptionRule API. +// A default retry strategy applies to this operation UpdateDecryptionRule() +func (client NetworkFirewallClient) UpdateDecryptionRule(ctx context.Context, request UpdateDecryptionRuleRequest) (response UpdateDecryptionRuleResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -643,42 +4417,42 @@ func (client NetworkFirewallClient) GetWorkRequest(ctx context.Context, request if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + ociResponse, err = common.Retry(ctx, request, client.updateDecryptionRule, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateDecryptionRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetWorkRequestResponse{} + response = UpdateDecryptionRuleResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateDecryptionRuleResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateDecryptionRuleResponse") } return } -// getWorkRequest implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateDecryptionRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateDecryptionRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/decryptionRules/{decryptionRuleName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetWorkRequestResponse + var response UpdateDecryptionRuleResponse 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/network-firewall/20211001/WorkRequest/GetWorkRequest" - err = common.PostProcessServiceError(err, "NetworkFirewall", "GetWorkRequest", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/DecryptionRule/UpdateDecryptionRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateDecryptionRule", apiReferenceLink) return response, err } @@ -686,13 +4460,13 @@ func (client NetworkFirewallClient) getWorkRequest(ctx context.Context, request return response, err } -// ListNetworkFirewallPolicies Returns a list of Network Firewall Policies. +// UpdateMappedSecret Updates the Mapped Secret with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListNetworkFirewallPolicies.go.html to see an example of how to use ListNetworkFirewallPolicies API. -// A default retry strategy applies to this operation ListNetworkFirewallPolicies() -func (client NetworkFirewallClient) ListNetworkFirewallPolicies(ctx context.Context, request ListNetworkFirewallPoliciesRequest) (response ListNetworkFirewallPoliciesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateMappedSecret.go.html to see an example of how to use UpdateMappedSecret API. +// A default retry strategy applies to this operation UpdateMappedSecret() +func (client NetworkFirewallClient) UpdateMappedSecret(ctx context.Context, request UpdateMappedSecretRequest) (response UpdateMappedSecretResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -701,56 +4475,56 @@ func (client NetworkFirewallClient) ListNetworkFirewallPolicies(ctx context.Cont if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listNetworkFirewallPolicies, policy) + ociResponse, err = common.Retry(ctx, request, client.updateMappedSecret, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListNetworkFirewallPoliciesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateMappedSecretResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListNetworkFirewallPoliciesResponse{} + response = UpdateMappedSecretResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListNetworkFirewallPoliciesResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateMappedSecretResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListNetworkFirewallPoliciesResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateMappedSecretResponse") } return } -// listNetworkFirewallPolicies implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) listNetworkFirewallPolicies(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateMappedSecret implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateMappedSecret(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewallPolicies", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/mappedSecrets/{mappedSecretName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListNetworkFirewallPoliciesResponse + var response UpdateMappedSecretResponse 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/network-firewall/20211001/NetworkFirewallPolicy/ListNetworkFirewallPolicies" - err = common.PostProcessServiceError(err, "NetworkFirewall", "ListNetworkFirewallPolicies", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/MappedSecret/UpdateMappedSecret" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateMappedSecret", apiReferenceLink) return response, err } - err = common.UnmarshalResponse(httpResponse, &response) + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &mappedsecret{}) return response, err } -// ListNetworkFirewalls Returns a list of NetworkFirewalls. +// UpdateNetworkFirewall Updates the NetworkFirewall // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListNetworkFirewalls.go.html to see an example of how to use ListNetworkFirewalls API. -// A default retry strategy applies to this operation ListNetworkFirewalls() -func (client NetworkFirewallClient) ListNetworkFirewalls(ctx context.Context, request ListNetworkFirewallsRequest) (response ListNetworkFirewallsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateNetworkFirewall.go.html to see an example of how to use UpdateNetworkFirewall API. +// A default retry strategy applies to this operation UpdateNetworkFirewall() +func (client NetworkFirewallClient) UpdateNetworkFirewall(ctx context.Context, request UpdateNetworkFirewallRequest) (response UpdateNetworkFirewallResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -759,42 +4533,42 @@ func (client NetworkFirewallClient) ListNetworkFirewalls(ctx context.Context, re if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listNetworkFirewalls, policy) + ociResponse, err = common.Retry(ctx, request, client.updateNetworkFirewall, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListNetworkFirewallsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListNetworkFirewallsResponse{} + response = UpdateNetworkFirewallResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListNetworkFirewallsResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateNetworkFirewallResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListNetworkFirewallsResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateNetworkFirewallResponse") } return } -// listNetworkFirewalls implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) listNetworkFirewalls(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateNetworkFirewall implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkFirewalls", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewalls/{networkFirewallId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListNetworkFirewallsResponse + var response UpdateNetworkFirewallResponse 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/network-firewall/20211001/NetworkFirewall/ListNetworkFirewalls" - err = common.PostProcessServiceError(err, "NetworkFirewall", "ListNetworkFirewalls", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/NetworkFirewall/UpdateNetworkFirewall" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateNetworkFirewall", apiReferenceLink) return response, err } @@ -802,13 +4576,13 @@ func (client NetworkFirewallClient) listNetworkFirewalls(ctx context.Context, re return response, err } -// ListWorkRequestErrors Return a (paginated) list of errors for a given work request. +// UpdateNetworkFirewallPolicy Updates the NetworkFirewallPolicy // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. -// A default retry strategy applies to this operation ListWorkRequestErrors() -func (client NetworkFirewallClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateNetworkFirewallPolicy.go.html to see an example of how to use UpdateNetworkFirewallPolicy API. +// A default retry strategy applies to this operation UpdateNetworkFirewallPolicy() +func (client NetworkFirewallClient) UpdateNetworkFirewallPolicy(ctx context.Context, request UpdateNetworkFirewallPolicyRequest) (response UpdateNetworkFirewallPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -817,42 +4591,42 @@ func (client NetworkFirewallClient) ListWorkRequestErrors(ctx context.Context, r if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + ociResponse, err = common.Retry(ctx, request, client.updateNetworkFirewallPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListWorkRequestErrorsResponse{} + response = UpdateNetworkFirewallPolicyResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateNetworkFirewallPolicyResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateNetworkFirewallPolicyResponse") } return } -// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListWorkRequestErrorsResponse + var response UpdateNetworkFirewallPolicyResponse 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/network-firewall/20211001/WorkRequestError/ListWorkRequestErrors" - err = common.PostProcessServiceError(err, "NetworkFirewall", "ListWorkRequestErrors", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/NetworkFirewallPolicy/UpdateNetworkFirewallPolicy" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateNetworkFirewallPolicy", apiReferenceLink) return response, err } @@ -860,13 +4634,13 @@ func (client NetworkFirewallClient) listWorkRequestErrors(ctx context.Context, r return response, err } -// ListWorkRequestLogs Return a (paginated) list of logs for a given work request. +// UpdateSecurityRule Updates the Security Rule with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. -// A default retry strategy applies to this operation ListWorkRequestLogs() -func (client NetworkFirewallClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateSecurityRule.go.html to see an example of how to use UpdateSecurityRule API. +// A default retry strategy applies to this operation UpdateSecurityRule() +func (client NetworkFirewallClient) UpdateSecurityRule(ctx context.Context, request UpdateSecurityRuleRequest) (response UpdateSecurityRuleResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -875,42 +4649,42 @@ func (client NetworkFirewallClient) ListWorkRequestLogs(ctx context.Context, req if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + ociResponse, err = common.Retry(ctx, request, client.updateSecurityRule, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateSecurityRuleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListWorkRequestLogsResponse{} + response = UpdateSecurityRuleResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateSecurityRuleResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateSecurityRuleResponse") } return } -// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateSecurityRule implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateSecurityRule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/securityRules/{securityRuleName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListWorkRequestLogsResponse + var response UpdateSecurityRuleResponse 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/network-firewall/20211001/WorkRequestLogEntry/ListWorkRequestLogs" - err = common.PostProcessServiceError(err, "NetworkFirewall", "ListWorkRequestLogs", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/SecurityRule/UpdateSecurityRule" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateSecurityRule", apiReferenceLink) return response, err } @@ -918,13 +4692,13 @@ func (client NetworkFirewallClient) listWorkRequestLogs(ctx context.Context, req return response, err } -// ListWorkRequests Lists the work requests in a compartment. +// UpdateService Updates the Service with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. -// A default retry strategy applies to this operation ListWorkRequests() -func (client NetworkFirewallClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateService.go.html to see an example of how to use UpdateService API. +// A default retry strategy applies to this operation UpdateService() +func (client NetworkFirewallClient) UpdateService(ctx context.Context, request UpdateServiceRequest) (response UpdateServiceResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -933,56 +4707,56 @@ func (client NetworkFirewallClient) ListWorkRequests(ctx context.Context, reques if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + ociResponse, err = common.Retry(ctx, request, client.updateService, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateServiceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListWorkRequestsResponse{} + response = UpdateServiceResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateServiceResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateServiceResponse") } return } -// listWorkRequests implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateService implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateService(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/services/{serviceName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListWorkRequestsResponse + var response UpdateServiceResponse 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/network-firewall/20211001/WorkRequest/ListWorkRequests" - err = common.PostProcessServiceError(err, "NetworkFirewall", "ListWorkRequests", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/Service/UpdateService" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateService", apiReferenceLink) return response, err } - err = common.UnmarshalResponse(httpResponse, &response) + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &service{}) return response, err } -// UpdateNetworkFirewall Updates the NetworkFirewall +// UpdateServiceList Updates the ServiceList with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateNetworkFirewall.go.html to see an example of how to use UpdateNetworkFirewall API. -// A default retry strategy applies to this operation UpdateNetworkFirewall() -func (client NetworkFirewallClient) UpdateNetworkFirewall(ctx context.Context, request UpdateNetworkFirewallRequest) (response UpdateNetworkFirewallResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateServiceList.go.html to see an example of how to use UpdateServiceList API. +// A default retry strategy applies to this operation UpdateServiceList() +func (client NetworkFirewallClient) UpdateServiceList(ctx context.Context, request UpdateServiceListRequest) (response UpdateServiceListResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -991,42 +4765,42 @@ func (client NetworkFirewallClient) UpdateNetworkFirewall(ctx context.Context, r if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.updateNetworkFirewall, policy) + ociResponse, err = common.Retry(ctx, request, client.updateServiceList, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = UpdateNetworkFirewallResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateServiceListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = UpdateNetworkFirewallResponse{} + response = UpdateServiceListResponse{} } } return } - if convertedResponse, ok := ociResponse.(UpdateNetworkFirewallResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateServiceListResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into UpdateNetworkFirewallResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateServiceListResponse") } return } -// updateNetworkFirewall implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) updateNetworkFirewall(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateServiceList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateServiceList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewalls/{networkFirewallId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/serviceLists/{serviceListName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response UpdateNetworkFirewallResponse + var response UpdateServiceListResponse 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/network-firewall/20211001/NetworkFirewall/UpdateNetworkFirewall" - err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateNetworkFirewall", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/ServiceList/UpdateServiceList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateServiceList", apiReferenceLink) return response, err } @@ -1034,13 +4808,13 @@ func (client NetworkFirewallClient) updateNetworkFirewall(ctx context.Context, r return response, err } -// UpdateNetworkFirewallPolicy Updates the NetworkFirewallPolicy +// UpdateUrlList Updates the Url list with the given name in the network firewall policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateNetworkFirewallPolicy.go.html to see an example of how to use UpdateNetworkFirewallPolicy API. -// A default retry strategy applies to this operation UpdateNetworkFirewallPolicy() -func (client NetworkFirewallClient) UpdateNetworkFirewallPolicy(ctx context.Context, request UpdateNetworkFirewallPolicyRequest) (response UpdateNetworkFirewallPolicyResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateUrlList.go.html to see an example of how to use UpdateUrlList API. +// A default retry strategy applies to this operation UpdateUrlList() +func (client NetworkFirewallClient) UpdateUrlList(ctx context.Context, request UpdateUrlListRequest) (response UpdateUrlListResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1049,42 +4823,42 @@ func (client NetworkFirewallClient) UpdateNetworkFirewallPolicy(ctx context.Cont if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.updateNetworkFirewallPolicy, policy) + ociResponse, err = common.Retry(ctx, request, client.updateUrlList, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = UpdateNetworkFirewallPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = UpdateUrlListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = UpdateNetworkFirewallPolicyResponse{} + response = UpdateUrlListResponse{} } } return } - if convertedResponse, ok := ociResponse.(UpdateNetworkFirewallPolicyResponse); ok { + if convertedResponse, ok := ociResponse.(UpdateUrlListResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into UpdateNetworkFirewallPolicyResponse") + err = fmt.Errorf("failed to convert OCIResponse into UpdateUrlListResponse") } return } -// updateNetworkFirewallPolicy implements the OCIOperation interface (enables retrying operations) -func (client NetworkFirewallClient) updateNetworkFirewallPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// updateUrlList implements the OCIOperation interface (enables retrying operations) +func (client NetworkFirewallClient) updateUrlList(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkFirewallPolicies/{networkFirewallPolicyId}/urlLists/{urlListName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response UpdateNetworkFirewallPolicyResponse + var response UpdateUrlListResponse 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/network-firewall/20211001/NetworkFirewallPolicy/UpdateNetworkFirewallPolicy" - err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateNetworkFirewallPolicy", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/network-firewall/20230501/UrlList/UpdateUrlList" + err = common.PostProcessServiceError(err, "NetworkFirewall", "UpdateUrlList", apiReferenceLink) return response, err } diff --git a/networkfirewall/operation_status.go b/networkfirewall/operation_status.go index 69121403b2..2cda70efe0 100644 --- a/networkfirewall/operation_status.go +++ b/networkfirewall/operation_status.go @@ -18,33 +18,36 @@ type OperationStatusEnum string // Set of constants representing the allowable values for OperationStatusEnum const ( - OperationStatusAccepted OperationStatusEnum = "ACCEPTED" - OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" - OperationStatusWaiting OperationStatusEnum = "WAITING" - OperationStatusFailed OperationStatusEnum = "FAILED" - OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" - OperationStatusCanceling OperationStatusEnum = "CANCELING" - OperationStatusCanceled OperationStatusEnum = "CANCELED" + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" ) var mappingOperationStatusEnum = map[string]OperationStatusEnum{ - "ACCEPTED": OperationStatusAccepted, - "IN_PROGRESS": OperationStatusInProgress, - "WAITING": OperationStatusWaiting, - "FAILED": OperationStatusFailed, - "SUCCEEDED": OperationStatusSucceeded, - "CANCELING": OperationStatusCanceling, - "CANCELED": OperationStatusCanceled, + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, } var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ - "accepted": OperationStatusAccepted, - "in_progress": OperationStatusInProgress, - "waiting": OperationStatusWaiting, - "failed": OperationStatusFailed, - "succeeded": OperationStatusSucceeded, - "canceling": OperationStatusCanceling, - "canceled": OperationStatusCanceled, + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "needs_attention": OperationStatusNeedsAttention, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, } // GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum @@ -64,6 +67,7 @@ func GetOperationStatusEnumStringValues() []string { "WAITING", "FAILED", "SUCCEEDED", + "NEEDS_ATTENTION", "CANCELING", "CANCELED", } diff --git a/networkfirewall/tcp_application.go b/networkfirewall/port_range.go similarity index 70% rename from networkfirewall/tcp_application.go rename to networkfirewall/port_range.go index 38d86b639f..9bf3c73799 100644 --- a/networkfirewall/tcp_application.go +++ b/networkfirewall/port_range.go @@ -10,14 +10,13 @@ package networkfirewall import ( - "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" ) -// TcpApplication TCP Application used on the firewall policy rules. -type TcpApplication struct { +// PortRange A Port Range which can be used for the running service. It uses port information. +type PortRange struct { // The minimum port in the range (inclusive), or the sole port of a single-port range. MinimumPort *int `mandatory:"true" json:"minimumPort"` @@ -26,14 +25,14 @@ type TcpApplication struct { MaximumPort *int `mandatory:"false" json:"maximumPort"` } -func (m TcpApplication) String() string { +func (m PortRange) String() string { return common.PointerString(m) } // ValidateEnumValue returns an error when providing an unsupported enum value // This function is being called during constructing API request process // Not recommended for calling this function directly -func (m TcpApplication) ValidateEnumValue() (bool, error) { +func (m PortRange) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { @@ -41,17 +40,3 @@ func (m TcpApplication) ValidateEnumValue() (bool, error) { } return false, nil } - -// MarshalJSON marshals to json representation -func (m TcpApplication) MarshalJSON() (buff []byte, e error) { - type MarshalTypeTcpApplication TcpApplication - s := struct { - DiscriminatorParam string `json:"type"` - MarshalTypeTcpApplication - }{ - "TCP", - (MarshalTypeTcpApplication)(m), - } - - return json.Marshal(&s) -} diff --git a/networkfirewall/rule_position.go b/networkfirewall/rule_position.go new file mode 100644 index 0000000000..df32d98f51 --- /dev/null +++ b/networkfirewall/rule_position.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RulePosition An object which defines the position of the rule. +type RulePosition struct { + + // Identifier for rule before which this rule lies. + BeforeRule *string `mandatory:"false" json:"beforeRule"` + + // Identifier for rule after which this rule lies. + AfterRule *string `mandatory:"false" json:"afterRule"` +} + +func (m RulePosition) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RulePosition) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/security_rule.go b/networkfirewall/security_rule.go index e96f2988fb..c6baa89650 100644 --- a/networkfirewall/security_rule.go +++ b/networkfirewall/security_rule.go @@ -30,12 +30,17 @@ type SecurityRule struct { // * DROP - Silently drops the traffic, e.g. without sending a TCP reset. // * REJECT - Rejects the traffic, sending a TCP reset to client and/or server as applicable. // * INSPECT - Inspects traffic for vulnerability as specified in `inspection`, which may result in rejection. - Action SecurityRuleActionEnum `mandatory:"true" json:"action"` + Action TrafficActionTypeEnum `mandatory:"true" json:"action"` + + // OCID of the Network Firewall Policy this security rule belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` // Type of inspection to affect the Traffic flow. This is only applicable if action is INSPECT. // * INTRUSION_DETECTION - Intrusion Detection. // * INTRUSION_PREVENTION - Intrusion Detection and Prevention. Traffic classified as potentially malicious will be rejected as described in `type`. - Inspection SecurityRuleInspectionEnum `mandatory:"false" json:"inspection,omitempty"` + Inspection TrafficInspectionTypeEnum `mandatory:"false" json:"inspection,omitempty"` + + Position *RulePosition `mandatory:"false" json:"position"` } func (m SecurityRule) String() string { @@ -47,107 +52,15 @@ func (m SecurityRule) String() string { // Not recommended for calling this function directly func (m SecurityRule) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingSecurityRuleActionEnum(string(m.Action)); !ok && m.Action != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetSecurityRuleActionEnumStringValues(), ","))) + if _, ok := GetMappingTrafficActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetTrafficActionTypeEnumStringValues(), ","))) } - if _, ok := GetMappingSecurityRuleInspectionEnum(string(m.Inspection)); !ok && m.Inspection != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Inspection: %s. Supported values are: %s.", m.Inspection, strings.Join(GetSecurityRuleInspectionEnumStringValues(), ","))) + if _, ok := GetMappingTrafficInspectionTypeEnum(string(m.Inspection)); !ok && m.Inspection != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Inspection: %s. Supported values are: %s.", m.Inspection, strings.Join(GetTrafficInspectionTypeEnumStringValues(), ","))) } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } - -// SecurityRuleActionEnum Enum with underlying type: string -type SecurityRuleActionEnum string - -// Set of constants representing the allowable values for SecurityRuleActionEnum -const ( - SecurityRuleActionAllow SecurityRuleActionEnum = "ALLOW" - SecurityRuleActionDrop SecurityRuleActionEnum = "DROP" - SecurityRuleActionReject SecurityRuleActionEnum = "REJECT" - SecurityRuleActionInspect SecurityRuleActionEnum = "INSPECT" -) - -var mappingSecurityRuleActionEnum = map[string]SecurityRuleActionEnum{ - "ALLOW": SecurityRuleActionAllow, - "DROP": SecurityRuleActionDrop, - "REJECT": SecurityRuleActionReject, - "INSPECT": SecurityRuleActionInspect, -} - -var mappingSecurityRuleActionEnumLowerCase = map[string]SecurityRuleActionEnum{ - "allow": SecurityRuleActionAllow, - "drop": SecurityRuleActionDrop, - "reject": SecurityRuleActionReject, - "inspect": SecurityRuleActionInspect, -} - -// GetSecurityRuleActionEnumValues Enumerates the set of values for SecurityRuleActionEnum -func GetSecurityRuleActionEnumValues() []SecurityRuleActionEnum { - values := make([]SecurityRuleActionEnum, 0) - for _, v := range mappingSecurityRuleActionEnum { - values = append(values, v) - } - return values -} - -// GetSecurityRuleActionEnumStringValues Enumerates the set of values in String for SecurityRuleActionEnum -func GetSecurityRuleActionEnumStringValues() []string { - return []string{ - "ALLOW", - "DROP", - "REJECT", - "INSPECT", - } -} - -// GetMappingSecurityRuleActionEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingSecurityRuleActionEnum(val string) (SecurityRuleActionEnum, bool) { - enum, ok := mappingSecurityRuleActionEnumLowerCase[strings.ToLower(val)] - return enum, ok -} - -// SecurityRuleInspectionEnum Enum with underlying type: string -type SecurityRuleInspectionEnum string - -// Set of constants representing the allowable values for SecurityRuleInspectionEnum -const ( - SecurityRuleInspectionDetection SecurityRuleInspectionEnum = "INTRUSION_DETECTION" - SecurityRuleInspectionPrevention SecurityRuleInspectionEnum = "INTRUSION_PREVENTION" -) - -var mappingSecurityRuleInspectionEnum = map[string]SecurityRuleInspectionEnum{ - "INTRUSION_DETECTION": SecurityRuleInspectionDetection, - "INTRUSION_PREVENTION": SecurityRuleInspectionPrevention, -} - -var mappingSecurityRuleInspectionEnumLowerCase = map[string]SecurityRuleInspectionEnum{ - "intrusion_detection": SecurityRuleInspectionDetection, - "intrusion_prevention": SecurityRuleInspectionPrevention, -} - -// GetSecurityRuleInspectionEnumValues Enumerates the set of values for SecurityRuleInspectionEnum -func GetSecurityRuleInspectionEnumValues() []SecurityRuleInspectionEnum { - values := make([]SecurityRuleInspectionEnum, 0) - for _, v := range mappingSecurityRuleInspectionEnum { - values = append(values, v) - } - return values -} - -// GetSecurityRuleInspectionEnumStringValues Enumerates the set of values in String for SecurityRuleInspectionEnum -func GetSecurityRuleInspectionEnumStringValues() []string { - return []string{ - "INTRUSION_DETECTION", - "INTRUSION_PREVENTION", - } -} - -// GetMappingSecurityRuleInspectionEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingSecurityRuleInspectionEnum(val string) (SecurityRuleInspectionEnum, bool) { - enum, ok := mappingSecurityRuleInspectionEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/networkfirewall/security_rule_match_criteria.go b/networkfirewall/security_rule_match_criteria.go index de000a218a..080f897d0c 100644 --- a/networkfirewall/security_rule_match_criteria.go +++ b/networkfirewall/security_rule_match_criteria.go @@ -20,16 +20,19 @@ import ( type SecurityRuleMatchCriteria struct { // An array of IP address list names to be evaluated against the traffic source address. - Sources []string `mandatory:"false" json:"sources"` + SourceAddress []string `mandatory:"false" json:"sourceAddress"` // An array of IP address list names to be evaluated against the traffic destination address. - Destinations []string `mandatory:"false" json:"destinations"` + DestinationAddress []string `mandatory:"false" json:"destinationAddress"` // An array of application list names to be evaluated against the traffic protocol and protocol-specific parameters. - Applications []string `mandatory:"false" json:"applications"` + Application []string `mandatory:"false" json:"application"` + + // An array of service list names to be evaluated against the traffic protocol and protocol-specific parameters. + Service []string `mandatory:"false" json:"service"` // An array of URL pattern list names to be evaluated against the HTTP(S) request target. - Urls []string `mandatory:"false" json:"urls"` + Url []string `mandatory:"false" json:"url"` } func (m SecurityRuleMatchCriteria) String() string { diff --git a/networkfirewall/security_rule_summary.go b/networkfirewall/security_rule_summary.go new file mode 100644 index 0000000000..11495e83ad --- /dev/null +++ b/networkfirewall/security_rule_summary.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SecurityRuleSummary Summary for the Security Rule used in the firewall policy rules. +// Security Rules determine whether to block or allow a session based on traffic attributes, +// such as the source and destination IP address, protocol/port, and the HTTP(S) target URL. +type SecurityRuleSummary struct { + + // Name for the Security rule, must be unique within the policy. + Name *string `mandatory:"true" json:"name"` + + // Types of Action on the Traffic flow. + // * ALLOW - Allows the traffic. + // * DROP - Silently drops the traffic, e.g. without sending a TCP reset. + // * REJECT - Rejects the traffic, sending a TCP reset to client and/or server as applicable. + // * INSPECT - Inspects traffic for vulnerability as specified in `inspection`, which may result in rejection. + Action TrafficActionTypeEnum `mandatory:"true" json:"action"` + + // The priority order in which this rule should be evaluated. + PriorityOrder *int64 `mandatory:"true" json:"priorityOrder"` + + // OCID of the network firewall policy this security rule belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + + // Type of inspection to affect the Traffic flow. This is only applicable if action is INSPECT. + // * INTRUSION_DETECTION - Intrusion Detection. + // * INTRUSION_PREVENTION - Intrusion Detection and Prevention. Traffic classified as potentially malicious will be rejected as described in `type`. + Inspection TrafficInspectionTypeEnum `mandatory:"false" json:"inspection,omitempty"` +} + +func (m SecurityRuleSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SecurityRuleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTrafficActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetTrafficActionTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingTrafficInspectionTypeEnum(string(m.Inspection)); !ok && m.Inspection != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Inspection: %s. Supported values are: %s.", m.Inspection, strings.Join(GetTrafficInspectionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/security_rule_summary_collection.go b/networkfirewall/security_rule_summary_collection.go new file mode 100644 index 0000000000..6172dcd871 --- /dev/null +++ b/networkfirewall/security_rule_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SecurityRuleSummaryCollection Collection of Security Rule Summaries in the network firewall policy +type SecurityRuleSummaryCollection struct { + + // Collection of Security Rule Summaries. + Items []SecurityRuleSummary `mandatory:"true" json:"items"` +} + +func (m SecurityRuleSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SecurityRuleSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/service.go b/networkfirewall/service.go new file mode 100644 index 0000000000..64122bab1a --- /dev/null +++ b/networkfirewall/service.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Service A Service which can be used to identify the running service. It uses port & protocol information. +type Service interface { + + // Name of the service. + GetName() *string + + // OCID of the Network Firewall Policy this service belongs to. + GetParentResourceId() *string +} + +type service struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *service) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerservice service + s := struct { + Model Unmarshalerservice + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.ParentResourceId = s.Model.ParentResourceId + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *service) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "TCP_SERVICE": + mm := TcpService{} + err = json.Unmarshal(data, &mm) + return mm, err + case "UDP_SERVICE": + mm := UdpService{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for Service: %s.", m.Type) + return *m, nil + } +} + +// GetName returns Name +func (m service) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m service) GetParentResourceId() *string { + return m.ParentResourceId +} + +func (m service) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m service) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/service_list.go b/networkfirewall/service_list.go new file mode 100644 index 0000000000..f11f9c6515 --- /dev/null +++ b/networkfirewall/service_list.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceList A group of services. +type ServiceList struct { + + // Name of the service Group. + Name *string `mandatory:"true" json:"name"` + + // List of services in the group. + Services []string `mandatory:"true" json:"services"` + + // Count of total services in the given service List. + TotalServices *int `mandatory:"true" json:"totalServices"` + + // OCID of the Network Firewall Policy this serviceList belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m ServiceList) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ServiceList) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/service_list_summary.go b/networkfirewall/service_list_summary.go new file mode 100644 index 0000000000..e34f066b5c --- /dev/null +++ b/networkfirewall/service_list_summary.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceListSummary Summary object for service list in the network firewall policy. +type ServiceListSummary struct { + + // Name of the service groups. + Name *string `mandatory:"true" json:"name"` + + // Count of total services in the given service List. + TotalServices *int `mandatory:"true" json:"totalServices"` + + // OCID of the Network Firewall Policy this application belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m ServiceListSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ServiceListSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/service_list_summary_collection.go b/networkfirewall/service_list_summary_collection.go new file mode 100644 index 0000000000..69becda6ca --- /dev/null +++ b/networkfirewall/service_list_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceListSummaryCollection Collection of Service Lists in the network firewall policy +type ServiceListSummaryCollection struct { + + // List of service lists. + Items []ServiceListSummary `mandatory:"true" json:"items"` +} + +func (m ServiceListSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ServiceListSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/service_summary.go b/networkfirewall/service_summary.go new file mode 100644 index 0000000000..b483f02db6 --- /dev/null +++ b/networkfirewall/service_summary.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceSummary Summary object for service element in the network firewall policy. +type ServiceSummary struct { + + // Describes the type of Service. + Type ServiceTypeEnum `mandatory:"true" json:"type"` + + // Name of the service. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this Service belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m ServiceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ServiceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingServiceTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetServiceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/service_summary_collection.go b/networkfirewall/service_summary_collection.go new file mode 100644 index 0000000000..fbc69ecf98 --- /dev/null +++ b/networkfirewall/service_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceSummaryCollection Collection of Services in the network firewall policy +type ServiceSummaryCollection struct { + + // Collection of Services. + Items []ServiceSummary `mandatory:"true" json:"items"` +} + +func (m ServiceSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ServiceSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/service_type.go b/networkfirewall/service_type.go new file mode 100644 index 0000000000..7d38687440 --- /dev/null +++ b/networkfirewall/service_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// ServiceTypeEnum Enum with underlying type: string +type ServiceTypeEnum string + +// Set of constants representing the allowable values for ServiceTypeEnum +const ( + ServiceTypeTcpService ServiceTypeEnum = "TCP_SERVICE" + ServiceTypeUdpService ServiceTypeEnum = "UDP_SERVICE" +) + +var mappingServiceTypeEnum = map[string]ServiceTypeEnum{ + "TCP_SERVICE": ServiceTypeTcpService, + "UDP_SERVICE": ServiceTypeUdpService, +} + +var mappingServiceTypeEnumLowerCase = map[string]ServiceTypeEnum{ + "tcp_service": ServiceTypeTcpService, + "udp_service": ServiceTypeUdpService, +} + +// GetServiceTypeEnumValues Enumerates the set of values for ServiceTypeEnum +func GetServiceTypeEnumValues() []ServiceTypeEnum { + values := make([]ServiceTypeEnum, 0) + for _, v := range mappingServiceTypeEnum { + values = append(values, v) + } + return values +} + +// GetServiceTypeEnumStringValues Enumerates the set of values in String for ServiceTypeEnum +func GetServiceTypeEnumStringValues() []string { + return []string{ + "TCP_SERVICE", + "UDP_SERVICE", + } +} + +// GetMappingServiceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingServiceTypeEnum(val string) (ServiceTypeEnum, bool) { + enum, ok := mappingServiceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/simple_url_pattern.go b/networkfirewall/simple_url_pattern.go index e0327f73a6..c311c9b815 100644 --- a/networkfirewall/simple_url_pattern.go +++ b/networkfirewall/simple_url_pattern.go @@ -18,31 +18,10 @@ import ( // SimpleUrlPattern Pattern describing an http/https URL or set thereof // as a concatenation of optional host component and optional path component. -// Key points: -// 1. Use the specific URLs or construct the URL patterns you want to match using wildcard `*` and token characters `./`. -// 2. In the host component and path component don't enter consecutive wildcard `*` for example: `example.*.*.com`. -// 3. To match the exact domain and its subdirectories add a trailing slash `/` to your entry. -// 4. The firewall interprets entries that do not end in a `/` or `*` with an implicit asterisk `*` to their end, which further increases the potential matches. -// 5. The Use of multiple wildcards in a single pattern can impact the performance of the firewall. -// Domain/subdomains match examples: -// 1. `*.example.com.*` will match `sub1.sub2.example.com.info.us` and `sub1.example.com.us` and `sub1.example.com/subdirectory` but not match `sub1.example.com`. -// 2. `*.example.com` will match `sub1.example.com` and `sub1.sub2.example.com` and `sub1.example.com.au` but not match `example.com`. -// 3. `*.example.com/` will match `sub1.sub2.example.com` and `sub1.example.com` but not match `sub1.example.com.au`. -// 4. `example.com` will match `example.com` and `example.com.au` and `example.com.info.us` and `example.com/subdirectory`. -// 5. `example.com/` will match `example.com` and `example.com/foo` but not `example.com.info.us`. -// 6. `example.*.com` will match `example.sub1.com` and `example.sub1.sub2.com` and `example.sub1.com.au` and `example.sub1.com/subdirecroty`. -// 7. `example.*.com/` will match `example.sub1.com` and `example.sub1.sub2.com` and `example.sub1.com/subdirecroty` but not match `example.sub1.com.au`. -// 8. `example.com.*` will match `example.com.us` and `example.com.info.us` and `example.com.us/subdirectory` but not match `sub1.example.com`. -// Subdirectory or path match examples: -// 1. `example.com/*` will match `example.com/foo` and `example.com/bar` and any `example.com/subdirectory`. -// 2. `example.com/foo` will match `example.com/foo`. -// 3. `www.example.com/foo/*` will match `www.exampe.com/foo/subdiectory`, but not match `www.example.com/FOO` or `www.example.com/bar/subdirectory`. -// 4. `*.example.com/foo/*` will match `sub2.sub.example.com/foo/subdirectory` but not match `sub1.example.com/FOO` or `sub1.example.com/bar/subdirectory`. -// Other examples containing IP addresses in urls: -// 1. 103.12.14.122/ will match 103.12.14.122 and 103.12.14.122/subdirectory. -// 2. 103.12.14.122:8081/ will match 103.12.14.122:8081 and 103.12.14.122:8081/subdirectory. -// 3. 2607:9d80:4680:3f01:0000:0000:00d0:00c0/ will match 2607:9d80:4680:3f01:0000:0000:00d0:00c0 and 2607:9d80:4680:3f01:0000:0000:00d0:00c0/subdirecroty. -// 4. [2607:9d80:4680:3f01:0000:0000:00d0:00c0]:8081/ will match [2607:9d80:4680:3f01:0000:0000:00d0:00c0]:8081 and [2607:9d80:4680:3f01:0000:0000:00d0:00c0]:8081/subdirecroty. +// `*.example.com` will match http://example.com/ and https://foo.example.com/foo?bar. +// `www.example.com/foo*` will match https://www.example.com/foo and http://www.exampe.com/foobar and https://www.example.com/foo/bar?baz, but not +// http://sub.www.example.com/foo or https://www.example.com/FOO. +// `*.example.com/foo*` will match http://example.com/foo and https://sub2.sub.example.com/foo/bar?baz, but not http://example.com/FOO. type SimpleUrlPattern struct { // A string consisting of a concatenation of optional host component and optional path component. diff --git a/networkfirewall/ssl_forward_proxy_profile.go b/networkfirewall/ssl_forward_proxy_profile.go index dbe33dc038..1ec5040b9c 100644 --- a/networkfirewall/ssl_forward_proxy_profile.go +++ b/networkfirewall/ssl_forward_proxy_profile.go @@ -19,33 +19,49 @@ import ( // SslForwardProxyProfile SSLForwardProxy used on the firewall policy rules. type SslForwardProxyProfile struct { + // Unique Name of the decryption profile. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this decryption profile belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + // Whether to block sessions if server's certificate is expired. - IsExpiredCertificateBlocked *bool `mandatory:"true" json:"isExpiredCertificateBlocked"` + IsExpiredCertificateBlocked *bool `mandatory:"false" json:"isExpiredCertificateBlocked"` // Whether to block sessions if server's certificate is issued by an untrusted certificate authority (CA). - IsUntrustedIssuerBlocked *bool `mandatory:"true" json:"isUntrustedIssuerBlocked"` + IsUntrustedIssuerBlocked *bool `mandatory:"false" json:"isUntrustedIssuerBlocked"` // Whether to block sessions if the revocation status check for server's certificate // does not succeed within the maximum allowed time (defaulting to 5 seconds). - IsRevocationStatusTimeoutBlocked *bool `mandatory:"true" json:"isRevocationStatusTimeoutBlocked"` + IsRevocationStatusTimeoutBlocked *bool `mandatory:"false" json:"isRevocationStatusTimeoutBlocked"` // Whether to block sessions if SSL version is not supported. - IsUnsupportedVersionBlocked *bool `mandatory:"true" json:"isUnsupportedVersionBlocked"` + IsUnsupportedVersionBlocked *bool `mandatory:"false" json:"isUnsupportedVersionBlocked"` // Whether to block sessions if SSL cipher suite is not supported. - IsUnsupportedCipherBlocked *bool `mandatory:"true" json:"isUnsupportedCipherBlocked"` + IsUnsupportedCipherBlocked *bool `mandatory:"false" json:"isUnsupportedCipherBlocked"` // Whether to block sessions if the revocation status check for server's certificate results in "unknown". - IsUnknownRevocationStatusBlocked *bool `mandatory:"true" json:"isUnknownRevocationStatusBlocked"` + IsUnknownRevocationStatusBlocked *bool `mandatory:"false" json:"isUnknownRevocationStatusBlocked"` // Whether to block sessions if the server's certificate uses extensions other than key usage and/or extended key usage. - AreCertificateExtensionsRestricted *bool `mandatory:"true" json:"areCertificateExtensionsRestricted"` + AreCertificateExtensionsRestricted *bool `mandatory:"false" json:"areCertificateExtensionsRestricted"` // Whether to automatically append SAN to impersonating certificate if server certificate is missing SAN. - IsAutoIncludeAltName *bool `mandatory:"true" json:"isAutoIncludeAltName"` + IsAutoIncludeAltName *bool `mandatory:"false" json:"isAutoIncludeAltName"` // Whether to block sessions if the firewall is temporarily unable to decrypt their traffic. - IsOutOfCapacityBlocked *bool `mandatory:"true" json:"isOutOfCapacityBlocked"` + IsOutOfCapacityBlocked *bool `mandatory:"false" json:"isOutOfCapacityBlocked"` +} + +// GetName returns Name +func (m SslForwardProxyProfile) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m SslForwardProxyProfile) GetParentResourceId() *string { + return m.ParentResourceId } func (m SslForwardProxyProfile) String() string { diff --git a/networkfirewall/ssl_inbound_inspection_profile.go b/networkfirewall/ssl_inbound_inspection_profile.go index ea8a754483..c21b212413 100644 --- a/networkfirewall/ssl_inbound_inspection_profile.go +++ b/networkfirewall/ssl_inbound_inspection_profile.go @@ -19,14 +19,30 @@ import ( // SslInboundInspectionProfile SSLInboundInspection used on the firewall policy rules. type SslInboundInspectionProfile struct { + // Unique Name of the decryption profile. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this decryption profile belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + // Whether to block sessions if SSL version is not supported. - IsUnsupportedVersionBlocked *bool `mandatory:"true" json:"isUnsupportedVersionBlocked"` + IsUnsupportedVersionBlocked *bool `mandatory:"false" json:"isUnsupportedVersionBlocked"` // Whether to block sessions if SSL cipher suite is not supported. - IsUnsupportedCipherBlocked *bool `mandatory:"true" json:"isUnsupportedCipherBlocked"` + IsUnsupportedCipherBlocked *bool `mandatory:"false" json:"isUnsupportedCipherBlocked"` // Whether to block sessions if the firewall is temporarily unable to decrypt their traffic. - IsOutOfCapacityBlocked *bool `mandatory:"true" json:"isOutOfCapacityBlocked"` + IsOutOfCapacityBlocked *bool `mandatory:"false" json:"isOutOfCapacityBlocked"` +} + +// GetName returns Name +func (m SslInboundInspectionProfile) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m SslInboundInspectionProfile) GetParentResourceId() *string { + return m.ParentResourceId } func (m SslInboundInspectionProfile) String() string { diff --git a/networkfirewall/tcp_service.go b/networkfirewall/tcp_service.go new file mode 100644 index 0000000000..0d00c00e8b --- /dev/null +++ b/networkfirewall/tcp_service.go @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TcpService TCP Service used on the firewall policy rules. +type TcpService struct { + + // Name of the service. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this service belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + + // List of port-ranges used. + PortRanges []PortRange `mandatory:"true" json:"portRanges"` +} + +// GetName returns Name +func (m TcpService) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m TcpService) GetParentResourceId() *string { + return m.ParentResourceId +} + +func (m TcpService) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TcpService) 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 TcpService) MarshalJSON() (buff []byte, e error) { + type MarshalTypeTcpService TcpService + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeTcpService + }{ + "TCP_SERVICE", + (MarshalTypeTcpService)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/traffic_action_type.go b/networkfirewall/traffic_action_type.go new file mode 100644 index 0000000000..f623c81de0 --- /dev/null +++ b/networkfirewall/traffic_action_type.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// TrafficActionTypeEnum Enum with underlying type: string +type TrafficActionTypeEnum string + +// Set of constants representing the allowable values for TrafficActionTypeEnum +const ( + TrafficActionTypeAllow TrafficActionTypeEnum = "ALLOW" + TrafficActionTypeDrop TrafficActionTypeEnum = "DROP" + TrafficActionTypeReject TrafficActionTypeEnum = "REJECT" + TrafficActionTypeInspect TrafficActionTypeEnum = "INSPECT" +) + +var mappingTrafficActionTypeEnum = map[string]TrafficActionTypeEnum{ + "ALLOW": TrafficActionTypeAllow, + "DROP": TrafficActionTypeDrop, + "REJECT": TrafficActionTypeReject, + "INSPECT": TrafficActionTypeInspect, +} + +var mappingTrafficActionTypeEnumLowerCase = map[string]TrafficActionTypeEnum{ + "allow": TrafficActionTypeAllow, + "drop": TrafficActionTypeDrop, + "reject": TrafficActionTypeReject, + "inspect": TrafficActionTypeInspect, +} + +// GetTrafficActionTypeEnumValues Enumerates the set of values for TrafficActionTypeEnum +func GetTrafficActionTypeEnumValues() []TrafficActionTypeEnum { + values := make([]TrafficActionTypeEnum, 0) + for _, v := range mappingTrafficActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetTrafficActionTypeEnumStringValues Enumerates the set of values in String for TrafficActionTypeEnum +func GetTrafficActionTypeEnumStringValues() []string { + return []string{ + "ALLOW", + "DROP", + "REJECT", + "INSPECT", + } +} + +// GetMappingTrafficActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTrafficActionTypeEnum(val string) (TrafficActionTypeEnum, bool) { + enum, ok := mappingTrafficActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/traffic_inspection_type.go b/networkfirewall/traffic_inspection_type.go new file mode 100644 index 0000000000..51de23e548 --- /dev/null +++ b/networkfirewall/traffic_inspection_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "strings" +) + +// TrafficInspectionTypeEnum Enum with underlying type: string +type TrafficInspectionTypeEnum string + +// Set of constants representing the allowable values for TrafficInspectionTypeEnum +const ( + TrafficInspectionTypeIntrusionDetection TrafficInspectionTypeEnum = "INTRUSION_DETECTION" + TrafficInspectionTypeIntrusionPrevention TrafficInspectionTypeEnum = "INTRUSION_PREVENTION" +) + +var mappingTrafficInspectionTypeEnum = map[string]TrafficInspectionTypeEnum{ + "INTRUSION_DETECTION": TrafficInspectionTypeIntrusionDetection, + "INTRUSION_PREVENTION": TrafficInspectionTypeIntrusionPrevention, +} + +var mappingTrafficInspectionTypeEnumLowerCase = map[string]TrafficInspectionTypeEnum{ + "intrusion_detection": TrafficInspectionTypeIntrusionDetection, + "intrusion_prevention": TrafficInspectionTypeIntrusionPrevention, +} + +// GetTrafficInspectionTypeEnumValues Enumerates the set of values for TrafficInspectionTypeEnum +func GetTrafficInspectionTypeEnumValues() []TrafficInspectionTypeEnum { + values := make([]TrafficInspectionTypeEnum, 0) + for _, v := range mappingTrafficInspectionTypeEnum { + values = append(values, v) + } + return values +} + +// GetTrafficInspectionTypeEnumStringValues Enumerates the set of values in String for TrafficInspectionTypeEnum +func GetTrafficInspectionTypeEnumStringValues() []string { + return []string{ + "INTRUSION_DETECTION", + "INTRUSION_PREVENTION", + } +} + +// GetMappingTrafficInspectionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTrafficInspectionTypeEnum(val string) (TrafficInspectionTypeEnum, bool) { + enum, ok := mappingTrafficInspectionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkfirewall/udp_service.go b/networkfirewall/udp_service.go new file mode 100644 index 0000000000..4f8c29d8b8 --- /dev/null +++ b/networkfirewall/udp_service.go @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UdpService UDP Service used on the firewall policy rules. +type UdpService struct { + + // Name of the service. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this service belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + + // List of port-ranges used. + PortRanges []PortRange `mandatory:"true" json:"portRanges"` +} + +// GetName returns Name +func (m UdpService) GetName() *string { + return m.Name +} + +// GetParentResourceId returns ParentResourceId +func (m UdpService) GetParentResourceId() *string { + return m.ParentResourceId +} + +func (m UdpService) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UdpService) 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 UdpService) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUdpService UdpService + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUdpService + }{ + "UDP_SERVICE", + (MarshalTypeUdpService)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/update_address_list_details.go b/networkfirewall/update_address_list_details.go new file mode 100644 index 0000000000..9ef0f9f4ae --- /dev/null +++ b/networkfirewall/update_address_list_details.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateAddressListDetails The request details to be updated in the address List for the policy. +type UpdateAddressListDetails interface { +} + +type updateaddresslistdetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *updateaddresslistdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdateaddresslistdetails updateaddresslistdetails + s := struct { + Model Unmarshalerupdateaddresslistdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updateaddresslistdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "FQDN": + mm := UpdateFqdnAddressListDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "IP": + mm := UpdateIpAddressListDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateAddressListDetails: %s.", m.Type) + return *m, nil + } +} + +func (m updateaddresslistdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updateaddresslistdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_address_list_request_response.go b/networkfirewall/update_address_list_request_response.go new file mode 100644 index 0000000000..99ff90a22c --- /dev/null +++ b/networkfirewall/update_address_list_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateAddressListRequest wrapper for the UpdateAddressList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateAddressList.go.html to see an example of how to use UpdateAddressListRequest. +type UpdateAddressListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for address lists. + AddressListName *string `mandatory:"true" contributesTo:"path" name:"addressListName"` + + // The information to be updated. + UpdateAddressListDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAddressListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAddressListRequest) 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 UpdateAddressListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAddressListRequest) 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 UpdateAddressListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateAddressListResponse wrapper for the UpdateAddressList operation +type UpdateAddressListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AddressList instance + AddressList `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // 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 UpdateAddressListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAddressListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_application_details.go b/networkfirewall/update_application_details.go new file mode 100644 index 0000000000..662d3f44f7 --- /dev/null +++ b/networkfirewall/update_application_details.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateApplicationDetails Request for updating an existing application in context to the network firewall policy. +type UpdateApplicationDetails interface { +} + +type updateapplicationdetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *updateapplicationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdateapplicationdetails updateapplicationdetails + s := struct { + Model Unmarshalerupdateapplicationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updateapplicationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "ICMP_V6": + mm := UpdateIcmp6ApplicationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ICMP": + mm := UpdateIcmpApplicationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateApplicationDetails: %s.", m.Type) + return *m, nil + } +} + +func (m updateapplicationdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updateapplicationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_application_group_details.go b/networkfirewall/update_application_group_details.go new file mode 100644 index 0000000000..f85f91834e --- /dev/null +++ b/networkfirewall/update_application_group_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateApplicationGroupDetails Request for updating an existing application in context to the network firewall policy. +type UpdateApplicationGroupDetails struct { + + // Collection of application names. + Apps []string `mandatory:"true" json:"apps"` +} + +func (m UpdateApplicationGroupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateApplicationGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_application_group_request_response.go b/networkfirewall/update_application_group_request_response.go new file mode 100644 index 0000000000..55144ebf6e --- /dev/null +++ b/networkfirewall/update_application_group_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateApplicationGroupRequest wrapper for the UpdateApplicationGroup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateApplicationGroup.go.html to see an example of how to use UpdateApplicationGroupRequest. +type UpdateApplicationGroupRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for Application Lists in the scope of Network Firewall Policy. + ApplicationGroupName *string `mandatory:"true" contributesTo:"path" name:"applicationGroupName"` + + // The information to be updated. + UpdateApplicationGroupDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateApplicationGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateApplicationGroupRequest) 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 UpdateApplicationGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateApplicationGroupRequest) 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 UpdateApplicationGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateApplicationGroupResponse wrapper for the UpdateApplicationGroup operation +type UpdateApplicationGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ApplicationGroup instance + ApplicationGroup `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // 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 UpdateApplicationGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateApplicationGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_application_request_response.go b/networkfirewall/update_application_request_response.go new file mode 100644 index 0000000000..6c4ad06d7f --- /dev/null +++ b/networkfirewall/update_application_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateApplicationRequest wrapper for the UpdateApplication operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateApplication.go.html to see an example of how to use UpdateApplicationRequest. +type UpdateApplicationRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Applications. + ApplicationName *string `mandatory:"true" contributesTo:"path" name:"applicationName"` + + // The information to be updated. + UpdateApplicationDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateApplicationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateApplicationRequest) 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 UpdateApplicationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateApplicationRequest) 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 UpdateApplicationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateApplicationResponse wrapper for the UpdateApplication operation +type UpdateApplicationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Application instance + Application `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // 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 UpdateApplicationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateApplicationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_decryption_profile_details.go b/networkfirewall/update_decryption_profile_details.go new file mode 100644 index 0000000000..a65c12be10 --- /dev/null +++ b/networkfirewall/update_decryption_profile_details.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDecryptionProfileDetails Update Request for Decryption Profile used on the firewall policy rules. +type UpdateDecryptionProfileDetails interface { +} + +type updatedecryptionprofiledetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *updatedecryptionprofiledetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdatedecryptionprofiledetails updatedecryptionprofiledetails + s := struct { + Model Unmarshalerupdatedecryptionprofiledetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updatedecryptionprofiledetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "SSL_INBOUND_INSPECTION": + mm := UpdateSslInboundInspectionProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "SSL_FORWARD_PROXY": + mm := UpdateSslForwardProxyProfileDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateDecryptionProfileDetails: %s.", m.Type) + return *m, nil + } +} + +func (m updatedecryptionprofiledetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updatedecryptionprofiledetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_decryption_profile_request_response.go b/networkfirewall/update_decryption_profile_request_response.go new file mode 100644 index 0000000000..f90aa34e5a --- /dev/null +++ b/networkfirewall/update_decryption_profile_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 networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDecryptionProfileRequest wrapper for the UpdateDecryptionProfile operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateDecryptionProfile.go.html to see an example of how to use UpdateDecryptionProfileRequest. +type UpdateDecryptionProfileRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Decryption Profiles. + DecryptionProfileName *string `mandatory:"true" contributesTo:"path" name:"decryptionProfileName"` + + // The information to be updated. + UpdateDecryptionProfileDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateDecryptionProfileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDecryptionProfileRequest) 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 UpdateDecryptionProfileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDecryptionProfileRequest) 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 UpdateDecryptionProfileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDecryptionProfileResponse wrapper for the UpdateDecryptionProfile operation +type UpdateDecryptionProfileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DecryptionProfile instance + DecryptionProfile `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 UpdateDecryptionProfileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDecryptionProfileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_decryption_rule_details.go b/networkfirewall/update_decryption_rule_details.go new file mode 100644 index 0000000000..797ba9f403 --- /dev/null +++ b/networkfirewall/update_decryption_rule_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDecryptionRuleDetails Request for updating Decryption Rule used in the firewall policy rules. +// A Decryption Rule is used to define which traffic should be decrypted by the firewall, and how it should do so. +type UpdateDecryptionRuleDetails struct { + Condition *DecryptionRuleMatchCriteria `mandatory:"true" json:"condition"` + + // Action: + // * NO_DECRYPT - Matching traffic is not decrypted. + // * DECRYPT - Matching traffic is decrypted with the specified `secret` according to the specified `decryptionProfile`. + Action DecryptionActionTypeEnum `mandatory:"true" json:"action"` + + // The name of the decryption profile to use. + DecryptionProfile *string `mandatory:"false" json:"decryptionProfile"` + + // The name of a mapped secret. Its `type` must match that of the specified decryption profile. + Secret *string `mandatory:"false" json:"secret"` + + Position *RulePosition `mandatory:"false" json:"position"` +} + +func (m UpdateDecryptionRuleDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateDecryptionRuleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDecryptionActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetDecryptionActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_decryption_rule_request_response.go b/networkfirewall/update_decryption_rule_request_response.go new file mode 100644 index 0000000000..de6765f3a9 --- /dev/null +++ b/networkfirewall/update_decryption_rule_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 networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDecryptionRuleRequest wrapper for the UpdateDecryptionRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateDecryptionRule.go.html to see an example of how to use UpdateDecryptionRuleRequest. +type UpdateDecryptionRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Decryption Rules in the network firewall policy. + DecryptionRuleName *string `mandatory:"true" contributesTo:"path" name:"decryptionRuleName"` + + // The information to be updated. + UpdateDecryptionRuleDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateDecryptionRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDecryptionRuleRequest) 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 UpdateDecryptionRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDecryptionRuleRequest) 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 UpdateDecryptionRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDecryptionRuleResponse wrapper for the UpdateDecryptionRule operation +type UpdateDecryptionRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DecryptionRule instance + DecryptionRule `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 UpdateDecryptionRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDecryptionRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_fqdn_address_list_details.go b/networkfirewall/update_fqdn_address_list_details.go new file mode 100644 index 0000000000..e8c2897041 --- /dev/null +++ b/networkfirewall/update_fqdn_address_list_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateFqdnAddressListDetails The request details to be updated in the address List for the policy. +type UpdateFqdnAddressListDetails struct { + + // List of FQDN addresses. + Addresses []string `mandatory:"true" json:"addresses"` +} + +func (m UpdateFqdnAddressListDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateFqdnAddressListDetails) 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 UpdateFqdnAddressListDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateFqdnAddressListDetails UpdateFqdnAddressListDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdateFqdnAddressListDetails + }{ + "FQDN", + (MarshalTypeUpdateFqdnAddressListDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/update_icmp6_application_details.go b/networkfirewall/update_icmp6_application_details.go new file mode 100644 index 0000000000..0d3f559e89 --- /dev/null +++ b/networkfirewall/update_icmp6_application_details.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateIcmp6ApplicationDetails Request for updating ICMP6 Application used on the firewall policy rules. +type UpdateIcmp6ApplicationDetails struct { + + // The value of the ICMP6 message Type field as defined by RFC 4443 (https://www.rfc-editor.org/rfc/rfc4443.html#section-2.1). + IcmpType *int `mandatory:"true" json:"icmpType"` + + // The value of the ICMP6 message Code (subtype) field as defined by RFC 4443 (https://www.rfc-editor.org/rfc/rfc4443.html#section-2.1). + IcmpCode *int `mandatory:"false" json:"icmpCode"` +} + +func (m UpdateIcmp6ApplicationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateIcmp6ApplicationDetails) 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 UpdateIcmp6ApplicationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateIcmp6ApplicationDetails UpdateIcmp6ApplicationDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdateIcmp6ApplicationDetails + }{ + "ICMP_V6", + (MarshalTypeUpdateIcmp6ApplicationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/update_icmp_application_details.go b/networkfirewall/update_icmp_application_details.go new file mode 100644 index 0000000000..a40388837a --- /dev/null +++ b/networkfirewall/update_icmp_application_details.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateIcmpApplicationDetails Request for updating ICMP Application used on the firewall policy rules. +type UpdateIcmpApplicationDetails struct { + + // The value of the ICMP message Type field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpType *int `mandatory:"true" json:"icmpType"` + + // The value of the ICMP message Code (subtype) field as defined by RFC 792 (https://www.rfc-editor.org/rfc/rfc792.html). + IcmpCode *int `mandatory:"false" json:"icmpCode"` +} + +func (m UpdateIcmpApplicationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateIcmpApplicationDetails) 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 UpdateIcmpApplicationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateIcmpApplicationDetails UpdateIcmpApplicationDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdateIcmpApplicationDetails + }{ + "ICMP", + (MarshalTypeUpdateIcmpApplicationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/update_ip_address_list_details.go b/networkfirewall/update_ip_address_list_details.go new file mode 100644 index 0000000000..7420d99412 --- /dev/null +++ b/networkfirewall/update_ip_address_list_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateIpAddressListDetails The request details to be updated in the address List for the policy. +type UpdateIpAddressListDetails struct { + + // List of IP addresses which could be IPv4 or IPv6 addresses or CIDR blocks. + Addresses []string `mandatory:"true" json:"addresses"` +} + +func (m UpdateIpAddressListDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateIpAddressListDetails) 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 UpdateIpAddressListDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateIpAddressListDetails UpdateIpAddressListDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdateIpAddressListDetails + }{ + "IP", + (MarshalTypeUpdateIpAddressListDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/update_mapped_secret_details.go b/networkfirewall/update_mapped_secret_details.go new file mode 100644 index 0000000000..9a2a681b89 --- /dev/null +++ b/networkfirewall/update_mapped_secret_details.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateMappedSecretDetails The request details to be updated in the Mapped Secret for the policy. +type UpdateMappedSecretDetails interface { + + // Type of the secrets mapped based on the policy. + // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. + // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. + GetType() InspectionTypeEnum +} + +type updatemappedsecretdetails struct { + JsonData []byte + Type InspectionTypeEnum `mandatory:"true" json:"type"` + Source string `json:"source"` +} + +// UnmarshalJSON unmarshals json +func (m *updatemappedsecretdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdatemappedsecretdetails updatemappedsecretdetails + s := struct { + Model Unmarshalerupdatemappedsecretdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + m.Source = s.Model.Source + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updatemappedsecretdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Source { + case "OCI_VAULT": + mm := UpdateVaultMappedSecretDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateMappedSecretDetails: %s.", m.Source) + return *m, nil + } +} + +// GetType returns Type +func (m updatemappedsecretdetails) GetType() InspectionTypeEnum { + return m.Type +} + +func (m updatemappedsecretdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updatemappedsecretdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_mapped_secret_request_response.go b/networkfirewall/update_mapped_secret_request_response.go new file mode 100644 index 0000000000..aedfaefd3b --- /dev/null +++ b/networkfirewall/update_mapped_secret_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateMappedSecretRequest wrapper for the UpdateMappedSecret operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateMappedSecret.go.html to see an example of how to use UpdateMappedSecretRequest. +type UpdateMappedSecretRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Mapped Secrets. + MappedSecretName *string `mandatory:"true" contributesTo:"path" name:"mappedSecretName"` + + // The information to be updated. + UpdateMappedSecretDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateMappedSecretRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateMappedSecretRequest) 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 UpdateMappedSecretRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateMappedSecretRequest) 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 UpdateMappedSecretRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateMappedSecretResponse wrapper for the UpdateMappedSecret operation +type UpdateMappedSecretResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MappedSecret instance + MappedSecret `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // 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 UpdateMappedSecretResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateMappedSecretResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_network_firewall_details.go b/networkfirewall/update_network_firewall_details.go index 25466816d6..ae0b4a1fe7 100644 --- a/networkfirewall/update_network_firewall_details.go +++ b/networkfirewall/update_network_firewall_details.go @@ -27,12 +27,14 @@ type UpdateNetworkFirewallDetails struct { // An array of network security groups OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with the Network Firewall. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` - // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. - // Example: `{"bar-key": "value"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff --git a/networkfirewall/update_network_firewall_policy_details.go b/networkfirewall/update_network_firewall_policy_details.go index 0699d0aab0..765f769cee 100644 --- a/networkfirewall/update_network_firewall_policy_details.go +++ b/networkfirewall/update_network_firewall_policy_details.go @@ -10,7 +10,6 @@ package networkfirewall import ( - "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -22,45 +21,14 @@ type UpdateNetworkFirewallPolicyDetails struct { // A user-friendly name for the firewall. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` - // Map defining secrets of the policy. - // The value of an entry is a "mapped secret" consisting of a purpose and source. - // The associated key is the identifier by which the mapped secret is referenced. - MappedSecrets map[string]MappedSecret `mandatory:"false" json:"mappedSecrets"` - - // Map defining application lists of the policy. - // The value of an entry is a list of "applications", each consisting of a protocol identifier (such as TCP, UDP, or ICMP) and protocol-specific parameters (such as a port range). - // The associated key is the identifier by which the application list is referenced. - ApplicationLists map[string][]Application `mandatory:"false" json:"applicationLists"` - - // Map defining URL pattern lists of the policy. - // The value of an entry is a list of URL patterns. - // The associated key is the identifier by which the URL pattern list is referenced. - UrlLists map[string][]UrlPattern `mandatory:"false" json:"urlLists"` - - // Map defining IP address lists of the policy. - // The value of an entry is a list of IP addresses or prefixes in CIDR notation. - // The associated key is the identifier by which the IP address list is referenced. - IpAddressLists map[string][]string `mandatory:"false" json:"ipAddressLists"` - - // List of Security Rules defining the behavior of the policy. - // The first rule with a matching condition determines the action taken upon network traffic. - SecurityRules []SecurityRule `mandatory:"false" json:"securityRules"` - - // List of Decryption Rules defining the behavior of the policy. - // The first rule with a matching condition determines the action taken upon network traffic. - DecryptionRules []DecryptionRule `mandatory:"false" json:"decryptionRules"` - - // Map defining decryption profiles of the policy. - // The value of an entry is a decryption profile. - // The associated key is the identifier by which the decryption profile is referenced. - DecryptionProfiles map[string]DecryptionProfile `mandatory:"false" json:"decryptionProfiles"` - - // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. - // Example: `{"bar-key": "value"}` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // Example: `{"foo-namespace": {"bar-key": "value"}}` + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -79,68 +47,3 @@ func (m UpdateNetworkFirewallPolicyDetails) ValidateEnumValue() (bool, error) { } return false, nil } - -// UnmarshalJSON unmarshals from json -func (m *UpdateNetworkFirewallPolicyDetails) UnmarshalJSON(data []byte) (e error) { - model := struct { - DisplayName *string `json:"displayName"` - MappedSecrets map[string]mappedsecret `json:"mappedSecrets"` - ApplicationLists map[string][]Application `json:"applicationLists"` - UrlLists map[string][]UrlPattern `json:"urlLists"` - IpAddressLists map[string][]string `json:"ipAddressLists"` - SecurityRules []SecurityRule `json:"securityRules"` - DecryptionRules []DecryptionRule `json:"decryptionRules"` - DecryptionProfiles map[string]decryptionprofile `json:"decryptionProfiles"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - }{} - - e = json.Unmarshal(data, &model) - if e != nil { - return - } - var nn interface{} - m.DisplayName = model.DisplayName - - m.MappedSecrets = make(map[string]MappedSecret) - for k, v := range model.MappedSecrets { - nn, e = v.UnmarshalPolymorphicJSON(v.JsonData) - if e != nil { - return e - } - if nn != nil { - m.MappedSecrets[k] = nn.(MappedSecret) - } else { - m.MappedSecrets[k] = nil - } - } - - m.ApplicationLists = model.ApplicationLists - - m.UrlLists = model.UrlLists - - m.IpAddressLists = model.IpAddressLists - - m.SecurityRules = make([]SecurityRule, len(model.SecurityRules)) - copy(m.SecurityRules, model.SecurityRules) - m.DecryptionRules = make([]DecryptionRule, len(model.DecryptionRules)) - copy(m.DecryptionRules, model.DecryptionRules) - m.DecryptionProfiles = make(map[string]DecryptionProfile) - for k, v := range model.DecryptionProfiles { - nn, e = v.UnmarshalPolymorphicJSON(v.JsonData) - if e != nil { - return e - } - if nn != nil { - m.DecryptionProfiles[k] = nn.(DecryptionProfile) - } else { - m.DecryptionProfiles[k] = nil - } - } - - m.FreeformTags = model.FreeformTags - - m.DefinedTags = model.DefinedTags - - return -} diff --git a/networkfirewall/update_security_rule_details.go b/networkfirewall/update_security_rule_details.go new file mode 100644 index 0000000000..f54b84bd84 --- /dev/null +++ b/networkfirewall/update_security_rule_details.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateSecurityRuleDetails Update Request for Security Rule used in the firewall policy rules. +// Security Rules determine whether to block or allow a session based on traffic attributes, +// such as the source and destination IP address, protocol/port, and the HTTP(S) target URL. +type UpdateSecurityRuleDetails struct { + Condition *SecurityRuleMatchCriteria `mandatory:"true" json:"condition"` + + // Types of Action on the Traffic flow. + // * ALLOW - Allows the traffic. + // * DROP - Silently drops the traffic, e.g. without sending a TCP reset. + // * REJECT - Rejects the traffic, sending a TCP reset to client and/or server as applicable. + // * INSPECT - Inspects traffic for vulnerability as specified in `inspection`, which may result in rejection. + Action TrafficActionTypeEnum `mandatory:"true" json:"action"` + + // Type of inspection to affect the Traffic flow. This is only applicable if action is INSPECT. + // * INTRUSION_DETECTION - Intrusion Detection. + // * INTRUSION_PREVENTION - Intrusion Detection and Prevention. Traffic classified as potentially malicious will be rejected as described in `type`. + Inspection TrafficInspectionTypeEnum `mandatory:"false" json:"inspection,omitempty"` + + Position *RulePosition `mandatory:"false" json:"position"` +} + +func (m UpdateSecurityRuleDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateSecurityRuleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTrafficActionTypeEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetTrafficActionTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingTrafficInspectionTypeEnum(string(m.Inspection)); !ok && m.Inspection != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Inspection: %s. Supported values are: %s.", m.Inspection, strings.Join(GetTrafficInspectionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_security_rule_request_response.go b/networkfirewall/update_security_rule_request_response.go new file mode 100644 index 0000000000..22d29b2ba8 --- /dev/null +++ b/networkfirewall/update_security_rule_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 networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateSecurityRuleRequest wrapper for the UpdateSecurityRule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateSecurityRule.go.html to see an example of how to use UpdateSecurityRuleRequest. +type UpdateSecurityRuleRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Security Rules in the network firewall policy. + SecurityRuleName *string `mandatory:"true" contributesTo:"path" name:"securityRuleName"` + + // The information to be updated. + UpdateSecurityRuleDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateSecurityRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSecurityRuleRequest) 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 UpdateSecurityRuleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSecurityRuleRequest) 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 UpdateSecurityRuleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateSecurityRuleResponse wrapper for the UpdateSecurityRule operation +type UpdateSecurityRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SecurityRule instance + SecurityRule `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 UpdateSecurityRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSecurityRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_service_details.go b/networkfirewall/update_service_details.go new file mode 100644 index 0000000000..4c0ad78b72 --- /dev/null +++ b/networkfirewall/update_service_details.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateServiceDetails Request for updating an existing service in context to the network firewall policy. +type UpdateServiceDetails interface { +} + +type updateservicedetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *updateservicedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdateservicedetails updateservicedetails + s := struct { + Model Unmarshalerupdateservicedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updateservicedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "TCP_SERVICE": + mm := UpdateTcpServiceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "UDP_SERVICE": + mm := UpdateUdpServiceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateServiceDetails: %s.", m.Type) + return *m, nil + } +} + +func (m updateservicedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updateservicedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_service_list_details.go b/networkfirewall/update_service_list_details.go new file mode 100644 index 0000000000..c710829b72 --- /dev/null +++ b/networkfirewall/update_service_list_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateServiceListDetails Request for updating an existing service in context to the network firewall policy. +type UpdateServiceListDetails struct { + + // Collection of service names. + Services []string `mandatory:"true" json:"services"` +} + +func (m UpdateServiceListDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateServiceListDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/update_service_list_request_response.go b/networkfirewall/update_service_list_request_response.go new file mode 100644 index 0000000000..273d9fc2b2 --- /dev/null +++ b/networkfirewall/update_service_list_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 networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateServiceListRequest wrapper for the UpdateServiceList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateServiceList.go.html to see an example of how to use UpdateServiceListRequest. +type UpdateServiceListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for Service Lists in the scope of Network Firewall Policy. + ServiceListName *string `mandatory:"true" contributesTo:"path" name:"serviceListName"` + + // The information to be updated. + UpdateServiceListDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateServiceListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateServiceListRequest) 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 UpdateServiceListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateServiceListRequest) 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 UpdateServiceListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateServiceListResponse wrapper for the UpdateServiceList operation +type UpdateServiceListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceList instance + ServiceList `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 UpdateServiceListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateServiceListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_service_request_response.go b/networkfirewall/update_service_request_response.go new file mode 100644 index 0000000000..6344d571be --- /dev/null +++ b/networkfirewall/update_service_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateServiceRequest wrapper for the UpdateService operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateService.go.html to see an example of how to use UpdateServiceRequest. +type UpdateServiceRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique identifier for Services. + ServiceName *string `mandatory:"true" contributesTo:"path" name:"serviceName"` + + // The information to be updated. + UpdateServiceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateServiceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateServiceRequest) 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 UpdateServiceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateServiceRequest) 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 UpdateServiceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateServiceResponse wrapper for the UpdateService operation +type UpdateServiceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Service instance + Service `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. This is to get the page counts overall. + OpcPageCount *string `presentIn:"header" name:"opc-page-count"` + + // For pagination of a list of items. This provides the count of total items across pages. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // 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 UpdateServiceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateServiceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_ssl_forward_proxy_profile_details.go b/networkfirewall/update_ssl_forward_proxy_profile_details.go new file mode 100644 index 0000000000..86223a6654 --- /dev/null +++ b/networkfirewall/update_ssl_forward_proxy_profile_details.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateSslForwardProxyProfileDetails Update Request for SSLForwardProxy used on the firewall policy rules. +type UpdateSslForwardProxyProfileDetails struct { + + // Whether to block sessions if server's certificate is expired. + IsExpiredCertificateBlocked *bool `mandatory:"false" json:"isExpiredCertificateBlocked"` + + // Whether to block sessions if server's certificate is issued by an untrusted certificate authority (CA). + IsUntrustedIssuerBlocked *bool `mandatory:"false" json:"isUntrustedIssuerBlocked"` + + // Whether to block sessions if the revocation status check for server's certificate + // does not succeed within the maximum allowed time (defaulting to 5 seconds). + IsRevocationStatusTimeoutBlocked *bool `mandatory:"false" json:"isRevocationStatusTimeoutBlocked"` + + // Whether to block sessions if SSL version is not supported. + IsUnsupportedVersionBlocked *bool `mandatory:"false" json:"isUnsupportedVersionBlocked"` + + // Whether to block sessions if SSL cipher suite is not supported. + IsUnsupportedCipherBlocked *bool `mandatory:"false" json:"isUnsupportedCipherBlocked"` + + // Whether to block sessions if the revocation status check for server's certificate results in "unknown". + IsUnknownRevocationStatusBlocked *bool `mandatory:"false" json:"isUnknownRevocationStatusBlocked"` + + // Whether to block sessions if the server's certificate uses extensions other than key usage and/or extended key usage. + AreCertificateExtensionsRestricted *bool `mandatory:"false" json:"areCertificateExtensionsRestricted"` + + // Whether to automatically append SAN to impersonating certificate if server certificate is missing SAN. + IsAutoIncludeAltName *bool `mandatory:"false" json:"isAutoIncludeAltName"` + + // Whether to block sessions if the firewall is temporarily unable to decrypt their traffic. + IsOutOfCapacityBlocked *bool `mandatory:"false" json:"isOutOfCapacityBlocked"` +} + +func (m UpdateSslForwardProxyProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateSslForwardProxyProfileDetails) 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 UpdateSslForwardProxyProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateSslForwardProxyProfileDetails UpdateSslForwardProxyProfileDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdateSslForwardProxyProfileDetails + }{ + "SSL_FORWARD_PROXY", + (MarshalTypeUpdateSslForwardProxyProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/update_ssl_inbound_inspection_profile_details.go b/networkfirewall/update_ssl_inbound_inspection_profile_details.go new file mode 100644 index 0000000000..53289d5216 --- /dev/null +++ b/networkfirewall/update_ssl_inbound_inspection_profile_details.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateSslInboundInspectionProfileDetails Update Request for SSLInboundInspection used on the firewall policy rules. +type UpdateSslInboundInspectionProfileDetails struct { + + // Whether to block sessions if SSL version is not supported. + IsUnsupportedVersionBlocked *bool `mandatory:"false" json:"isUnsupportedVersionBlocked"` + + // Whether to block sessions if SSL cipher suite is not supported. + IsUnsupportedCipherBlocked *bool `mandatory:"false" json:"isUnsupportedCipherBlocked"` + + // Whether to block sessions if the firewall is temporarily unable to decrypt their traffic. + IsOutOfCapacityBlocked *bool `mandatory:"false" json:"isOutOfCapacityBlocked"` +} + +func (m UpdateSslInboundInspectionProfileDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateSslInboundInspectionProfileDetails) 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 UpdateSslInboundInspectionProfileDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateSslInboundInspectionProfileDetails UpdateSslInboundInspectionProfileDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdateSslInboundInspectionProfileDetails + }{ + "SSL_INBOUND_INSPECTION", + (MarshalTypeUpdateSslInboundInspectionProfileDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/udp_application.go b/networkfirewall/update_tcp_service_details.go similarity index 63% rename from networkfirewall/udp_application.go rename to networkfirewall/update_tcp_service_details.go index 5ffab40898..4c19b03725 100644 --- a/networkfirewall/udp_application.go +++ b/networkfirewall/update_tcp_service_details.go @@ -16,24 +16,21 @@ import ( "strings" ) -// UdpApplication UDP Application used on the firewall policy rules. -type UdpApplication struct { +// UpdateTcpServiceDetails Request for updating TCP Service. +type UpdateTcpServiceDetails struct { - // The minimum port in the range (inclusive), or the sole port of a single-port range. - MinimumPort *int `mandatory:"true" json:"minimumPort"` - - // The maximum port in the range (inclusive), which may be absent for a single-port range. - MaximumPort *int `mandatory:"false" json:"maximumPort"` + // List of port-ranges to be used. + PortRanges []PortRange `mandatory:"true" json:"portRanges"` } -func (m UdpApplication) String() string { +func (m UpdateTcpServiceDetails) String() string { return common.PointerString(m) } // ValidateEnumValue returns an error when providing an unsupported enum value // This function is being called during constructing API request process // Not recommended for calling this function directly -func (m UdpApplication) ValidateEnumValue() (bool, error) { +func (m UpdateTcpServiceDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { @@ -43,14 +40,14 @@ func (m UdpApplication) ValidateEnumValue() (bool, error) { } // MarshalJSON marshals to json representation -func (m UdpApplication) MarshalJSON() (buff []byte, e error) { - type MarshalTypeUdpApplication UdpApplication +func (m UpdateTcpServiceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateTcpServiceDetails UpdateTcpServiceDetails s := struct { DiscriminatorParam string `json:"type"` - MarshalTypeUdpApplication + MarshalTypeUpdateTcpServiceDetails }{ - "UDP", - (MarshalTypeUdpApplication)(m), + "TCP_SERVICE", + (MarshalTypeUpdateTcpServiceDetails)(m), } return json.Marshal(&s) diff --git a/networkfirewall/update_udp_service_details.go b/networkfirewall/update_udp_service_details.go new file mode 100644 index 0000000000..4a4c8e58ec --- /dev/null +++ b/networkfirewall/update_udp_service_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateUdpServiceDetails Request for updating UDP Service used on the firewall policy rules. +type UpdateUdpServiceDetails struct { + + // List of port-ranges to be used. + PortRanges []PortRange `mandatory:"true" json:"portRanges"` +} + +func (m UpdateUdpServiceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateUdpServiceDetails) 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 UpdateUdpServiceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateUdpServiceDetails UpdateUdpServiceDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdateUdpServiceDetails + }{ + "UDP_SERVICE", + (MarshalTypeUpdateUdpServiceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/update_url_list_details.go b/networkfirewall/update_url_list_details.go new file mode 100644 index 0000000000..3315f0c904 --- /dev/null +++ b/networkfirewall/update_url_list_details.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateUrlListDetails The request details to be updated in the URL List for the policy. +type UpdateUrlListDetails struct { + + // List of urls. + Urls []UrlPattern `mandatory:"true" json:"urls"` +} + +func (m UpdateUrlListDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateUrlListDetails) 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 *UpdateUrlListDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Urls []urlpattern `json:"urls"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Urls = make([]UrlPattern, len(model.Urls)) + for i, n := range model.Urls { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Urls[i] = nn.(UrlPattern) + } else { + m.Urls[i] = nil + } + } + return +} diff --git a/networkfirewall/update_url_list_request_response.go b/networkfirewall/update_url_list_request_response.go new file mode 100644 index 0000000000..4b931381ce --- /dev/null +++ b/networkfirewall/update_url_list_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 networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateUrlListRequest wrapper for the UpdateUrlList operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkfirewall/UpdateUrlList.go.html to see an example of how to use UpdateUrlListRequest. +type UpdateUrlListRequest struct { + + // Unique Network Firewall Policy identifier + NetworkFirewallPolicyId *string `mandatory:"true" contributesTo:"path" name:"networkFirewallPolicyId"` + + // Unique name identifier for url lists in the scope of Network Firewall Policy. + UrlListName *string `mandatory:"true" contributesTo:"path" name:"urlListName"` + + // The information to be updated. + UpdateUrlListDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateUrlListRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateUrlListRequest) 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 UpdateUrlListRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateUrlListRequest) 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 UpdateUrlListRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateUrlListResponse wrapper for the UpdateUrlList operation +type UpdateUrlListResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The UrlList instance + UrlList `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 UpdateUrlListResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateUrlListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/networkfirewall/update_vault_mapped_secret_details.go b/networkfirewall/update_vault_mapped_secret_details.go new file mode 100644 index 0000000000..76303b996a --- /dev/null +++ b/networkfirewall/update_vault_mapped_secret_details.go @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateVaultMappedSecretDetails The request details to be updated in the Vault Mapped Secret for the policy. +type UpdateVaultMappedSecretDetails struct { + + // OCID for the Vault Secret to be used. + VaultSecretId *string `mandatory:"true" json:"vaultSecretId"` + + // Version number of the secret to be used. + VersionNumber *int `mandatory:"true" json:"versionNumber"` + + // Type of the secrets mapped based on the policy. + // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. + // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. + Type InspectionTypeEnum `mandatory:"true" json:"type"` +} + +// GetType returns Type +func (m UpdateVaultMappedSecretDetails) GetType() InspectionTypeEnum { + return m.Type +} + +func (m UpdateVaultMappedSecretDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateVaultMappedSecretDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateVaultMappedSecretDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateVaultMappedSecretDetails UpdateVaultMappedSecretDetails + s := struct { + DiscriminatorParam string `json:"source"` + MarshalTypeUpdateVaultMappedSecretDetails + }{ + "OCI_VAULT", + (MarshalTypeUpdateVaultMappedSecretDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/networkfirewall/url_list.go b/networkfirewall/url_list.go new file mode 100644 index 0000000000..c2df35fb07 --- /dev/null +++ b/networkfirewall/url_list.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UrlList URL pattern lists of the policy. +// The value of an entry is a list of URL patterns. +// The associated key/name is the identifier by which the URL pattern list is referenced. +type UrlList struct { + + // Unique name identifier for the URL list. + Name *string `mandatory:"true" json:"name"` + + // List of urls. + Urls []UrlPattern `mandatory:"true" json:"urls"` + + // Total count of URLs in the URL List + TotalUrls *int `mandatory:"true" json:"totalUrls"` + + // OCID of the Network Firewall Policy this URL List belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m UrlList) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UrlList) 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 *UrlList) UnmarshalJSON(data []byte) (e error) { + model := struct { + Name *string `json:"name"` + Urls []urlpattern `json:"urls"` + TotalUrls *int `json:"totalUrls"` + ParentResourceId *string `json:"parentResourceId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Name = model.Name + + m.Urls = make([]UrlPattern, len(model.Urls)) + for i, n := range model.Urls { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Urls[i] = nn.(UrlPattern) + } else { + m.Urls[i] = nil + } + } + m.TotalUrls = model.TotalUrls + + m.ParentResourceId = model.ParentResourceId + + return +} diff --git a/networkfirewall/url_list_summary.go b/networkfirewall/url_list_summary.go new file mode 100644 index 0000000000..a4b1ec575e --- /dev/null +++ b/networkfirewall/url_list_summary.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. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UrlListSummary URL List Summary in the network firewall policy +type UrlListSummary struct { + + // Name of URL List + Name *string `mandatory:"true" json:"name"` + + // Total count of URLs in the URL List + TotalUrls *int `mandatory:"true" json:"totalUrls"` + + // OCID of the Network Firewall Policy this mapped secret belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` +} + +func (m UrlListSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UrlListSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/url_list_summary_collection.go b/networkfirewall/url_list_summary_collection.go new file mode 100644 index 0000000000..19ced4f189 --- /dev/null +++ b/networkfirewall/url_list_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Network Firewall API +// +// Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. +// + +package networkfirewall + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UrlListSummaryCollection Collection of URL Lists in the network firewall policy +type UrlListSummaryCollection struct { + + // Collection of url lists. + Items []UrlListSummary `mandatory:"true" json:"items"` +} + +func (m UrlListSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UrlListSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkfirewall/vault_mapped_secret.go b/networkfirewall/vault_mapped_secret.go index 4051ac52ae..44558d2f28 100644 --- a/networkfirewall/vault_mapped_secret.go +++ b/networkfirewall/vault_mapped_secret.go @@ -19,6 +19,12 @@ import ( // VaultMappedSecret Mapped secret stored in OCI vault used in the firewall policy rules. type VaultMappedSecret struct { + // Name of the secret. + Name *string `mandatory:"true" json:"name"` + + // OCID of the Network Firewall Policy this Mapped Secret belongs to. + ParentResourceId *string `mandatory:"true" json:"parentResourceId"` + // OCID for the Vault Secret to be used. VaultSecretId *string `mandatory:"true" json:"vaultSecretId"` @@ -28,14 +34,24 @@ type VaultMappedSecret struct { // Type of the secrets mapped based on the policy. // * `SSL_INBOUND_INSPECTION`: For Inbound inspection of SSL traffic. // * `SSL_FORWARD_PROXY`: For forward proxy certificates for SSL inspection. - Type MappedSecretTypeEnum `mandatory:"true" json:"type"` + Type InspectionTypeEnum `mandatory:"true" json:"type"` +} + +// GetName returns Name +func (m VaultMappedSecret) GetName() *string { + return m.Name } // GetType returns Type -func (m VaultMappedSecret) GetType() MappedSecretTypeEnum { +func (m VaultMappedSecret) GetType() InspectionTypeEnum { return m.Type } +// GetParentResourceId returns ParentResourceId +func (m VaultMappedSecret) GetParentResourceId() *string { + return m.ParentResourceId +} + func (m VaultMappedSecret) String() string { return common.PointerString(m) } @@ -46,8 +62,8 @@ func (m VaultMappedSecret) String() string { func (m VaultMappedSecret) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingMappedSecretTypeEnum(string(m.Type)); !ok && m.Type != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetMappedSecretTypeEnumStringValues(), ","))) + if _, ok := GetMappingInspectionTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetInspectionTypeEnumStringValues(), ","))) } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/oci.go b/oci.go index a3c021d380..093da5479f 100644 --- a/oci.go +++ b/oci.go @@ -379,7 +379,7 @@ or for all requests made by all clients: common.GlobalRetry = &defaultRetryPolicy -or setting default retry via environment varaible, which is a global switch for all services: +or setting default retry via environment variable, which is a global switch for all services: export OCI_SDK_DEFAULT_RETRY_ENABLED=TRUE @@ -530,6 +530,23 @@ You can overwrite the target host with client.Host: If you are authenticating via instance principals, you can set the authentication endpoint in an environment variable: export OCI_SDK_AUTH_CLIENT_REGION_URL="https://identity.us-gov-phoenix-1.oraclegovcloud.com" +Using custom CA Bundle or custom client certs + +In order to use a custom CA bundle, you can set the environment variable OCI_DEFAULT_CERTS_PATH to point to the path of custom CA Bundle you want +the OCI GO SDK to use while making API calls to the OCI services + +If you additionally want to set custom leaf/client certs, then you can use the the environment variables OCI_DEFAULT_CLIENT_CERTS_PATH and OCI_DEFAULT_CLIENT_CERTS_PRIVATE_KEY_PATH +to set the path of the custom client/leaf cert and the private key respectively. + + +Configuring or disabling the refresh interval for custom CA bundles or client certs + +The default refresh interval for custom CA bundle or client certs is 30 minutes. If you want to modify this, then you can configure the refresh interval in minutes +by using either the Global property OciGlobalRefreshIntervalForCustomCerts defined in the common package or set the environment variable OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS +to set it instead. + +Please note, that the property OciGlobalRefreshIntervalForCustomCerts has a higher precedence than the environment variable OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS. +If this value is negative, then it would be assumed that it is unset. If it is set to 0, then the SDK would disable the custom ca bundle and client cert refresh Contributions diff --git a/redis/action_type.go b/redis/action_type.go new file mode 100644 index 0000000000..a2951a1540 --- /dev/null +++ b/redis/action_type.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "strings" +) + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeCreated ActionTypeEnum = "CREATED" + ActionTypeUpdated ActionTypeEnum = "UPDATED" + ActionTypeDeleted ActionTypeEnum = "DELETED" + ActionTypeInProgress ActionTypeEnum = "IN_PROGRESS" + ActionTypeRelated ActionTypeEnum = "RELATED" + ActionTypeFailed ActionTypeEnum = "FAILED" +) + +var mappingActionTypeEnum = map[string]ActionTypeEnum{ + "CREATED": ActionTypeCreated, + "UPDATED": ActionTypeUpdated, + "DELETED": ActionTypeDeleted, + "IN_PROGRESS": ActionTypeInProgress, + "RELATED": ActionTypeRelated, + "FAILED": ActionTypeFailed, +} + +var mappingActionTypeEnumLowerCase = map[string]ActionTypeEnum{ + "created": ActionTypeCreated, + "updated": ActionTypeUpdated, + "deleted": ActionTypeDeleted, + "in_progress": ActionTypeInProgress, + "related": ActionTypeRelated, + "failed": ActionTypeFailed, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionTypeEnumStringValues Enumerates the set of values in String for ActionTypeEnum +func GetActionTypeEnumStringValues() []string { + return []string{ + "CREATED", + "UPDATED", + "DELETED", + "IN_PROGRESS", + "RELATED", + "FAILED", + } +} + +// GetMappingActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionTypeEnum(val string) (ActionTypeEnum, bool) { + enum, ok := mappingActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/cancel_work_request_request_response.go b/redis/cancel_work_request_request_response.go new file mode 100644 index 0000000000..fb39e2c05f --- /dev/null +++ b/redis/cancel_work_request_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 redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelWorkRequestRequest wrapper for the CancelWorkRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequestRequest. +type CancelWorkRequestRequest struct { + + // The the asynchronous request ID. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelWorkRequestResponse wrapper for the CancelWorkRequest operation +type CancelWorkRequestResponse 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 CancelWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/redis/change_redis_cluster_compartment_details.go b/redis/change_redis_cluster_compartment_details.go new file mode 100644 index 0000000000..6a5f7a02f7 --- /dev/null +++ b/redis/change_redis_cluster_compartment_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeRedisClusterCompartmentDetails The configuration details for the move operation. +type ChangeRedisClusterCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the compartment + // into which the Redis cluster should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeRedisClusterCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeRedisClusterCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/change_redis_cluster_compartment_request_response.go b/redis/change_redis_cluster_compartment_request_response.go new file mode 100644 index 0000000000..acc54b5739 --- /dev/null +++ b/redis/change_redis_cluster_compartment_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeRedisClusterCompartmentRequest wrapper for the ChangeRedisClusterCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ChangeRedisClusterCompartment.go.html to see an example of how to use ChangeRedisClusterCompartmentRequest. +type ChangeRedisClusterCompartmentRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster. + RedisClusterId *string `mandatory:"true" contributesTo:"path" name:"redisClusterId"` + + // The information to be updated. + ChangeRedisClusterCompartmentDetails `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 ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeRedisClusterCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeRedisClusterCompartmentRequest) 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 ChangeRedisClusterCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeRedisClusterCompartmentRequest) 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 ChangeRedisClusterCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeRedisClusterCompartmentResponse wrapper for the ChangeRedisClusterCompartment operation +type ChangeRedisClusterCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeRedisClusterCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeRedisClusterCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/redis/create_redis_cluster_details.go b/redis/create_redis_cluster_details.go new file mode 100644 index 0000000000..50c1528221 --- /dev/null +++ b/redis/create_redis_cluster_details.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateRedisClusterDetails The configuration details for a new Redis cluster. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +type CreateRedisClusterDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the compartment that contains the Redis cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The number of nodes in the Redis cluster. + NodeCount *int `mandatory:"true" json:"nodeCount"` + + // The Redis version that the cluster is running. + SoftwareVersion RedisClusterSoftwareVersionEnum `mandatory:"true" json:"softwareVersion"` + + // The amount of memory allocated to the Redis cluster's nodes, in gigabytes. + NodeMemoryInGBs *float32 `mandatory:"true" json:"nodeMemoryInGBs"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster's subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // 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 CreateRedisClusterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateRedisClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRedisClusterSoftwareVersionEnum(string(m.SoftwareVersion)); !ok && m.SoftwareVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SoftwareVersion: %s. Supported values are: %s.", m.SoftwareVersion, strings.Join(GetRedisClusterSoftwareVersionEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/create_redis_cluster_request_response.go b/redis/create_redis_cluster_request_response.go new file mode 100644 index 0000000000..40310e36f9 --- /dev/null +++ b/redis/create_redis_cluster_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateRedisClusterRequest wrapper for the CreateRedisCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/CreateRedisCluster.go.html to see an example of how to use CreateRedisClusterRequest. +type CreateRedisClusterRequest struct { + + // Details for the new RedisCluster. + CreateRedisClusterDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateRedisClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateRedisClusterRequest) 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 CreateRedisClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateRedisClusterRequest) 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 CreateRedisClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateRedisClusterResponse wrapper for the CreateRedisCluster operation +type CreateRedisClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The RedisCluster instance + RedisCluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateRedisClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateRedisClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/redis/delete_redis_cluster_request_response.go b/redis/delete_redis_cluster_request_response.go new file mode 100644 index 0000000000..3c21bd56b2 --- /dev/null +++ b/redis/delete_redis_cluster_request_response.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. + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteRedisClusterRequest wrapper for the DeleteRedisCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/DeleteRedisCluster.go.html to see an example of how to use DeleteRedisClusterRequest. +type DeleteRedisClusterRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster. + RedisClusterId *string `mandatory:"true" contributesTo:"path" name:"redisClusterId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteRedisClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteRedisClusterRequest) 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 DeleteRedisClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteRedisClusterRequest) 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 DeleteRedisClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteRedisClusterResponse wrapper for the DeleteRedisCluster operation +type DeleteRedisClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteRedisClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteRedisClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/redis/get_redis_cluster_request_response.go b/redis/get_redis_cluster_request_response.go new file mode 100644 index 0000000000..0ed159a7dd --- /dev/null +++ b/redis/get_redis_cluster_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetRedisClusterRequest wrapper for the GetRedisCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/GetRedisCluster.go.html to see an example of how to use GetRedisClusterRequest. +type GetRedisClusterRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster. + RedisClusterId *string `mandatory:"true" contributesTo:"path" name:"redisClusterId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetRedisClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetRedisClusterRequest) 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 GetRedisClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRedisClusterRequest) 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 GetRedisClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetRedisClusterResponse wrapper for the GetRedisCluster operation +type GetRedisClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The RedisCluster instance + RedisCluster `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 GetRedisClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetRedisClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/redis/get_work_request_request_response.go b/redis/get_work_request_request_response.go new file mode 100644 index 0000000000..2c0261aa3f --- /dev/null +++ b/redis/get_work_request_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The the asynchronous request ID. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/redis/list_redis_clusters_request_response.go b/redis/list_redis_clusters_request_response.go new file mode 100644 index 0000000000..0006f0174c --- /dev/null +++ b/redis/list_redis_clusters_request_response.go @@ -0,0 +1,209 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListRedisClustersRequest wrapper for the ListRedisClusters operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListRedisClusters.go.html to see an example of how to use ListRedisClustersRequest. +type ListRedisClustersRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources their lifecycleState matches the given lifecycleState. + LifecycleState RedisClusterLifecycleStateEnum `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"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // 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 ListRedisClustersSortOrderEnum `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 ListRedisClustersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListRedisClustersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListRedisClustersRequest) 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 ListRedisClustersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRedisClustersRequest) 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 ListRedisClustersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRedisClusterLifecycleStateEnum(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(GetRedisClusterLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListRedisClustersSortOrderEnum(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(GetListRedisClustersSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListRedisClustersSortByEnum(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(GetListRedisClustersSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListRedisClustersResponse wrapper for the ListRedisClusters operation +type ListRedisClustersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of RedisClusterCollection instances + RedisClusterCollection `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 ListRedisClustersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListRedisClustersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListRedisClustersSortOrderEnum Enum with underlying type: string +type ListRedisClustersSortOrderEnum string + +// Set of constants representing the allowable values for ListRedisClustersSortOrderEnum +const ( + ListRedisClustersSortOrderAsc ListRedisClustersSortOrderEnum = "ASC" + ListRedisClustersSortOrderDesc ListRedisClustersSortOrderEnum = "DESC" +) + +var mappingListRedisClustersSortOrderEnum = map[string]ListRedisClustersSortOrderEnum{ + "ASC": ListRedisClustersSortOrderAsc, + "DESC": ListRedisClustersSortOrderDesc, +} + +var mappingListRedisClustersSortOrderEnumLowerCase = map[string]ListRedisClustersSortOrderEnum{ + "asc": ListRedisClustersSortOrderAsc, + "desc": ListRedisClustersSortOrderDesc, +} + +// GetListRedisClustersSortOrderEnumValues Enumerates the set of values for ListRedisClustersSortOrderEnum +func GetListRedisClustersSortOrderEnumValues() []ListRedisClustersSortOrderEnum { + values := make([]ListRedisClustersSortOrderEnum, 0) + for _, v := range mappingListRedisClustersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListRedisClustersSortOrderEnumStringValues Enumerates the set of values in String for ListRedisClustersSortOrderEnum +func GetListRedisClustersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListRedisClustersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListRedisClustersSortOrderEnum(val string) (ListRedisClustersSortOrderEnum, bool) { + enum, ok := mappingListRedisClustersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListRedisClustersSortByEnum Enum with underlying type: string +type ListRedisClustersSortByEnum string + +// Set of constants representing the allowable values for ListRedisClustersSortByEnum +const ( + ListRedisClustersSortByTimecreated ListRedisClustersSortByEnum = "timeCreated" + ListRedisClustersSortByDisplayname ListRedisClustersSortByEnum = "displayName" +) + +var mappingListRedisClustersSortByEnum = map[string]ListRedisClustersSortByEnum{ + "timeCreated": ListRedisClustersSortByTimecreated, + "displayName": ListRedisClustersSortByDisplayname, +} + +var mappingListRedisClustersSortByEnumLowerCase = map[string]ListRedisClustersSortByEnum{ + "timecreated": ListRedisClustersSortByTimecreated, + "displayname": ListRedisClustersSortByDisplayname, +} + +// GetListRedisClustersSortByEnumValues Enumerates the set of values for ListRedisClustersSortByEnum +func GetListRedisClustersSortByEnumValues() []ListRedisClustersSortByEnum { + values := make([]ListRedisClustersSortByEnum, 0) + for _, v := range mappingListRedisClustersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListRedisClustersSortByEnumStringValues Enumerates the set of values in String for ListRedisClustersSortByEnum +func GetListRedisClustersSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListRedisClustersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListRedisClustersSortByEnum(val string) (ListRedisClustersSortByEnum, bool) { + enum, ok := mappingListRedisClustersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/list_work_request_errors_request_response.go b/redis/list_work_request_errors_request_response.go new file mode 100644 index 0000000000..f8c5d5193a --- /dev/null +++ b/redis/list_work_request_errors_request_response.go @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // The the asynchronous request ID. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + SortBy ListWorkRequestErrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestErrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestErrorsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestErrorsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestErrorsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestErrorsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimeaccepted ListWorkRequestErrorsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timeAccepted": ListWorkRequestErrorsSortByTimeaccepted, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timeaccepted": ListWorkRequestErrorsSortByTimeaccepted, +} + +// GetListWorkRequestErrorsSortByEnumValues Enumerates the set of values for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumValues() []ListWorkRequestErrorsSortByEnum { + values := make([]ListWorkRequestErrorsSortByEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestErrorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortByEnum(val string) (ListWorkRequestErrorsSortByEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestErrorsSortOrderEnum Enum with underlying type: string +type ListWorkRequestErrorsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortOrderEnum +const ( + ListWorkRequestErrorsSortOrderAsc ListWorkRequestErrorsSortOrderEnum = "ASC" + ListWorkRequestErrorsSortOrderDesc ListWorkRequestErrorsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestErrorsSortOrderEnum = map[string]ListWorkRequestErrorsSortOrderEnum{ + "ASC": ListWorkRequestErrorsSortOrderAsc, + "DESC": ListWorkRequestErrorsSortOrderDesc, +} + +var mappingListWorkRequestErrorsSortOrderEnumLowerCase = map[string]ListWorkRequestErrorsSortOrderEnum{ + "asc": ListWorkRequestErrorsSortOrderAsc, + "desc": ListWorkRequestErrorsSortOrderDesc, +} + +// GetListWorkRequestErrorsSortOrderEnumValues Enumerates the set of values for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumValues() []ListWorkRequestErrorsSortOrderEnum { + values := make([]ListWorkRequestErrorsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestErrorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortOrderEnum(val string) (ListWorkRequestErrorsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/list_work_request_logs_request_response.go b/redis/list_work_request_logs_request_response.go new file mode 100644 index 0000000000..706ddd208b --- /dev/null +++ b/redis/list_work_request_logs_request_response.go @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // The the asynchronous request ID. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + SortBy ListWorkRequestLogsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestLogsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestLogsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestLogsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestLogsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimeaccepted ListWorkRequestLogsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timeAccepted": ListWorkRequestLogsSortByTimeaccepted, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timeaccepted": ListWorkRequestLogsSortByTimeaccepted, +} + +// GetListWorkRequestLogsSortByEnumValues Enumerates the set of values for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumValues() []ListWorkRequestLogsSortByEnum { + values := make([]ListWorkRequestLogsSortByEnum, 0) + for _, v := range mappingListWorkRequestLogsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestLogsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortByEnum(val string) (ListWorkRequestLogsSortByEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestLogsSortOrderEnum Enum with underlying type: string +type ListWorkRequestLogsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortOrderEnum +const ( + ListWorkRequestLogsSortOrderAsc ListWorkRequestLogsSortOrderEnum = "ASC" + ListWorkRequestLogsSortOrderDesc ListWorkRequestLogsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestLogsSortOrderEnum = map[string]ListWorkRequestLogsSortOrderEnum{ + "ASC": ListWorkRequestLogsSortOrderAsc, + "DESC": ListWorkRequestLogsSortOrderDesc, +} + +var mappingListWorkRequestLogsSortOrderEnumLowerCase = map[string]ListWorkRequestLogsSortOrderEnum{ + "asc": ListWorkRequestLogsSortOrderAsc, + "desc": ListWorkRequestLogsSortOrderDesc, +} + +// GetListWorkRequestLogsSortOrderEnumValues Enumerates the set of values for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumValues() []ListWorkRequestLogsSortOrderEnum { + values := make([]ListWorkRequestLogsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestLogsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestLogsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortOrderEnum(val string) (ListWorkRequestLogsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/list_work_requests_request_response.go b/redis/list_work_requests_request_response.go new file mode 100644 index 0000000000..ddbd8790e5 --- /dev/null +++ b/redis/list_work_requests_request_response.go @@ -0,0 +1,271 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The ID of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // A filter to return only resources their lifecycleState matches the given OperationStatus. + Status ListWorkRequestsStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the resource affected by the work request. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestsStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetListWorkRequestsStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsStatusEnum Enum with underlying type: string +type ListWorkRequestsStatusEnum string + +// Set of constants representing the allowable values for ListWorkRequestsStatusEnum +const ( + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "needs_attention": ListWorkRequestsStatusNeedsAttention, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, +} + +// GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumValues() []ListWorkRequestsStatusEnum { + values := make([]ListWorkRequestsStatusEnum, 0) + for _, v := range mappingListWorkRequestsStatusEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsStatusEnumStringValues Enumerates the set of values in String for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingListWorkRequestsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsStatusEnum(val string) (ListWorkRequestsStatusEnum, bool) { + enum, ok := mappingListWorkRequestsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrderEnum = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +var mappingListWorkRequestsSortOrderEnumLowerCase = map[string]ListWorkRequestsSortOrderEnum{ + "asc": ListWorkRequestsSortOrderAsc, + "desc": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortOrderEnum(val string) (ListWorkRequestsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortByTimeaccepted ListWorkRequestsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestsSortByEnum = map[string]ListWorkRequestsSortByEnum{ + "timeAccepted": ListWorkRequestsSortByTimeaccepted, +} + +var mappingListWorkRequestsSortByEnumLowerCase = map[string]ListWorkRequestsSortByEnum{ + "timeaccepted": ListWorkRequestsSortByTimeaccepted, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortByEnum(val string) (ListWorkRequestsSortByEnum, bool) { + enum, ok := mappingListWorkRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/node.go b/redis/node.go new file mode 100644 index 0000000000..4d9be2dadf --- /dev/null +++ b/redis/node.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Node The details of each node in the Redis cluster. +type Node struct { + + // The fully qualified domain name (FQDN) of the API endpoint to access a specific node. + PrivateEndpointFqdn *string `mandatory:"true" json:"privateEndpointFqdn"` + + // The private IP address of the API endpoint to access a specific node. + PrivateEndpointIpAddress *string `mandatory:"true" json:"privateEndpointIpAddress"` + + // A user-friendly name of a Redis cluster node. + DisplayName *string `mandatory:"true" json:"displayName"` +} + +func (m Node) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Node) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/node_collection.go b/redis/node_collection.go new file mode 100644 index 0000000000..1f84ded8e8 --- /dev/null +++ b/redis/node_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeCollection The collection of Redis cluster nodes. +type NodeCollection struct { + + // Collection of node objects. + Items []Node `mandatory:"true" json:"items"` +} + +func (m NodeCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NodeCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/operation_status.go b/redis/operation_status.go new file mode 100644 index 0000000000..4931bf7370 --- /dev/null +++ b/redis/operation_status.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "needs_attention": OperationStatusNeedsAttention, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/operation_type.go b/redis/operation_type.go new file mode 100644 index 0000000000..d3ee83d74a --- /dev/null +++ b/redis/operation_type.go @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypeCreateRedisCluster OperationTypeEnum = "CREATE_REDIS_CLUSTER" + OperationTypeUpdateRedisCluster OperationTypeEnum = "UPDATE_REDIS_CLUSTER" + OperationTypeDeleteRedisCluster OperationTypeEnum = "DELETE_REDIS_CLUSTER" + OperationTypeMoveRedisCluster OperationTypeEnum = "MOVE_REDIS_CLUSTER" + OperationTypeFailoverRedisCluster OperationTypeEnum = "FAILOVER_REDIS_CLUSTER" + OperationTypeCreateRedisConfigSet OperationTypeEnum = "CREATE_REDIS_CONFIG_SET" + OperationTypeUpdateRedisConfigSet OperationTypeEnum = "UPDATE_REDIS_CONFIG_SET" + OperationTypeDeleteRedisConfigSet OperationTypeEnum = "DELETE_REDIS_CONFIG_SET" + OperationTypeMoveRedisConfigSet OperationTypeEnum = "MOVE_REDIS_CONFIG_SET" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "CREATE_REDIS_CLUSTER": OperationTypeCreateRedisCluster, + "UPDATE_REDIS_CLUSTER": OperationTypeUpdateRedisCluster, + "DELETE_REDIS_CLUSTER": OperationTypeDeleteRedisCluster, + "MOVE_REDIS_CLUSTER": OperationTypeMoveRedisCluster, + "FAILOVER_REDIS_CLUSTER": OperationTypeFailoverRedisCluster, + "CREATE_REDIS_CONFIG_SET": OperationTypeCreateRedisConfigSet, + "UPDATE_REDIS_CONFIG_SET": OperationTypeUpdateRedisConfigSet, + "DELETE_REDIS_CONFIG_SET": OperationTypeDeleteRedisConfigSet, + "MOVE_REDIS_CONFIG_SET": OperationTypeMoveRedisConfigSet, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "create_redis_cluster": OperationTypeCreateRedisCluster, + "update_redis_cluster": OperationTypeUpdateRedisCluster, + "delete_redis_cluster": OperationTypeDeleteRedisCluster, + "move_redis_cluster": OperationTypeMoveRedisCluster, + "failover_redis_cluster": OperationTypeFailoverRedisCluster, + "create_redis_config_set": OperationTypeCreateRedisConfigSet, + "update_redis_config_set": OperationTypeUpdateRedisConfigSet, + "delete_redis_config_set": OperationTypeDeleteRedisConfigSet, + "move_redis_config_set": OperationTypeMoveRedisConfigSet, +} + +// GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum +func GetOperationTypeEnumValues() []OperationTypeEnum { + values := make([]OperationTypeEnum, 0) + for _, v := range mappingOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypeEnumStringValues Enumerates the set of values in String for OperationTypeEnum +func GetOperationTypeEnumStringValues() []string { + return []string{ + "CREATE_REDIS_CLUSTER", + "UPDATE_REDIS_CLUSTER", + "DELETE_REDIS_CLUSTER", + "MOVE_REDIS_CLUSTER", + "FAILOVER_REDIS_CLUSTER", + "CREATE_REDIS_CONFIG_SET", + "UPDATE_REDIS_CONFIG_SET", + "DELETE_REDIS_CONFIG_SET", + "MOVE_REDIS_CONFIG_SET", + } +} + +// GetMappingOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypeEnum(val string) (OperationTypeEnum, bool) { + enum, ok := mappingOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/redis_cluster.go b/redis/redis_cluster.go new file mode 100644 index 0000000000..097bf500a8 --- /dev/null +++ b/redis/redis_cluster.go @@ -0,0 +1,197 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RedisCluster A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +type RedisCluster struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the compartment that contains the Redis cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The number of nodes in the Redis cluster. + NodeCount *int `mandatory:"true" json:"nodeCount"` + + // The amount of memory allocated to the Redis cluster's nodes, in gigabytes. + NodeMemoryInGBs *float32 `mandatory:"true" json:"nodeMemoryInGBs"` + + // The fully qualified domain name (FQDN) of the API endpoint for the Redis cluster's primary node. + PrimaryFqdn *string `mandatory:"true" json:"primaryFqdn"` + + // The private IP address of the API endpoint for the Redis cluster's primary node. + PrimaryEndpointIpAddress *string `mandatory:"true" json:"primaryEndpointIpAddress"` + + // The fully qualified domain name (FQDN) of the API endpoint for the Redis cluster's replica nodes. + ReplicasFqdn *string `mandatory:"true" json:"replicasFqdn"` + + // The private IP address of the API endpoint for the Redis cluster's replica nodes. + ReplicasEndpointIpAddress *string `mandatory:"true" json:"replicasEndpointIpAddress"` + + // The Redis version that the cluster is running. + SoftwareVersion RedisClusterSoftwareVersionEnum `mandatory:"true" json:"softwareVersion"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster's subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + NodeCollection *NodeCollection `mandatory:"true" json:"nodeCollection"` + + // The current state of the Redis cluster. + LifecycleState RedisClusterLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // A message describing the current state in more detail. For example, the message might provide actionable information for a resource in `FAILED` state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the Redis cluster was created. An RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time the Redis cluster was updated. An RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m RedisCluster) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RedisCluster) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRedisClusterSoftwareVersionEnum(string(m.SoftwareVersion)); !ok && m.SoftwareVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SoftwareVersion: %s. Supported values are: %s.", m.SoftwareVersion, strings.Join(GetRedisClusterSoftwareVersionEnumStringValues(), ","))) + } + + if _, ok := GetMappingRedisClusterLifecycleStateEnum(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(GetRedisClusterLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RedisClusterLifecycleStateEnum Enum with underlying type: string +type RedisClusterLifecycleStateEnum string + +// Set of constants representing the allowable values for RedisClusterLifecycleStateEnum +const ( + RedisClusterLifecycleStateCreating RedisClusterLifecycleStateEnum = "CREATING" + RedisClusterLifecycleStateUpdating RedisClusterLifecycleStateEnum = "UPDATING" + RedisClusterLifecycleStateActive RedisClusterLifecycleStateEnum = "ACTIVE" + RedisClusterLifecycleStateDeleting RedisClusterLifecycleStateEnum = "DELETING" + RedisClusterLifecycleStateDeleted RedisClusterLifecycleStateEnum = "DELETED" + RedisClusterLifecycleStateFailed RedisClusterLifecycleStateEnum = "FAILED" +) + +var mappingRedisClusterLifecycleStateEnum = map[string]RedisClusterLifecycleStateEnum{ + "CREATING": RedisClusterLifecycleStateCreating, + "UPDATING": RedisClusterLifecycleStateUpdating, + "ACTIVE": RedisClusterLifecycleStateActive, + "DELETING": RedisClusterLifecycleStateDeleting, + "DELETED": RedisClusterLifecycleStateDeleted, + "FAILED": RedisClusterLifecycleStateFailed, +} + +var mappingRedisClusterLifecycleStateEnumLowerCase = map[string]RedisClusterLifecycleStateEnum{ + "creating": RedisClusterLifecycleStateCreating, + "updating": RedisClusterLifecycleStateUpdating, + "active": RedisClusterLifecycleStateActive, + "deleting": RedisClusterLifecycleStateDeleting, + "deleted": RedisClusterLifecycleStateDeleted, + "failed": RedisClusterLifecycleStateFailed, +} + +// GetRedisClusterLifecycleStateEnumValues Enumerates the set of values for RedisClusterLifecycleStateEnum +func GetRedisClusterLifecycleStateEnumValues() []RedisClusterLifecycleStateEnum { + values := make([]RedisClusterLifecycleStateEnum, 0) + for _, v := range mappingRedisClusterLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetRedisClusterLifecycleStateEnumStringValues Enumerates the set of values in String for RedisClusterLifecycleStateEnum +func GetRedisClusterLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingRedisClusterLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRedisClusterLifecycleStateEnum(val string) (RedisClusterLifecycleStateEnum, bool) { + enum, ok := mappingRedisClusterLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// RedisClusterSoftwareVersionEnum Enum with underlying type: string +type RedisClusterSoftwareVersionEnum string + +// Set of constants representing the allowable values for RedisClusterSoftwareVersionEnum +const ( + RedisClusterSoftwareVersionV705 RedisClusterSoftwareVersionEnum = "V7_0_5" +) + +var mappingRedisClusterSoftwareVersionEnum = map[string]RedisClusterSoftwareVersionEnum{ + "V7_0_5": RedisClusterSoftwareVersionV705, +} + +var mappingRedisClusterSoftwareVersionEnumLowerCase = map[string]RedisClusterSoftwareVersionEnum{ + "v7_0_5": RedisClusterSoftwareVersionV705, +} + +// GetRedisClusterSoftwareVersionEnumValues Enumerates the set of values for RedisClusterSoftwareVersionEnum +func GetRedisClusterSoftwareVersionEnumValues() []RedisClusterSoftwareVersionEnum { + values := make([]RedisClusterSoftwareVersionEnum, 0) + for _, v := range mappingRedisClusterSoftwareVersionEnum { + values = append(values, v) + } + return values +} + +// GetRedisClusterSoftwareVersionEnumStringValues Enumerates the set of values in String for RedisClusterSoftwareVersionEnum +func GetRedisClusterSoftwareVersionEnumStringValues() []string { + return []string{ + "V7_0_5", + } +} + +// GetMappingRedisClusterSoftwareVersionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRedisClusterSoftwareVersionEnum(val string) (RedisClusterSoftwareVersionEnum, bool) { + enum, ok := mappingRedisClusterSoftwareVersionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/redis/redis_cluster_collection.go b/redis/redis_cluster_collection.go new file mode 100644 index 0000000000..1affa03e3e --- /dev/null +++ b/redis/redis_cluster_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RedisClusterCollection A list of Redis clusters that match filter criteria, if any. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +type RedisClusterCollection struct { + + // The list of Redis clusters. + Items []RedisClusterSummary `mandatory:"true" json:"items"` +} + +func (m RedisClusterCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RedisClusterCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/redis_cluster_summary.go b/redis/redis_cluster_summary.go new file mode 100644 index 0000000000..2c743365d8 --- /dev/null +++ b/redis/redis_cluster_summary.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RedisClusterSummary Summary of information about a Redis cluster. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +type RedisClusterSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the compartment that contains the Redis cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The number of nodes in the Redis cluster. + NodeCount *int `mandatory:"true" json:"nodeCount"` + + // The amount of memory allocated to the Redis cluster's nodes, in gigabytes. + NodeMemoryInGBs *float32 `mandatory:"true" json:"nodeMemoryInGBs"` + + // The fully qualified domain name (FQDN) of the API endpoint for the Redis cluster's primary node. + PrimaryFqdn *string `mandatory:"true" json:"primaryFqdn"` + + // The private IP address of the API endpoint for the Redis cluster's primary node. + PrimaryEndpointIpAddress *string `mandatory:"true" json:"primaryEndpointIpAddress"` + + // The fully qualified domain name (FQDN) of the API endpoint for the Redis cluster's replica nodes. + ReplicasFqdn *string `mandatory:"true" json:"replicasFqdn"` + + // The private IP address of the API endpoint for the Redis cluster's replica nodes. + ReplicasEndpointIpAddress *string `mandatory:"true" json:"replicasEndpointIpAddress"` + + // The Redis version that the cluster is running. + SoftwareVersion RedisClusterSoftwareVersionEnum `mandatory:"true" json:"softwareVersion"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster's subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The current state of the Redis cluster. + LifecycleState RedisClusterLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // A message describing the current state in more detail. For example, the message might provide actionable information for a resource in `FAILED` state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the Redis cluster was created. An RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time the Redis cluster was updated. An RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m RedisClusterSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RedisClusterSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRedisClusterSoftwareVersionEnum(string(m.SoftwareVersion)); !ok && m.SoftwareVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SoftwareVersion: %s. Supported values are: %s.", m.SoftwareVersion, strings.Join(GetRedisClusterSoftwareVersionEnumStringValues(), ","))) + } + + if _, ok := GetMappingRedisClusterLifecycleStateEnum(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(GetRedisClusterLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/redis_rediscluster_client.go b/redis/redis_rediscluster_client.go new file mode 100644 index 0000000000..3377eef799 --- /dev/null +++ b/redis/redis_rediscluster_client.go @@ -0,0 +1,740 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// RedisClusterClient a client for RedisCluster +type RedisClusterClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewRedisClusterClientWithConfigurationProvider Creates a new default RedisCluster client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewRedisClusterClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client RedisClusterClient, err error) { + if enabled := common.CheckForEnabledServices("redis"); !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 newRedisClusterClientFromBaseClient(baseClient, provider) +} + +// NewRedisClusterClientWithOboToken Creates a new default RedisCluster 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 NewRedisClusterClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client RedisClusterClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newRedisClusterClientFromBaseClient(baseClient, configProvider) +} + +func newRedisClusterClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client RedisClusterClient, err error) { + // RedisCluster service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("RedisCluster")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = RedisClusterClient{BaseClient: baseClient} + client.BasePath = "20220315" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *RedisClusterClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("redis", "https://redis.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *RedisClusterClient) 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 *RedisClusterClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CancelWorkRequest Cancels the specified work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequest API. +// A default retry strategy applies to this operation CancelWorkRequest() +func (client RedisClusterClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, 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.cancelWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + } + return +} + +// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "CancelWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeRedisClusterCompartment Moves a Redis cluster into a different compartment within the same tenancy. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ChangeRedisClusterCompartment.go.html to see an example of how to use ChangeRedisClusterCompartment API. +// A default retry strategy applies to this operation ChangeRedisClusterCompartment() +func (client RedisClusterClient) ChangeRedisClusterCompartment(ctx context.Context, request ChangeRedisClusterCompartmentRequest) (response ChangeRedisClusterCompartmentResponse, 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.changeRedisClusterCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeRedisClusterCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeRedisClusterCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeRedisClusterCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeRedisClusterCompartmentResponse") + } + return +} + +// changeRedisClusterCompartment implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) changeRedisClusterCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/redisClusters/{redisClusterId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeRedisClusterCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "ChangeRedisClusterCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateRedisCluster Creates a new Redis cluster. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/CreateRedisCluster.go.html to see an example of how to use CreateRedisCluster API. +// A default retry strategy applies to this operation CreateRedisCluster() +func (client RedisClusterClient) CreateRedisCluster(ctx context.Context, request CreateRedisClusterRequest) (response CreateRedisClusterResponse, 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.createRedisCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateRedisClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateRedisClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateRedisClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateRedisClusterResponse") + } + return +} + +// createRedisCluster implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) createRedisCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/redisClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateRedisClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "CreateRedisCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteRedisCluster Deletes the specified Redis cluster. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/DeleteRedisCluster.go.html to see an example of how to use DeleteRedisCluster API. +// A default retry strategy applies to this operation DeleteRedisCluster() +func (client RedisClusterClient) DeleteRedisCluster(ctx context.Context, request DeleteRedisClusterRequest) (response DeleteRedisClusterResponse, 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.deleteRedisCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteRedisClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteRedisClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteRedisClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteRedisClusterResponse") + } + return +} + +// deleteRedisCluster implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) deleteRedisCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/redisClusters/{redisClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteRedisClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "DeleteRedisCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetRedisCluster Retrieves the specified Redis cluster. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/GetRedisCluster.go.html to see an example of how to use GetRedisCluster API. +// A default retry strategy applies to this operation GetRedisCluster() +func (client RedisClusterClient) GetRedisCluster(ctx context.Context, request GetRedisClusterRequest) (response GetRedisClusterResponse, 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.getRedisCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetRedisClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetRedisClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetRedisClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRedisClusterResponse") + } + return +} + +// getRedisCluster implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) getRedisCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/redisClusters/{redisClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetRedisClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "GetRedisCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the status of the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client RedisClusterClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListRedisClusters Lists the Redis clusters in the specified compartment. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListRedisClusters.go.html to see an example of how to use ListRedisClusters API. +// A default retry strategy applies to this operation ListRedisClusters() +func (client RedisClusterClient) ListRedisClusters(ctx context.Context, request ListRedisClustersRequest) (response ListRedisClustersResponse, 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.listRedisClusters, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListRedisClustersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListRedisClustersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListRedisClustersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListRedisClustersResponse") + } + return +} + +// listRedisClusters implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) listRedisClusters(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/redisClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListRedisClustersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "ListRedisClusters", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Returns a list of errors for a given work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client RedisClusterClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Returns a list of logs for a given work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client RedisClusterClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in a compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client RedisClusterClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateRedisCluster Updates the specified Redis cluster. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/UpdateRedisCluster.go.html to see an example of how to use UpdateRedisCluster API. +// A default retry strategy applies to this operation UpdateRedisCluster() +func (client RedisClusterClient) UpdateRedisCluster(ctx context.Context, request UpdateRedisClusterRequest) (response UpdateRedisClusterResponse, 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.updateRedisCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateRedisClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateRedisClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateRedisClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateRedisClusterResponse") + } + return +} + +// updateRedisCluster implements the OCIOperation interface (enables retrying operations) +func (client RedisClusterClient) updateRedisCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/redisClusters/{redisClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateRedisClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "RedisCluster", "UpdateRedisCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/redis/sort_order.go b/redis/sort_order.go new file mode 100644 index 0000000000..60de209ccb --- /dev/null +++ b/redis/sort_order.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +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/redis/update_redis_cluster_details.go b/redis/update_redis_cluster_details.go new file mode 100644 index 0000000000..0cdf728c03 --- /dev/null +++ b/redis/update_redis_cluster_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateRedisClusterDetails The configuration to update for an existing Redis cluster. +type UpdateRedisClusterDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The number of nodes in the Redis cluster. + NodeCount *int `mandatory:"false" json:"nodeCount"` + + // The amount of memory allocated to the Redis cluster's nodes, in gigabytes. + NodeMemoryInGBs *float32 `mandatory:"false" json:"nodeMemoryInGBs"` + + // 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 UpdateRedisClusterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateRedisClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/update_redis_cluster_request_response.go b/redis/update_redis_cluster_request_response.go new file mode 100644 index 0000000000..7b22e773e7 --- /dev/null +++ b/redis/update_redis_cluster_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 redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateRedisClusterRequest wrapper for the UpdateRedisCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/redis/UpdateRedisCluster.go.html to see an example of how to use UpdateRedisClusterRequest. +type UpdateRedisClusterRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the Redis cluster. + RedisClusterId *string `mandatory:"true" contributesTo:"path" name:"redisClusterId"` + + // The information to be updated. + UpdateRedisClusterDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateRedisClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateRedisClusterRequest) 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 UpdateRedisClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateRedisClusterRequest) 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 UpdateRedisClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateRedisClusterResponse wrapper for the UpdateRedisCluster operation +type UpdateRedisClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateRedisClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateRedisClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/redis/work_request.go b/redis/work_request.go new file mode 100644 index 0000000000..cadc9ebdcb --- /dev/null +++ b/redis/work_request.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest An asynchronous work request. +type WorkRequest struct { + + // The type of operation that spawned the work request. + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // The status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources that are affected by the work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // The percentage complete of the operation tracked by the work request. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the work request was created, in the format defined by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request was started, in the format defined by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request completed, in the format defined by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/work_request_error.go b/redis/work_request_error.go new file mode 100644 index 0000000000..6db5c68503 --- /dev/null +++ b/redis/work_request_error.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestError An error encountered while executing an operation that is tracked by a work request. +type WorkRequestError struct { + + // A machine-usable code for the error that occured. Error codes are listed at API Errors (https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm). + Code *string `mandatory:"true" json:"code"` + + // A human-readable error string for the error that occured. + Message *string `mandatory:"true" json:"message"` + + // The time and time the error occured. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/work_request_error_collection.go b/redis/work_request_error_collection.go new file mode 100644 index 0000000000..464d8f65e9 --- /dev/null +++ b/redis/work_request_error_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection A list of errors for a work request. +type WorkRequestErrorCollection struct { + + // A collection of work request errors. + Items []WorkRequestError `mandatory:"true" json:"items"` +} + +func (m WorkRequestErrorCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestErrorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/work_request_log_entry.go b/redis/work_request_log_entry.go new file mode 100644 index 0000000000..7d70b1a3b8 --- /dev/null +++ b/redis/work_request_log_entry.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntry A log message from executing an operation that is tracked by a work request. +type WorkRequestLogEntry struct { + + // A human-readable log message. + Message *string `mandatory:"true" json:"message"` + + // The date and time the log message was written. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntry) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/work_request_log_entry_collection.go b/redis/work_request_log_entry_collection.go new file mode 100644 index 0000000000..5953fc78b4 --- /dev/null +++ b/redis/work_request_log_entry_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection A list of logs for the specified work request. +type WorkRequestLogEntryCollection struct { + + // A collection of work request logs. + Items []WorkRequestLogEntry `mandatory:"true" json:"items"` +} + +func (m WorkRequestLogEntryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/work_request_resource.go b/redis/work_request_resource.go new file mode 100644 index 0000000000..111809b7ec --- /dev/null +++ b/redis/work_request_resource.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestResource The resources that are affected by the work request. +type WorkRequestResource struct { + + // The resource type the work request affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource is affected by the work tracked in the work request. + // A resource being created, updated, or deleted will remain in the `IN_PROGRESS` state until + // work is complete for that resource at which point it will transition to `CREATED`, `UPDATED`, + // or `DELETED`, respectively. + ActionType ActionTypeEnum `mandatory:"true" json:"actionType"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the resource the work request affects. + Identifier *string `mandatory:"true" json:"identifier"` + + // The URI path that you can use for a GET to access the resource metadata + EntityUri *string `mandatory:"false" json:"entityUri"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/work_request_summary.go b/redis/work_request_summary.go new file mode 100644 index 0000000000..a63d495218 --- /dev/null +++ b/redis/work_request_summary.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. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary A description of the work request status. +type WorkRequestSummary struct { + + // The type of operation that spawned the work request. + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // The status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm#Oracle) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Percentage of the request completed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the work request was created, in the format defined by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request was started, in the format defined by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request completed, in the format defined by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // 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 WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/redis/work_request_summary_collection.go b/redis/work_request_summary_collection.go new file mode 100644 index 0000000000..0f51d7012f --- /dev/null +++ b/redis/work_request_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Redis Service API +// +// Use the Redis Service API to create and manage Redis clusters. A Redis cluster is a memory-based storage solution. For more information, see OCI Caching Service with Redis (https://docs.cloud.oracle.com/iaas/Content/redis/home.htm). +// + +package redis + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection A list of work requests. +type WorkRequestSummaryCollection struct { + + // A collection of work requests. + Items []WorkRequestSummary `mandatory:"true" json:"items"` +} + +func (m WorkRequestSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +}