| 1 |
# coding: utf-8 |
| 2 |
# Copyright 2019 IBM All Rights Reserved. |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
# you may not use this file except in compliance with the License. |
| 6 |
# You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
"""Classes and helper functions used by generated SDKs. |
| 16 |
|
| 17 |
classes: |
| 18 |
BaseService: Abstract class for common functionality between each service. |
| 19 |
DetailedResponse: The object returned from successful service operations. |
| 20 |
IAMTokenManager: Requests and refreshes IAM tokens using an apikey, and optionally a client_id and client_secret. |
| 21 |
IAMAssumeTokenManager: Requests and refreshes IAM tokens using an apikey and a trusted profile. |
| 22 |
JWTTokenManager: Abstract class for common functionality between each JWT token manager. |
| 23 |
CP4DTokenManager: Requests and refreshes CP4D tokens given a username and password. |
| 24 |
ApiException: Custom exception class for errors returned from service operations. |
| 25 |
|
| 26 |
functions: |
| 27 |
datetime_to_string: Serializes a datetime to a string. |
| 28 |
string_to_datetime: De-serializes a string to a datetime. |
| 29 |
datetime_to_string_list: Serializes a list of datetimes to a list of strings. |
| 30 |
string_to_datetime_list: De-serializes a list of strings to a list of datetimes. |
| 31 |
date_to_string: Serializes a date to a string. |
| 32 |
string_to_date: De-serializes a string to a date. |
| 33 |
convert_model: Convert a model object into an equivalent dict. |
| 34 |
convert_list: Convert a list of strings into comma-separated string. |
| 35 |
get_query_param: Return a query parameter value from a URL |
| 36 |
read_external_sources: Get config object from external sources. |
| 37 |
get_authenticator_from_environment: Get authenticator from external sources. |
| 38 |
""" |
| 39 |
|
| 40 |
from .base_service import BaseService |
| 41 |
from .detailed_response import DetailedResponse |
| 42 |
from .token_managers.iam_token_manager import IAMTokenManager |
| 43 |
from .token_managers.iam_assume_token_manager import IAMAssumeTokenManager |
| 44 |
from .token_managers.jwt_token_manager import JWTTokenManager |
| 45 |
from .token_managers.cp4d_token_manager import CP4DTokenManager |
| 46 |
from .token_managers.container_token_manager import ContainerTokenManager |
| 47 |
from .token_managers.vpc_instance_token_manager import VPCInstanceTokenManager |
| 48 |
from .token_managers.mcsp_token_manager import MCSPTokenManager |
| 49 |
from .token_managers.mcspv2_token_manager import MCSPV2TokenManager |
| 50 |
from .api_exception import ApiException |
| 51 |
from .utils import datetime_to_string, string_to_datetime, read_external_sources |
| 52 |
from .utils import datetime_to_string_list, string_to_datetime_list |
| 53 |
from .utils import date_to_string, string_to_date |
| 54 |
from .utils import convert_model, convert_list |
| 55 |
from .utils import get_query_param |
| 56 |
from .get_authenticator import get_authenticator_from_environment |