
    9                     b    S r SSKJr  SSKJr  SSKJr  SSK	J
r
  SrSrSrS	 rS
 rS rS rS rg)zrecommender API utlities.    )service)messages)base)yamlv1alpha2v1beta1v1c                 4    U S   R                  5       U SS -   $ )z Converts CamelCase to camelCase.r      N)lower)ss    4lib/googlecloudsdk/api_lib/recommender/flag_utils.pyToCamelCaser      s    	
1!"	    c                 p    Sn[         R                  " U 5      nU(       a  [        R                  " X15      nU$ )zParses json config file.

Args:
  config_file: file path of the config file.
  message_type: The protorpc Message type.

Returns:
  A message of type "message_type".
N)r   	load_pathmessages_utilDictToMessageWithErrorCheck)config_filemessage_typeconfigdatas       r   
ReadConfigr   !   s/     &		$$	66tJF	-r   c                 h    U(       a  [         R                  " U 5      $ [         R                  " U 5      $ )zReturns the config api service from the user-specified arguments.

Args:
  api_version: API version string.
  is_insight_api: boolean value sepcify whether this is a insight api,
    otherwise will return a recommendation service api.
)recommender_service!ProjectsInsightTypeConfigsService!ProjectsRecommenderConfigsService)api_versionis_insight_apis     r   GetConfigServiceFromArgsr    3   s)     @@MM		>	>{	KKr   c                     [         R                  " U5      nU(       a  UR                  U S9nU$ UR                  U S9nU$ )aw  Returns the describe request from the user-specified arguments.

Args:
  parent_resource: resource url string, the flags are already defined in
    argparse namespace.
  is_insight_api: boolean value specifying whether this is a insight api,
    otherwise treat as a recommender service api and return related describe
    request message.
  api_version: API version string.
)name)r   RecommenderMessages8RecommenderProjectsLocationsInsightTypesGetConfigRequest8RecommenderProjectsLocationsRecommendersGetConfigRequest)parent_resourcer   r   r   requests        r    GetDescribeConfigRequestFromArgsr(   @   sW     !44[A(OO P G
 
. OO P G	.r   c                     [         R                  R                  [        [         R                  R                  [
        [         R                  R                  [        0nUR                  U [        5      $ )zGet API version string.

Converts API version string from release track value.

Args:
  release_track: release_track value, can be ALPHA, BETA, GA

Returns:
  API version string.
)	r   ReleaseTrackALPHARECOMMENDER_API_ALPHA_VERSIONBETARECOMMENDER_API_BETA_VERSIONGARECOMMENDER_API_GA_VERSIONget)release_trackswitchers     r   GetApiVersionr4   W   sU     <
:
6(
 
m%B	CCr   N)__doc__"googlecloudsdk.api_lib.recommenderr   r   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.callioper   googlecloudsdk.corer   r,   r.   r0   r   r   r    r(   r4    r   r   <module>r;      sF      N A ( $ * ( ! 
$
L.Dr   