
    -                     X    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr   " S S5      r	g	)
z$Cloud Datastream stream objects API.    )absolute_import)division)unicode_literals)
list_pager)utilc                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
StreamObjectsClient   z-Client for stream objects service in the API.Nc                     U=(       d    [         R                  " 5       U l        U=(       d    [         R                  " 5       U l        U R                  R
                  U l        [         R                  " 5       U l        g )N)	r   GetClientInstance_clientGetMessagesModule	_messages"projects_locations_streams_objects_serviceGetResourceParser_resource_parser)selfclientmessagess      7lib/googlecloudsdk/api_lib/datastream/stream_objects.py__init__StreamObjectsClient.__init__   sN    5T335DL9!7!7!9DNLLCCDM 224D    c           	         U R                   R                  SUUUR                  S9nU R                  R                  nU" UR                  5       S9n[        R                  " U R                  UUR                  UR                  SSS9$ )zGet the list of objects in a stream.

Args:
  project_id: The project ID to retrieve
  stream: The stream name to retrieve
  args: parsed command line arguments

Returns:
  An iterator over all the matching stream objects.
%datastream.projects.locations.streams
projectsId	streamsIdlocationsId)parentstreamObjectspageSize)servicerequestlimit
batch_sizefieldbatch_size_attribute)r   Createlocationr   4DatastreamProjectsLocationsStreamsObjectsListRequestRelativeNamer   YieldFromListr   r&   	page_size)r   
project_idstreamargs
stream_reflist_req_typelist_reqs          r   ListStreamObjectsClient.List"   s     &&--/MM	 . #J NNWWMJ$;$;$=>H##jj>>') )r   c                 d   U R                   R                  5       nUR                  (       a5  U R                   R                  UR                  UR                  S9Ul        GONUR                  (       a5  U R                   R                  UR                  UR                  S9Ul	        GOUR                  (       a4  U R                   R                  UR                  UR                  S9Ul        OUR                  (       a4  U R                   R                  UR                  UR                   S9Ul        O~UR$                  (       a)  U R                   R'                  UR$                  S9Ul        ODUR*                  (       a3  U R                   R-                  UR*                  UR.                  S9Ul        U R2                  R5                  SUUUR6                  S9nU R                   R8                  nU" U R                   R;                  US9UR=                  5       S9nU R>                  RA                  U5      $ )	zLookup a stream object.

Args:
  project_id:
  stream_id:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  StreamObject: the looked up stream object.
)schematable)databaser:   )
objectName)r;   
collectionr   r   )sourceObjectIdentifier)lookupStreamObjectRequestr!   )!r   SourceObjectIdentifieroracle_schemaOracleObjectIdentifieroracle_tableoracleIdentifiermysql_databaseMysqlObjectIdentifiermysql_tablemysqlIdentifierpostgresql_schemaPostgresqlObjectIdentifierpostgresql_tablepostgresqlIdentifiersqlserver_schemaSqlServerObjectIdentifiersqlserver_tablesqlServerIdentifiersalesforce_object_nameSalesforceObjectIdentifiersalesforceIdentifiermongodb_databaseMongodbObjectIdentifiermongodb_collectionmongodbIdentifierr   r*   r+   6DatastreamProjectsLocationsStreamsObjectsLookupRequestLookupStreamObjectRequestr-   r   Lookup)r   r0   	stream_idr2   object_identifierr3   lookup_req_type
lookup_reqs           r   rZ   StreamObjectsClient.Lookup>   s    ==?
..
/
/''t/@/@ 0  (
 
		*...*N*N&&d.>.> +O +' 
		
..
3
3++43H3H 4  ,
 
		
..
2
2**$2F2F 3  +
 
	$	$
..
3
344 4  ,
 
		
..
0
0,,9P9P 1  ) &&--/MM	 . J 	MM  !"&.."J"J#4 #K #
 &&(	J ==
++r   c                 V    U R                   R                  USS9nUR                  5       $ )zGet the URL string for a stream object.

Args:
  name: stream object's full name.

Returns:
  URL of the stream object resource
z-datastream.projects.locations.streams.objects)r=   )r   ParseRelativeNameSelfLink)r   nameuris      r   GetUriStreamObjectsClient.GetUri   s2     


1
1H 2 JC<<>r   )r   r   r   r   )NN)
__name__
__module____qualname____firstlineno____doc__r   r6   rZ   re   __static_attributes__ r   r   r	   r	      s    55)8@,Dr   r	   N)
rk   
__future__r   r   r   apitools.base.pyr   !googlecloudsdk.api_lib.datastreamr   r	   rm   r   r   <module>rq      s%    + &  ' ' 2s sr   