11#!/usr/bin/env python
22# -*- coding: utf-8; -*-
33
4- # Copyright (c) 2021, 2023 Oracle and/or its affiliates.
4+ # Copyright (c) 2021, 2024 Oracle and/or its affiliates.
55# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66
77import logging
88
9+ import oci .artifacts
910from oci .ai_language import AIServiceLanguageClient
11+ from oci .artifacts import ArtifactsClient
1012from oci .data_catalog import DataCatalogClient
1113from oci .data_flow import DataFlowClient
1214from oci .data_labeling_service import DataLabelingManagementClient
1315from oci .data_labeling_service_dataplane import DataLabelingClient
1416from oci .data_science import DataScienceClient
1517from oci .identity import IdentityClient
18+ from oci .marketplace import MarketplaceClient
1619from oci .object_storage import ObjectStorageClient
1720from oci .resource_search import ResourceSearchClient
1821from oci .secrets import SecretsClient
@@ -25,7 +28,7 @@ class OCIClientFactory:
2528
2629 """
2730 A factory class to create OCI client objects. The constructor takes in config, signer and client_kwargs. `client_kwargs` is passed
28- to the client constructor as key word argutments .
31+ to the client constructor as key word arguments .
2932
3033 Examples
3134 --------
@@ -48,12 +51,15 @@ class OCIClientFactory:
4851 oc.OCIClientFactory(**auth).object_storage # Creates Object storage client using instance principal authentication
4952 """
5053
51- def __init__ (self , config = {}, signer = None , client_kwargs = None ):
54+ def __init__ (self , config = None , signer = None , client_kwargs = None ):
55+ if not config :
56+ config = {}
5257 self .config = config
5358 self .signer = signer
5459 self .client_kwargs = client_kwargs
5560
56- def _client_impl (self , client ):
61+ @staticmethod
62+ def _client_impl (client ):
5763 client_map = {
5864 "object_storage" : ObjectStorageClient ,
5965 "data_science" : DataScienceClient ,
@@ -66,21 +72,17 @@ def _client_impl(self, client):
6672 "data_labeling_cp" : DataLabelingManagementClient ,
6773 "resource_search" : ResourceSearchClient ,
6874 "data_catalog" : DataCatalogClient ,
75+ "marketplace" : MarketplaceClient ,
76+ "artifacts" : ArtifactsClient ,
6977 }
70- try :
71- from oci .feature_store import FeatureStoreClient
72-
73- client_map ["feature_store" ] = FeatureStoreClient
74- except ImportError :
75- logger .debug ("OCI SDK with feature store support is not installed" )
76- pass
7778
7879 assert (
7980 client in client_map
8081 ), f"Invalid client name. Client name not found in { client_map .keys ()} "
8182 return client_map [client ]
8283
83- def _validate_auth_param (self , auth ):
84+ @staticmethod
85+ def _validate_auth_param (auth ):
8486 if not isinstance (auth , dict ):
8587 raise ValueError ("auth parameter should be of type dictionary" )
8688 if "config" in auth and not isinstance (auth ["config" ], dict ):
@@ -135,10 +137,6 @@ def ai_language(self):
135137 def data_labeling_cp (self ):
136138 return self .create_client ("data_labeling_cp" )
137139
138- @property
139- def feature_store (self ):
140- return self .create_client ("feature_store" )
141-
142140 @property
143141 def data_labeling_dp (self ):
144142 return self .create_client ("data_labeling_dp" )
@@ -150,3 +148,11 @@ def resource_search(self):
150148 @property
151149 def data_catalog (self ):
152150 return self .create_client ("data_catalog" )
151+
152+ @property
153+ def marketplace (self ):
154+ return self .create_client ("marketplace" )
155+
156+ @property
157+ def artifacts (self ) -> oci .artifacts .ArtifactsClient :
158+ return self .create_client ("artifacts" )
0 commit comments