
    ^                         d Z ddlmZ ddlmZ ddlmZ ddlZddlmZmZ ddl	m
Z
 ddlmZ dd	lmZ dd
lmZ ddlmZ dZdZd Zd Zd Z ej4                  dd      Z G d d      Zy)z-Client for interacting with Storage Insights.    )absolute_import)division)unicode_literalsN)SequenceOptional)
list_pager)errors)client)apis)
propertiesi  'CSV options cannot be set with parquet.c                 J    |  | j                  d      j                  d      S dS )z;Returns the ASCII string unescaping any escaped characters.Nasciizunicode-escape)encodedecode)strings    2lib/googlecloudsdk/api_lib/storage/insights_api.py_get_unescaped_asciir   %   s3     "- 
w		&	&
 8378    c                 B    dj                  | |j                               S )Nzprojects/{}/locations/{})formatlower)projectlocations     r   _get_parent_stringr   +   s     
$	*	*7HNN4D	EEr   c                     t        j                         }|j                  |       }t        |j                  j
                  |j                  j                  j                               S N)gcs_json_client
JsonClient
get_bucketr   metadataprojectNumberr   r   )bucket
gcs_clientbucket_resources      r   _get_parent_string_from_bucketr&   2   sT    ))+*))&1/	,,''--/
 r   ReportFormatOptionscsvparquetc            %           e Zd ZdZ fdZ	 	 	 	 	 	 	 	 	 	 	 	 	 d.dedededededee   d	ed
ee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dededef$dZ
d Zd Zd Zd Zd/dZ	 	 	 	 	 	 	 	 	 	 	 	 	 d0d	edee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dededee   defdZ	 	 	 	 	 	 	 	 	 	 	 	 	 d0d	ed
ee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dee	e      dededee   defdZd Z	 	 	 	 	 	 	 	 	 d1d Zd! Z	 d2d"Zd# Zd3d$Zd% Zd& Zd' Z	 	 	 	 	 	 	 	 	 	 d4d(Zd5d)Zd* Zd+ Zd, Zd- Z  xZ!S )6InsightsApiz Client for Storage Insights API.c                     t         t        |           t        j                  dd      | _        t        j                  dd      | _        y )Nstorageinsightsv1)superr,   __init__	core_apisGetClientInstancer
   GetMessagesModulemessages)self	__class__s    r   r1   zInsightsApi.__init__E   s:    	+t%'--.?FDK//0A4HDMr   dataset_config_namer   destination_projectorganization_numberretention_periodactivity_data_retention_periodorganization_scopesource_projects_listsource_folders_list!include_buckets_prefix_regex_list!exclude_buckets_prefix_regex_listinclude_buckets_name_listexclude_buckets_name_listinclude_source_locationsexclude_source_locationsauto_add_new_bucketsidentity_typedescriptionc                 j   |P| j                   j                  j                  |j                               }| j                   j                  |      }nD| j                   j                  | j                   j                  j                  j                        }|r| j                   j                  |      nd}|	r| j                   j                  |	      nd}| j                   j                  |||||||||r|nd	      }|||_        |s|r|xs g D cg c]  }| j                   j                  |        }}||xs g D cg c]  }| j                   j                  |        c}z  }| j                   j                  |      |_        |s|
r|xs g D cg c]  }| j                   j                  |        }}||
xs g D cg c]  }| j                   j                  |        c}z  }| j                   j                  |      |_        |r!| j                   j                  |	      |_        |r!| j                   j                  |	      |_        | j                   j!                  ||t#        ||      
      }| j$                  j&                  j)                  |      S c c}w c c}w c c}w c c}w )a^  Creates a dataset config.

    Args:
      dataset_config_name: Name for the dataset config being created.
      location: The location where insights data will be stored in a GCS
        managed BigQuery instance.
      destination_project: The project in which the dataset config is
        being created and by extension the insights data will be stored.
      organization_number: Organization number of the organization to
        which all source projects / folders must belong.
      retention_period: No of days for which insights data is to be
        retained in BigQuery instance.
      activity_data_retention_period: No of days for which activity data is to
        be retained in BigQuery instance. If not set, retention period will be
        used by the API.
      organization_scope: If True, Insights data will be collected for
        all resources in the given organization.
      source_projects_list: List of source project numbers. Insights
        data is to be collected for buckets that belong to these projects.
      source_folders_list: List of source folder numbers. Insights
        data is to be collected for buckets that belong to these folders.
      include_buckets_prefix_regex_list: List of bucket prefix regex
        patterns which are to be included for insights processing from the
        source projects. We can either use included or excluded bucket
        parameters.
      exclude_buckets_prefix_regex_list: List of bucket prefix regex
        patterns which are to be excluded from insights processing from the
        source projects. We can either use included or excluded bucket
        parameters.
      include_buckets_name_list: List of bucket names which are to
        be included for insights processing from the source projects. We can
        either use included or excluded bucket parameters.
      exclude_buckets_name_list: List of bucket names which are to
        be excluded from insights processing from the source projects. We can
        either use included or excluded bucket parameters.
      include_source_locations: List of bucket locations which are
        to be included for insights processing from the source projects. We can
        either use included or excluded location parameters.
      exclude_source_locations: List of bucket locations which are
        to be excluded from insights processing from the source projects. We can
        either use included or excluded location parameters.
      auto_add_new_buckets: If True, auto includes any new buckets added
        to source projects that satisfy the include/exclude criterias.
      identity_type: Option for how permissions need to be setup for a
        given dataset config. Default option is IDENTITY_TYPE_PER_CONFIG.
      description: Human readable description text for the given dataset
        config.

    Returns:
      An instance of Operation message
    N)typeprojectNumbersfolderNumbers)	rH   identityincludeNewlyCreatedBucketsnameorganizationNumberretentionPeriodDayssourceProjectssourceFoldersorganizationScope
bucketNamebucketPrefixRegexcloudStorageBuckets	locations)datasetConfigdatasetConfigIdparent)r5   IdentityTypeValueValuesEnumupperIDENTITY_TYPE_PER_CONFIGSourceProjectsSourceFoldersDatasetConfigactivityDataRetentionPeriodDaysCloudStorageBucketCloudStorageBucketsexcludeCloudStorageBucketsincludeCloudStorageBucketsCloudStorageLocationsexcludeCloudStorageLocationsincludeCloudStorageLocations;StorageinsightsProjectsLocationsDatasetConfigsCreateRequestr   r
   !projects_locations_datasetConfigsCreate)r6   r8   r   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   identity_type_enumsource_projectssource_foldersdataset_configexcluded_nameexcluded_storage_bucketsexcluded_regexincluded_nameincluded_storage_bucketsincluded_regexcreate_requests                                 r   create_dataset_configz!InsightsApi.create_dataset_configJ   s   P  ==11EE



 mm,,2D,Emmm,,}}%%99RR - m 
 mm22+ 3 #'  
 ]]00) 1 "&  ]]00#7 .,&$0B, 1 
N &1
( 4 !$E  9>B>">m --
*
*m
*
D>  "  A GR G# Gn --
*
*^
*
L G# 
 --
+
+": ,  / !$E  9>B>">m --
*
*m
*
D>  "  A GR G# Gn --
*
*^
*
L G# 
 --
+
+": ,  /  
--
-
-0 .  1  
--
-
-0 .  1 ]]^^$+!"5x@ _ N
 ;;88??OOa"#"#s   #J!#J&#J+#J0c                     | j                   j                  |      }| j                  j                  j	                  |      S )z Creates the dataset config link.rQ   )r5   @StorageinsightsProjectsLocationsDatasetConfigsLinkDatasetRequestr
   rr   LinkDatasetr6   dataset_config_relative_namerequests      r   create_dataset_config_linkz&InsightsApi.create_dataset_config_link   s<    mm\\) ] G ;;88DDWMMr   c                     | j                   j                  |      }| j                  j                  j	                  |      S )zDeletes the dataset config.r   )r5   ;StorageinsightsProjectsLocationsDatasetConfigsDeleteRequestr
   rr   Deleter   s      r   delete_dataset_configz!InsightsApi.delete_dataset_config   s<    mmWW) X G ;;88??HHr   c                     | j                   j                  |      }| j                  j                  j	                  |      S )z Deletes the dataset config link.r   )r5   BStorageinsightsProjectsLocationsDatasetConfigsUnlinkDatasetRequestr
   rr   UnlinkDatasetr   s      r   delete_dataset_config_linkz&InsightsApi.delete_dataset_config_link   s<    mm^^) _ G ;;88FFwOOr   c                     | j                   j                  j                  | j                  j	                  |            S )zGets the dataset config.r   )r
   rr   Getr5   8StorageinsightsProjectsLocationsDatasetConfigsGetRequest)r6   r   s     r   get_dataset_configzInsightsApi.get_dataset_config   s:    ;;88<<NN- 	O 	
 r   c                    |=t        t        j                  j                  j                  j                         |      }n<t        t        j                  j                  j                  j                         d      }t        j                  | j                  j                  | j                  j                  |      ||nt        dd      S )a  Lists the dataset configs.

    Args:
      location (str): The location where insights data will be stored in a GCS
        managed BigQuery instance.
      page_size (int|None): Number of items per request to be returned.

    Returns:
      List of dataset configs.
    -ra   pageSizedatasetConfigs
batch_sizebatch_size_attributefield)r   r   VALUEScorer   r   r   YieldFromListr
   rr   r5   9StorageinsightsProjectsLocationsDatasetConfigsListRequest	PAGE_SIZE)r6   r   	page_sizera   s       r   list_dataset_configzInsightsApi.list_dataset_config  s     !



 
 
(
(
,
,
.f "*"3"3"8"8"@"@"D"D"FLf##55OO 	P 	
 !* 599' r   ru   rv   c                     g }d|fd|dufd|dufd|duxs |dufd|duxs |dufd|dufd|	dufd	|
dufd
|dufd|dufd|dufg}|D ]  \  }}|s	|j                  |        |S )zReturns the update_mask list.rV   rT   NrU   rm   rl   rp   ro   rP   rS   ri   rH   )append)r6   r=   ru   rv   rB   r@   rC   rA   rD   rE   rF   r;   r<   rH   update_maskmask_conditionsmask	conditions                     r   _get_dataset_config_update_maskz+InsightsApi._get_dataset_config_update_mask#  s    " K 
01	?$67	.45(%T1 =0<	
 )%T1 =0<	

 
()A)MN	')A)MN	%';4'GH	 0 <=-*$6	
 
4/0-O2 +i	4  + r   c                    | j                  ||||||||	|
||||      }|s$t        j                  dj                  |            || j                  j                  |      nd}|| j                  j                  |      nd}| j                  j                  |||||      }|rd|_        |||_	        |s|r|xs g D cg c]  }| j                  j                  |        }}||xs g D cg c]  }| j                  j                  |	        c}z  }| j                  j                  |
      |_        n|s|r|xs g D cg c]  }| j                  j                  |        }}||xs g D cg c]  }| j                  j                  |	        c}z  }| j                  j                  |
      |_        |
r!| j                  j                  |
      |_        |	r!| j                  j                  |	      |_        | j                  j#                  ||dj%                  |            }| j&                  j(                  j+                  |      S c c}w c c}w c c}w c c}w )a
  Updates the dataset config.

    Args:
      dataset_config_relative_name: The relative name of the dataset
        config to be modified.
      organization_scope: If True, Insights data will be collected for
        all resources in the given organization. If this field is Empty/None,
        Either the sourceProjects or the sourceFolders must be set to update
        the scope.
      source_projects_list: List of source project numbers. Insights
        data is to be collected for buckets that belong to these projects. If
        this field is Empty/None, Either the organizationScope will be True or
        the sourceFolders must be set to update the scope.
      source_folders_list: List of source folder IDs. Insights
        data is to be collected for buckets that belong to these organisational
        folders. If this field is Empty/None, Either the organizationScope will
        be True or the sourceProjects must be set to update the scope.
      include_buckets_name_list: Optional list of bucket names which
        are to be included for insights processing from the source projects. Can
        either use included or excluded bucket parameters.
      include_buckets_prefix_regex_list: Optional list of bucket
        prefix regex patterns which are to be included for insights processing
        from the source projects. Can either use included or excluded bucket
        parameters.
      exclude_buckets_name_list: Optional list of bucket names which
        are to be excluded from insights processing from the source projects.
        Can either use included or excluded bucket parameters.
      exclude_buckets_prefix_regex_list: Optional list of bucket
        prefix regex patterns which are to be excluded from insights processing
        from the source projects. Can either use included or excluded bucket
        parameters.
      include_source_locations: Optional list of bucket locations
        which are to be included for insights processing from the source
        projects. Can either use included or excluded location parameters.
      exclude_source_locations: Optional list of bucket locations
        which are to be excluded from insights processing from the source
        projects. Can either use included or excluded location parameters.
      auto_add_new_buckets: If True, auto includes any new buckets added
        to source projects that satisfy the include/exclude criterias.
      retention_period: No of days for which insights data is to be
        retained in BigQuery instance.
      activity_data_retention_period: No of days for which activity data is to
        be retained in BigQuery instance.
      description: Human readable description text for the given dataset
        config.

    Returns:
      An instance of Operation message.
    )r=   ru   rv   rB   r@   rC   rA   rD   rE   rF   r;   r<   rH   z(Nothing to update for dataset config: {}NrK   rM   )rS   rH   rT   rU   rP   TrW   rY   r[   r]   ,)rQ   r_   
updateMask)r   r	   InsightApiErrorr   r5   rf   rg   rh   rV   ri   rj   rk   rl   rm   rn   ro   rp   :StorageinsightsProjectsLocationsDatasetConfigsPatchRequestjoinr
   rr   Patch)r6   r   r=   r>   r?   rB   r@   rC   rA   rD   rE   rF   r;   r<   rH   r   ru   rv   rw   rx   ry   rz   r{   r|   r}   r   s                             r   update_dataset_configz!InsightsApi.update_dataset_configU  s   H 66-,*";*K";*K!9!91)'E 7 K  ""
4
;
;*  
	) mm22+ 3 /3  
	( ]]00) 1 .2  ]]00,&$#7 1 N )-n&%1
( 4 !$E  9>B>">m --
*
*m
*
D>  "  A GR G# Gn --
*
*^
*
L G# 
 --
+
+": ,  /
 
#&G  9>B>">m --
*
*m
*
D>  "  A GR G# Gn --
*
*^
*
L G# 
 --
+
+": ,  /  
--
-
-0 .  1  
--
-
-0 .  1 mmVV)$88K( W G
 ;;88>>wGG_"#"#s   #I1#I#I 5#I%c                     |r8| j                   j                         }|s|s|rt        j                  d      d}n+d}t	        |      }| j                   j                  |||      }t        ||      S )z%Returns ReportFormatOptions instance.r   N)	delimiterheaderRequiredrecordSeparatorr(   )r5   ParquetOptionsr	   GcsApiErrorr   
CSVOptionsr'   )r6   csv_separatorcsv_delimiter
csv_headerr*   parquet_optionscsv_optionsunescaped_separators           r   _get_report_format_optionsz&InsightsApi._get_report_format_options  s~     446o	}  !JKKko0?MM,,!#- - k
  r   c           	         | j                   j                  | j                   j                  |j                  |j                  |j
                        | j                   j                  |j                  |j                  |j
                        t        | j                   j                  j                  |j                                     }| j                   j                  || j                   j                  |j                  |j                        | j                   j                  |            }| j                  |||	|
      }| j                   j                  |j                   |j"                  |||      }| j                   j%                  t'        |      |      }| j(                  j*                  j-                  |      S )a  Creates a report config.

    Args:
      source_bucket (str): Source bucket name for which reports will be
        generated.
      destination_url (storage_url.CloudUrl): The destination url where the
        generated reports will be stored.
      metadata_fields (list[str]): Fields to be included in the report.
      start_date (datetime.datetime.date): The date to start generating reports.
      end_date (datetime.datetime.date): The date after which to stop generating
        reports.
      frequency (str): Can be either DAILY or WEEKLY.
      csv_separator (str): The character used to separate the records in the
        CSV file.
      csv_delimiter (str): The delimiter that separates the fields in the CSV
        file.
      csv_header (bool): If True, include the headers in the CSV file.
      parquet (bool): If True, set the parquet options.
      display_name (str): Display name for the report config.

    Returns:
      The created ReportConfig object.
    yearmonthday	startDateendDate	frequencyr#   destinationPath)r#   )metadataFieldsstorageDestinationOptionsstorageFilters
csvOptionsparquetOptionsdisplayNamefrequencyOptionsobjectMetadataReportOptions)ra   reportConfig)r5   FrequencyOptionsDater   r   r   getattrFrequencyValueValuesEnumrd   ObjectMetadataReportOptionsCloudStorageDestinationOptionsbucket_nameresource_nameCloudStorageFiltersr   ReportConfigr)   r*   :StorageinsightsProjectsLocationsReportConfigsCreateRequestr&   r
    projects_locations_reportConfigsrs   )r6   source_bucketdestination_urlmetadata_fields
start_dateend_dater   r   r   r   r*   display_namefrequency_optionsobject_metadata_report_optionsreport_format_optionsreport_configr~   s                    r   create_inventory_reportz#InsightsApi.create_inventory_report  s   J 66--$$
(8(8jnn % N""hnn(,, # HMM**CCOO 7   &*]]%N%N&"&--"N"N"..+99 #O #; }}88  9 " &O &#" !;;}j'; MM..(,,,44 *$B / DM ]]]]-m<" ^ $N ;;77>> r   c                 J   g }|*|j                  dj                  |j                               |`|j                  dj                  |j                               |j                  *|j                  dj                  |j                               |rdj	                  |      S y)z1Returns the filter string used for list API call.Nz6objectMetadataReportOptions.storageFilters.bucket="{}"zAobjectMetadataReportOptions.storageDestinationOptions.bucket="{}"zJobjectMetadataReportOptions.storageDestinationOptions.destinationPath="{}"z AND )r   r   r   r   r   )r6   r   destinationfilter_lists       r   _get_filters_for_listz!InsightsApi._get_filters_for_listW  s    K 
B
I
I'')*
 {6679 
	"	"	.##)6+*C*C#D	F \\+&&r   c           
         |=t        t        j                  j                  j                  j                         |      }n#t        ||j                  n|j                        }t        j                  | j                  j                  | j                  j                  || j                  ||            ||nt        dd      S )a  Lists the report configs.

    Args:
      source_bucket (storage_url.CloudUrl): Source bucket for which reports will
        be generated.
      destination (storage_url.CloudUrl): The destination url where the
        generated reports will be stored.
      location (str): The location for which the report configs should be
        listed.
      page_size (int|None): Number of items per request to be returend.

    Returns:
      List of Report configs.
    )ra   filterr   reportConfigsr   )r   r   r   r   r   r   r&   r   r   r   r
   r   r5   8StorageinsightsProjectsLocationsReportConfigsListRequestr   r   )r6   r   r   r   r   ra   s         r   list_inventory_reportsz"InsightsApi.list_inventory_reportsm  s    " !*"3"3"8"8"@"@"D"D"F"*,f .& 
#
#,7,C,CEf ##44NN--m[I 	O 	K !* 599' r   c                     | j                   j                  j                  | j                  j	                  |            S )zGets the report config.r   )r
   r   r   r5   7StorageinsightsProjectsLocationsReportConfigsGetRequestr6   report_config_names     r   get_inventory_reportz InsightsApi.get_inventory_report  s:    ;;77;;MM# 	N 	%& &r   c                     | j                   j                  ||      }| j                  j                  j	                  |      S )zDeletes the report config.)rQ   force)r5   :StorageinsightsProjectsLocationsReportConfigsDeleteRequestr
   r   r   )r6   r   r   r   s       r   delete_inventory_reportz#InsightsApi.delete_inventory_report  sC     		C	C#5 
D 
2  ;;77>>wGGr   c                 *   g }|N| j                   j                  |j                  |j                  |j                        }|j                  d       nd}|N| j                   j                  |j                  |j                  |j                        }|j                  d       nd}|Jt        | j                   j                  j                  |j                               }|j                  d       nd}| j                   j                  |||      |fS )zBReturns a tuple of messages.FrequencyOptions and update_mask list.Nr   zfrequencyOptions.startDatezfrequencyOptions.endDatezfrequencyOptions.frequencyr   )
r5   r   r   r   r   r   r   r   r   rd   )r6   r   r   r   r   start_date_messageend_date_messagefrequency_messages           r   &_get_frequency_options_and_update_maskz2InsightsApi._get_frequency_options_and_update_mask  s    K==--j&6&6JNN . L56++}}HNN , F34!
--
(
(
A
A
//
 56&&($' 	' 	) 	 r   c                    g }|r|j                  d       |T| j                  j                  |j                  |j                        }|j                  d       |j                  d       nd}| j                  j                  ||      |fS )zHReturns a tuple of messages.ObjectMetadataReportOptions and update_mask.z*objectMetadataReportOptions.metadataFieldsNr   z<objectMetadataReportOptions.storageDestinationOptions.bucketzEobjectMetadataReportOptions.storageDestinationOptions.destinationPath)r   r   )r   r5   r   r   r   r   )r6   r   r   r   storage_destination_messages        r   %_get_metadata_options_and_update_maskz1InsightsApi._get_metadata_options_and_update_mask  s     KEF"
--
6
6$00-;; 7  " 
HJ %)!MM55&"= 6 ?@KM Mr   c                     | j                  ||||      }g }|j                  |j                  d       ||fS ||j                  d       ||j                  d       ||j                  d       ||fS )z<Returns a tuple of ReportFormatOptions and update_mask list.r   zcsvOptions.delimiterzcsvOptions.headerRequiredzcsvOptions.recordSeparator)r   r*   r   )r6   r   r   r   r*   r   r   s          r   *_get_report_format_options_and_update_maskz6InsightsApi._get_report_format_options_and_update_mask  s     !;;}j';K$$0)* ";// 
	"12		67		"78!;//r   c                    | j                  |||      \  }}| j                  ||      \  }}| j                  |||	|
      \  }}||z   |z   }||j                  d       |s$t	        j
                  dj                  |            | j                  j                  |j                  |j                  |||      }| j                  j                  ||dj                  |            }| j                  j                  j                  |      S )a  Updates a report config.

    Args:
      report_config_name (str): The name of the report config to be modified.
      destination_url (storage_url.CloudUrl): The destination url where the
        generated reports will be stored.
      metadata_fields (list[str]): Fields to be included in the report.
      start_date (datetime.datetime.date): The date to start generating reports.
      end_date (datetime.datetime.date): The date after which to stop generating
        reports.
      frequency (str): Can be either DAILY or WEEKLY.
      csv_separator (str): The character used to separate the records in the
        CSV file.
      csv_delimiter (str): The delimiter that separates the fields in the CSV
        file.
      csv_header (bool): If True, include the headers in the CSV file.
      parquet (bool): If True, set the parquet options.
      display_name (str): Display name for the report config.

    Returns:
      The created ReportConfig object.
    r   z'Nothing to update for report config: {}r   r   )rQ   r   r   )r  r  r  r   r	   CloudApiErrorr   r5   r   r)   r*   9StorageinsightsProjectsLocationsReportConfigsPatchRequestr   r
   r   r   )r6   r   r   r   r   r   r   r   r   r   r*   r   r   frequency_update_maskr   metadata_update_maskr   report_format_maskr   r   r   s                        r   update_inventory_reportz#InsightsApi.update_inventory_report  sA   J 	33)	- -, 	22_	. 9"$8
 	77=*g	? .- 	 447II  '  
3
:
:;M
NP P MM..(,,,44 *$B / DM 	OO#&xx, 	P 	
  ;;77==gFFr   c                     t        j                  | j                  j                  | j                  j                  |      ||nt        dd      S )zLists the report details.r   r   reportDetailsr   )r   r   r
   .projects_locations_reportConfigs_reportDetailsr5   EStorageinsightsProjectsLocationsReportConfigsReportDetailsListRequestr   )r6   r   r   s      r   list_report_detailszInsightsApi.list_report_details,  sM    ##BB	N	N% 
O 
' ) 599' r   c                     | j                   j                  j                  | j                  j	                  |            S Nr   )r
   r  r   r5   DStorageinsightsProjectsLocationsReportConfigsReportDetailsGetRequestr   s     r   get_report_detailszInsightsApi.get_report_details7  s:    ;;EEII	M	M# 
N 
%& &r   c                     | j                   j                  j                  | j                  j	                  |             y r  )r
   projects_locations_operationsCancelr5   7StorageinsightsProjectsLocationsOperationsCancelRequestr6   operation_names     r   cancel_operationzInsightsApi.cancel_operation=  s5    KK--44MM 	N 	
r   c                     | j                   j                  j                  | j                  j	                  |            S r  )r
   r  r   r5   4StorageinsightsProjectsLocationsOperationsGetRequestr  s     r   get_operationzInsightsApi.get_operationD  s:    ;;4488JJ 	K 	
 r   c                     | j                   j                  |      }t        j                  | j                  j
                  |dd      S )Nr   r   
operations)r   r   )r5   5StorageinsightsProjectsLocationsOperationsListRequestr   r   r
   r  )r6   parent_resource_namer   s      r   list_operationszInsightsApi.list_operationsK  sM    KK% 	L 	
 
 ##11'	 r   )NFNNNNNNNNFNN)NN)NNNNNNNNNNNNN)	NNNNNNNNN)NNNN)F)
NNNNNNNNNNr   )"__name__
__module____qualname____doc__r1   strintr   boolr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r"  r'  __classcell__)r7   s   @r   r,   r,   B   s&   (I 7;!&6:59CGCG;?;?:>:>#('^P^P ^P 	^P
 ^P ^P '/sm^P ^P %Xc]3^P $HSM2^P *2(3-)@^P *2(3-)@^P "*(3-!8^P "*(3-!8^P !)# 7^P  !)# 7!^P" !#^P$ %^P& '^P@NIP< "&1504;?CG;?CG:>:>#'"6:00  .0 x}-	0
 "*(3-!80 *2(3-)@0 "*(3-!80 *2(3-)@0 !)# 70 !)# 70 !0 0 '/sm0 0j "&6:59;?CG;?CG:>:>#'"6:fH fH %Xc]3	fH
 $HSM2fH "*(3-!8fH *2(3-)@fH "*(3-!8fH *2(3-)@fH !)# 7fH !)# 7fH !fH fH '/smfH fHP4 BH. LPB&H<M00( GGR	&r   r,   )r+  
__future__r   r   r   collectionstypingr   r   apitools.base.pyr   googlecloudsdk.api_lib.storager	   'googlecloudsdk.api_lib.storage.gcs_jsonr
   r   googlecloudsdk.api_lib.utilr   r2   googlecloudsdk.corer   r   _CSV_PARQUET_ERROR_MESSGEr   r   r&   
namedtupler'   r,    r   r   <module>r;     sl    4 &  '  % ' 1 M 9 * 	E 8F -k,,- 
T Tr   