def __init__( self, authenticator=None, ): """ Construct a new client for the Natural Language Classifier service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md about initializing the authenticator of your choice. """ service_url = self.default_service_url disable_ssl_verification = False config = read_external_sources('natural_language_classifier') if config.get('URL'): service_url = config.get('URL') if config.get('DISABLE_SSL'): disable_ssl_verification = config.get('DISABLE_SSL') if not authenticator: authenticator = get_authenticator_from_environment( 'natural_language_classifier') BaseService.__init__(self, service_url=service_url, authenticator=authenticator, disable_ssl_verification=disable_ssl_verification)
def __init__( self, crn: str, zone_id: str, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Page Rule API service. :param str crn: instance id. :param str zone_id: zone id. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md about initializing the authenticator of your choice. """ if crn is None: raise ValueError('crn must be provided') if zone_id is None: raise ValueError('zone_id must be provided') BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) self.crn = crn self.zone_id = zone_id
def __init__( self, crn: str, zone_identifier: str, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Range Applications service. :param str crn: Full url-encoded cloud resource name (CRN) of resource instance. :param str zone_identifier: zone identifier. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md about initializing the authenticator of your choice. """ if crn is None: raise ValueError('crn must be provided') if zone_identifier is None: raise ValueError('zone_identifier must be provided') BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) self.crn = crn self.zone_identifier = zone_identifier
def __init__(self, api_version, authenticator=None, trace_id=None): BaseService.__init__(self, service_url=self.default_service_url, authenticator=authenticator, disable_ssl_verification=False) self.api_version = api_version self.trace_id = trace_id self.configure_service('include-external-config')
def __init__(self, version: str, service_url: str = default_url, authenticator: Optional[Authenticator] = None, disable_ssl_verification: bool = False) -> None: BaseService.__init__(self, service_url=service_url, authenticator=authenticator, disable_ssl_verification=disable_ssl_verification) self.version = version
def __init__(self, version, service_url=default_url, authenticator=None, disable_ssl_verification=False): BaseService.__init__(self, service_url=service_url, authenticator=authenticator, disable_ssl_verification=disable_ssl_verification) self.version = version
def __init__(self, url=default_url, username=None, password=None, use_vcap_services=True): BaseService.__init__(self, 'authorization', url, username, password, use_vcap_services, display_name='authorization')
def __init__(self, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Resource Records service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md about initializing the authenticator of your choice. """ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator)
def __init__( self, url=default_url, username=None, password=None, iam_apikey=None, iam_access_token=None, iam_url=None, ): """ Construct a new client for the Natural Language Classifier service. :param str url: The base url to use when contacting the service (e.g. "https://gateway.watsonplatform.net/natural-language-classifier/api/natural-language-classifier/api"). The base url may differ between Bluemix regions. :param str username: The username used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable. :param str password: The password used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable. :param str iam_apikey: An API key that can be used to request IAM tokens. If this API key is provided, the SDK will manage the token and handle the refreshing. :param str iam_access_token: An IAM access token is fully managed by the application. Responsibility falls on the application to refresh the token, either before it expires or reactively upon receiving a 401 from the service as any requests made with an expired token will fail. :param str iam_url: An optional URL for the IAM service API. Defaults to 'https://iam.bluemix.net/identity/token'. """ BaseService.__init__(self, vcap_services_name='natural_language_classifier', url=url, username=username, password=password, iam_apikey=iam_apikey, iam_access_token=iam_access_token, iam_url=iam_url, use_vcap_services=True, display_name='Natural Language Classifier')
def __init__( self, authenticator: Authenticator = None, service_name: str = DEFAULT_SERVICE_NAME, ) -> None: """ Construct a new client for the Natural Language Classifier service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md about initializing the authenticator of your choice. """ if not authenticator: authenticator = get_authenticator_from_environment(service_name) BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator, disable_ssl_verification=False) self.configure_service(service_name)
def __init__( self, url=default_url, iam_apikey=None, iam_access_token=None, iam_url=None, iam_client_id=None, iam_client_secret=None, ): """ Construct a new client for the ResourceConfiguration service. :param str url: The base url to use when contacting the service (e.g. "https://config.cloud-object-storage.cloud.ibm.com/v1/v1"). The base url may differ between IBM Cloud regions. :param str iam_apikey: An API key that can be used to request IAM tokens. If this API key is provided, the SDK will manage the token and handle the refreshing. :param str iam_access_token: An IAM access token is fully managed by the application. Responsibility falls on the application to refresh the token, either before it expires or reactively upon receiving a 401 from the service as any requests made with an expired token will fail. :param str iam_url: An optional URL for the IAM service API. Defaults to 'https://iam.cloud.ibm.com/identity/token'. :param str iam_client_id: An optional client_id value to use when interacting with the IAM service. :param str iam_client_secret: An optional client_secret value to use when interacting with the IAM service. """ BaseService.__init__(self, vcap_services_name='resource_configuration', url=url, iam_apikey=iam_apikey, iam_access_token=iam_access_token, iam_url=iam_url, iam_client_id=iam_client_id, iam_client_secret=iam_client_secret, use_vcap_services=True, display_name='ResourceConfiguration')
def __init__( self, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the vpc service. :param str version: Requests the version of the API as of a date in the format `YYYY-MM-DD`. Any date up to the current date may be provided. Specify the current date to request the latest version. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md about initializing the authenticator of your choice. """ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator)
def __init__(self, version, url=default_url, username=None, password=None, api_key=None, iam_apikey=None, iam_access_token=None, iam_url=None): BaseService.__init__(self, vcap_services_name='test', url=url, api_key=api_key, username=username, password=password, use_vcap_services=True, iam_apikey=iam_apikey, iam_access_token=iam_access_token, iam_url=iam_url, display_name='Watson') self.version = version
def __init__( self, crn: str, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Webhooks service. :param str crn: Full url-encoded CRN of the service instance. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ if crn is None: raise ValueError('crn must be provided') BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) self.crn = crn
def setup_base(self): """SetUp the Base class with service_url and authenticator""" BaseService.__init__(self, service_url=URLBuilder.get_base_url(), authenticator=URLBuilder.get_iam_authenticator())
def __init__( self, version, url=default_url, username=None, password=None, iam_apikey=None, iam_access_token=None, iam_url=None, ): """ Construct a new client for the Language Translator service. :param str version: The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version. :param str url: The base url to use when contacting the service (e.g. "https://gateway.watsonplatform.net/language-translator/api/language-translator/api"). The base url may differ between Bluemix regions. :param str username: The username used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable. :param str password: The password used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable. :param str iam_apikey: An API key that can be used to request IAM tokens. If this API key is provided, the SDK will manage the token and handle the refreshing. :param str iam_access_token: An IAM access token is fully managed by the application. Responsibility falls on the application to refresh the token, either before it expires or reactively upon receiving a 401 from the service as any requests made with an expired token will fail. :param str iam_url: An optional URL for the IAM service API. Defaults to 'https://iam.bluemix.net/identity/token'. """ BaseService.__init__(self, vcap_services_name='language_translator', url=url, username=username, password=password, iam_apikey=iam_apikey, iam_access_token=iam_access_token, iam_url=iam_url, use_vcap_services=True, display_name='Language Translator') self.version = version
def __init__( self, url=default_url, username=None, password=None, iam_apikey=None, iam_access_token=None, iam_url=None, iam_client_id=None, iam_client_secret=None, icp4d_access_token=None, icp4d_url=None, authentication_type=None, ): """ Construct a new client for the Natural Language Classifier service. :param str url: The base url to use when contacting the service (e.g. "https://gateway.watsonplatform.net/natural-language-classifier/api/natural-language-classifier/api"). The base url may differ between IBM Cloud regions. :param str username: The username used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of IBM Cloud. When running on IBM Cloud, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable. :param str password: The password used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of IBM Cloud. When running on IBM Cloud, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable. :param str iam_apikey: An API key that can be used to request IAM tokens. If this API key is provided, the SDK will manage the token and handle the refreshing. :param str iam_access_token: An IAM access token is fully managed by the application. Responsibility falls on the application to refresh the token, either before it expires or reactively upon receiving a 401 from the service as any requests made with an expired token will fail. :param str iam_url: An optional URL for the IAM service API. Defaults to 'https://iam.cloud.ibm.com/identity/token'. :param str iam_client_id: An optional client_id value to use when interacting with the IAM service. :param str iam_client_secret: An optional client_secret value to use when interacting with the IAM service. :param str icp4d_access_token: A ICP4D(IBM Cloud Pak for Data) access token is fully managed by the application. Responsibility falls on the application to refresh the token, either before it expires or reactively upon receiving a 401 from the service as any requests made with an expired token will fail. :param str icp4d_url: In order to use an SDK-managed token with ICP4D authentication, this URL must be passed in. :param str authentication_type: Specifies the authentication pattern to use. Values that it takes are basic, iam or icp4d. """ BaseService.__init__(self, vcap_services_name='natural_language_classifier', url=url, username=username, password=password, iam_apikey=iam_apikey, iam_access_token=iam_access_token, iam_url=iam_url, iam_client_id=iam_client_id, iam_client_secret=iam_client_secret, use_vcap_services=True, display_name='Natural Language Classifier', icp4d_access_token=icp4d_access_token, icp4d_url=icp4d_url, authentication_type=authentication_type)