1
1
# coding: utf-8
2
2
3
- # (C) Copyright IBM Corp. 2019, 2020.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
#
5
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
6
# you may not use this file except in compliance with the License.
30
30
from datetime import datetime
31
31
from enum import Enum
32
32
from ibm_cloud_sdk_core import BaseService
33
+ from ibm_cloud_sdk_core import DetailedResponse
33
34
from ibm_cloud_sdk_core import datetime_to_string , string_to_datetime
34
- from ibm_cloud_sdk_core import get_authenticator_from_environment
35
+ from ibm_cloud_sdk_core . get_authenticator import get_authenticator_from_environment
35
36
from typing import Dict
36
37
from typing import List
37
38
@@ -716,37 +717,46 @@ class CategoriesOptions():
716
717
:attr bool explanation: (optional) Set this to `true` to return explanations for
717
718
each categorization. **This is available only for English categories.**.
718
719
:attr int limit: (optional) Maximum number of categories to return.
719
- :attr str model: (optional) Deprecated: Enter a [custom model]
720
- (https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-customizing)
721
- ID to override the standard categories model. The custom categories experimental feature will be retired on
722
- 19 December 2019. On that date, deployed custom categories models will no longer be accessible in Natural Language
723
- Understanding. The feature will be removed from Knowledge Studio on an earlier date. Custom categories models will
724
- no longer be accessible in Knowledge Studio on 17 December 2019.
720
+ :attr str model: (optional) Enter a [custom
721
+ model](https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-customizing)
722
+ ID to override the standard categories model.
723
+ The custom categories experimental feature will be retired on 19 December 2019.
724
+ On that date, deployed custom categories models will no longer be accessible in
725
+ Natural Language Understanding. The feature will be removed from Knowledge
726
+ Studio on an earlier date. Custom categories models will no longer be accessible
727
+ in Knowledge Studio on 17 December 2019.
725
728
"""
726
729
727
- def __init__ (self , * , explanation : bool = None , limit : int = None , model : str = None ) -> None :
730
+ def __init__ (self ,
731
+ * ,
732
+ explanation : bool = None ,
733
+ limit : int = None ,
734
+ model : str = None ) -> None :
728
735
"""
729
736
Initialize a CategoriesOptions object.
730
737
731
738
:param bool explanation: (optional) Set this to `true` to return
732
739
explanations for each categorization. **This is available only for English
733
740
categories.**.
734
741
:param int limit: (optional) Maximum number of categories to return.
735
- :attr str model: (optional) Deprecated: Enter a [custom model]
736
- (https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-customizing)
737
- ID to override the standard categories model. The custom categories experimental feature will be retired on
738
- 19 December 2019. On that date, deployed custom categories models will no longer be accessible in Natural Language
739
- Understanding. The feature will be removed from Knowledge Studio on an earlier date. Custom categories models will
740
- no longer be accessible in Knowledge Studio on 17 December 2019.
742
+ :param str model: (optional) Enter a [custom
743
+ model](https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-customizing)
744
+ ID to override the standard categories model.
745
+ The custom categories experimental feature will be retired on 19 December
746
+ 2019. On that date, deployed custom categories models will no longer be
747
+ accessible in Natural Language Understanding. The feature will be removed
748
+ from Knowledge Studio on an earlier date. Custom categories models will no
749
+ longer be accessible in Knowledge Studio on 17 December 2019.
741
750
"""
742
751
self .explanation = explanation
743
752
self .limit = limit
753
+ self .model = model
744
754
745
755
@classmethod
746
756
def from_dict (cls , _dict : Dict ) -> 'CategoriesOptions' :
747
757
"""Initialize a CategoriesOptions object from a json dictionary."""
748
758
args = {}
749
- valid_keys = ['explanation' , 'limit' ]
759
+ valid_keys = ['explanation' , 'limit' , 'model' ]
750
760
bad_keys = set (_dict .keys ()) - set (valid_keys )
751
761
if bad_keys :
752
762
raise ValueError (
@@ -756,6 +766,8 @@ def from_dict(cls, _dict: Dict) -> 'CategoriesOptions':
756
766
args ['explanation' ] = _dict .get ('explanation' )
757
767
if 'limit' in _dict :
758
768
args ['limit' ] = _dict .get ('limit' )
769
+ if 'model' in _dict :
770
+ args ['model' ] = _dict .get ('model' )
759
771
return cls (** args )
760
772
761
773
@classmethod
@@ -770,6 +782,8 @@ def to_dict(self) -> Dict:
770
782
_dict ['explanation' ] = self .explanation
771
783
if hasattr (self , 'limit' ) and self .limit is not None :
772
784
_dict ['limit' ] = self .limit
785
+ if hasattr (self , 'model' ) and self .model is not None :
786
+ _dict ['model' ] = self .model
773
787
return _dict
774
788
775
789
def _to_dict (self ):
0 commit comments