nodes: 0, module; 1, function_definition; 2, function_name:list_findings; 3, parameters; 4, block; 5, identifier:self; 6, identifier:parent; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, expression_statement; 16, comment:# Wrap the transport method to add retry and timeout logic.; 17, if_statement; 18, expression_statement; 19, if_statement; 20, expression_statement; 21, try_statement; 22, expression_statement; 23, return_statement; 24, identifier:filter_; 25, None; 26, identifier:order_by; 27, None; 28, identifier:read_time; 29, None; 30, identifier:field_mask; 31, None; 32, identifier:page_size; 33, None; 34, identifier:retry; 35, attribute; 36, identifier:timeout; 37, attribute; 38, identifier:metadata; 39, None; 40, comment:"""
          Lists an organization or source's findings.
  
          To list across all sources provide a ``-`` as the source id. Example:
          /v1beta1/organizations/123/sources/-/findings
  
          Example:
              >>> from google.cloud import securitycenter_v1beta1
              >>>
              >>> client = securitycenter_v1beta1.SecurityCenterClient()
              >>>
              >>> parent = client.source_path('[ORGANIZATION]', '[SOURCE]')
              >>>
              >>> # Iterate over all results
              >>> for element in client.list_findings(parent):
              ...     # process element
              ...     pass
              >>>
              >>>
              >>> # Alternatively:
              >>>
              >>> # Iterate over results one page at a time
              >>> for page in client.list_findings(parent).pages:
              ...     for element in page:
              ...         # process element
              ...         pass
  
          Args:
              parent (str): Name of the source the findings belong to. Its format is
                  "organizations/[organization\_id]/sources/[source\_id]". To list across
                  all sources provide a source\_id of ``-``. For example:
                  organizations/123/sources/-
              filter_ (str): Expression that defines the filter to apply across findings. The
                  expression is a list of one or more restrictions combined via logical
                  operators ``AND`` and ``OR``. Parentheses are not supported, and ``OR``
                  has higher precedence than ``AND``.
  
                  Restrictions have the form ``<field> <operator> <value>`` and may have a
                  ``-`` character in front of them to indicate negation. Examples include:
  
                  -  name
                  -  source\_properties.a\_property
                  -  security\_marks.marks.marka
  
                  The supported operators are:
  
                  -  ``=`` for all value types.
                  -  ``>``, ``<``, ``>=``, ``<=`` for integer values.
                  -  ``:``, meaning substring matching, for strings.
  
                  The supported value types are:
  
                  -  string literals in quotes.
                  -  integer literals without quotes.
                  -  boolean literals ``true`` and ``false`` without quotes.
  
                  For example, ``source_properties.size = 100`` is a valid filter string.
              order_by (str): Expression that defines what fields and order to use for sorting. The
                  string value should follow SQL syntax: comma separated list of fields.
                  For example: "name,resource\_properties.a\_property". The default
                  sorting order is ascending. To specify descending order for a field, a
                  suffix " desc" should be appended to the field name. For example: "name
                  desc,source\_properties.a\_property". Redundant space characters in the
                  syntax are insignificant. "name desc,source\_properties.a\_property" and
                  " name desc , source\_properties.a\_property " are equivalent.
              read_time (Union[dict, ~google.cloud.securitycenter_v1beta1.types.Timestamp]): Time used as a reference point when filtering findings. The filter is
                  limited to findings existing at the supplied time and their values are
                  those at that specific time. Absence of this field will default to the
                  API's version of NOW.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.securitycenter_v1beta1.types.Timestamp`
              field_mask (Union[dict, ~google.cloud.securitycenter_v1beta1.types.FieldMask]): Optional.
  
                  A field mask to specify the Finding fields to be listed in the response.
                  An empty field mask will list all fields.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.securitycenter_v1beta1.types.FieldMask`
              page_size (int): The maximum number of resources contained in the
                  underlying API response. If page streaming is performed per-
                  resource, this parameter does not affect the return value. If page
                  streaming is performed per-page, this determines the maximum number
                  of resources in a page.
              retry (Optional[google.api_core.retry.Retry]):  A retry object used
                  to retry requests. If ``None`` is specified, requests will not
                  be retried.
              timeout (Optional[float]): The amount of time, in seconds, to wait
                  for the request to complete. Note that if ``retry`` is
                  specified, the timeout applies to each individual attempt.
              metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                  that is provided to the method.
  
          Returns:
              A :class:`~google.gax.PageIterator` instance. By default, this
              is an iterable of :class:`~google.cloud.securitycenter_v1beta1.types.Finding` instances.
              This object can also be configured to iterate over the pages
              of the response through the `options` parameter.
  
          Raises:
              google.api_core.exceptions.GoogleAPICallError: If the request
                      failed for any reason.
              google.api_core.exceptions.RetryError: If the request failed due
                      to a retryable error and retry attempts failed.
              ValueError: If the parameters are invalid.
          """; 41, comparison_operator:"list_findings" not in self._inner_api_calls; 42, block; 43, assignment; 44, comparison_operator:metadata is None; 45, block; 46, assignment; 47, block; 48, except_clause; 49, else_clause; 50, assignment; 51, identifier:iterator; 52, attribute; 53, identifier:DEFAULT; 54, attribute; 55, identifier:DEFAULT; 56, string:"list_findings"; 57, attribute; 58, expression_statement; 59, identifier:request; 60, call; 61, identifier:metadata; 62, None; 63, expression_statement; 64, identifier:metadata; 65, call; 66, expression_statement; 67, identifier:AttributeError; 68, block; 69, block; 70, identifier:iterator; 71, call; 72, attribute; 73, identifier:method; 74, attribute; 75, identifier:method; 76, identifier:self; 77, identifier:_inner_api_calls; 78, assignment; 79, attribute; 80, argument_list; 81, assignment; 82, identifier:list; 83, argument_list; 84, assignment; 85, pass_statement; 86, expression_statement; 87, expression_statement; 88, attribute; 89, argument_list; 90, attribute; 91, identifier:gapic_v1; 92, attribute; 93, identifier:gapic_v1; 94, subscript; 95, call; 96, identifier:securitycenter_service_pb2; 97, identifier:ListFindingsRequest; 98, keyword_argument; 99, keyword_argument; 100, keyword_argument; 101, keyword_argument; 102, keyword_argument; 103, keyword_argument; 104, identifier:metadata; 105, list; 106, identifier:metadata; 107, identifier:routing_header; 108, list; 109, assignment; 110, call; 111, attribute; 112, identifier:GRPCIterator; 113, keyword_argument; 114, keyword_argument; 115, keyword_argument; 116, keyword_argument; 117, keyword_argument; 118, keyword_argument; 119, identifier:google; 120, identifier:api_core; 121, identifier:google; 122, identifier:api_core; 123, attribute; 124, string:"list_findings"; 125, attribute; 126, argument_list; 127, identifier:parent; 128, identifier:parent; 129, identifier:filter; 130, identifier:filter_; 131, identifier:order_by; 132, identifier:order_by; 133, identifier:read_time; 134, identifier:read_time; 135, identifier:field_mask; 136, identifier:field_mask; 137, identifier:page_size; 138, identifier:page_size; 139, tuple; 140, identifier:routing_metadata; 141, call; 142, attribute; 143, argument_list; 144, attribute; 145, identifier:page_iterator; 146, identifier:client; 147, None; 148, identifier:method; 149, call; 150, identifier:request; 151, identifier:request; 152, identifier:items_field; 153, string:"findings"; 154, identifier:request_token_field; 155, string:"page_token"; 156, identifier:response_token_field; 157, string:"next_page_token"; 158, identifier:self; 159, identifier:_inner_api_calls; 160, attribute; 161, identifier:wrap_method; 162, attribute; 163, keyword_argument; 164, keyword_argument; 165, keyword_argument; 166, string:"parent"; 167, identifier:parent; 168, attribute; 169, argument_list; 170, identifier:metadata; 171, identifier:append; 172, identifier:routing_metadata; 173, identifier:google; 174, identifier:api_core; 175, attribute; 176, argument_list; 177, attribute; 178, identifier:method; 179, attribute; 180, identifier:list_findings; 181, identifier:default_retry; 182, attribute; 183, identifier:default_timeout; 184, attribute; 185, identifier:client_info; 186, attribute; 187, attribute; 188, identifier:to_grpc_metadata; 189, identifier:routing_header; 190, identifier:functools; 191, identifier:partial; 192, subscript; 193, keyword_argument; 194, keyword_argument; 195, keyword_argument; 196, attribute; 197, identifier:gapic_v1; 198, identifier:self; 199, identifier:transport; 200, subscript; 201, identifier:retry; 202, subscript; 203, identifier:timeout; 204, identifier:self; 205, identifier:_client_info; 206, attribute; 207, identifier:routing_header; 208, attribute; 209, string:"list_findings"; 210, identifier:retry; 211, identifier:retry; 212, identifier:timeout; 213, identifier:timeout; 214, identifier:metadata; 215, identifier:metadata; 216, identifier:google; 217, identifier:api_core; 218, attribute; 219, string:"ListFindings"; 220, attribute; 221, string:"ListFindings"; 222, attribute; 223, identifier:gapic_v1; 224, identifier:self; 225, identifier:_inner_api_calls; 226, identifier:self; 227, identifier:_method_configs; 228, identifier:self; 229, identifier:_method_configs; 230, identifier:google; 231, identifier:api_core
code: def list_findings(
          self,
          parent,
          filter_=None,
          order_by=None,
          read_time=None,
          field_mask=None,
          page_size=None,
          retry=google.api_core.gapic_v1.method.DEFAULT,
          timeout=google.api_core.gapic_v1.method.DEFAULT,
          metadata=None,
      ):
          """
          Lists an organization or source's findings.
  
          To list across all sources provide a ``-`` as the source id. Example:
          /v1beta1/organizations/123/sources/-/findings
  
          Example:
              >>> from google.cloud import securitycenter_v1beta1
              >>>
              >>> client = securitycenter_v1beta1.SecurityCenterClient()
              >>>
              >>> parent = client.source_path('[ORGANIZATION]', '[SOURCE]')
              >>>
              >>> # Iterate over all results
              >>> for element in client.list_findings(parent):
              ...     # process element
              ...     pass
              >>>
              >>>
              >>> # Alternatively:
              >>>
              >>> # Iterate over results one page at a time
              >>> for page in client.list_findings(parent).pages:
              ...     for element in page:
              ...         # process element
              ...         pass
  
          Args:
              parent (str): Name of the source the findings belong to. Its format is
                  "organizations/[organization\_id]/sources/[source\_id]". To list across
                  all sources provide a source\_id of ``-``. For example:
                  organizations/123/sources/-
              filter_ (str): Expression that defines the filter to apply across findings. The
                  expression is a list of one or more restrictions combined via logical
                  operators ``AND`` and ``OR``. Parentheses are not supported, and ``OR``
                  has higher precedence than ``AND``.
  
                  Restrictions have the form ``<field> <operator> <value>`` and may have a
                  ``-`` character in front of them to indicate negation. Examples include:
  
                  -  name
                  -  source\_properties.a\_property
                  -  security\_marks.marks.marka
  
                  The supported operators are:
  
                  -  ``=`` for all value types.
                  -  ``>``, ``<``, ``>=``, ``<=`` for integer values.
                  -  ``:``, meaning substring matching, for strings.
  
                  The supported value types are:
  
                  -  string literals in quotes.
                  -  integer literals without quotes.
                  -  boolean literals ``true`` and ``false`` without quotes.
  
                  For example, ``source_properties.size = 100`` is a valid filter string.
              order_by (str): Expression that defines what fields and order to use for sorting. The
                  string value should follow SQL syntax: comma separated list of fields.
                  For example: "name,resource\_properties.a\_property". The default
                  sorting order is ascending. To specify descending order for a field, a
                  suffix " desc" should be appended to the field name. For example: "name
                  desc,source\_properties.a\_property". Redundant space characters in the
                  syntax are insignificant. "name desc,source\_properties.a\_property" and
                  " name desc , source\_properties.a\_property " are equivalent.
              read_time (Union[dict, ~google.cloud.securitycenter_v1beta1.types.Timestamp]): Time used as a reference point when filtering findings. The filter is
                  limited to findings existing at the supplied time and their values are
                  those at that specific time. Absence of this field will default to the
                  API's version of NOW.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.securitycenter_v1beta1.types.Timestamp`
              field_mask (Union[dict, ~google.cloud.securitycenter_v1beta1.types.FieldMask]): Optional.
  
                  A field mask to specify the Finding fields to be listed in the response.
                  An empty field mask will list all fields.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.securitycenter_v1beta1.types.FieldMask`
              page_size (int): The maximum number of resources contained in the
                  underlying API response. If page streaming is performed per-
                  resource, this parameter does not affect the return value. If page
                  streaming is performed per-page, this determines the maximum number
                  of resources in a page.
              retry (Optional[google.api_core.retry.Retry]):  A retry object used
                  to retry requests. If ``None`` is specified, requests will not
                  be retried.
              timeout (Optional[float]): The amount of time, in seconds, to wait
                  for the request to complete. Note that if ``retry`` is
                  specified, the timeout applies to each individual attempt.
              metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                  that is provided to the method.
  
          Returns:
              A :class:`~google.gax.PageIterator` instance. By default, this
              is an iterable of :class:`~google.cloud.securitycenter_v1beta1.types.Finding` instances.
              This object can also be configured to iterate over the pages
              of the response through the `options` parameter.
  
          Raises:
              google.api_core.exceptions.GoogleAPICallError: If the request
                      failed for any reason.
              google.api_core.exceptions.RetryError: If the request failed due
                      to a retryable error and retry attempts failed.
              ValueError: If the parameters are invalid.
          """
          # Wrap the transport method to add retry and timeout logic.
          if "list_findings" not in self._inner_api_calls:
              self._inner_api_calls[
                  "list_findings"
              ] = google.api_core.gapic_v1.method.wrap_method(
                  self.transport.list_findings,
                  default_retry=self._method_configs["ListFindings"].retry,
                  default_timeout=self._method_configs["ListFindings"].timeout,
                  client_info=self._client_info,
              )
  
          request = securitycenter_service_pb2.ListFindingsRequest(
              parent=parent,
              filter=filter_,
              order_by=order_by,
              read_time=read_time,
              field_mask=field_mask,
              page_size=page_size,
          )
          if metadata is None:
              metadata = []
          metadata = list(metadata)
          try:
              routing_header = [("parent", parent)]
          except AttributeError:
              pass
          else:
              routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
                  routing_header
              )
              metadata.append(routing_metadata)
  
          iterator = google.api_core.page_iterator.GRPCIterator(
              client=None,
              method=functools.partial(
                  self._inner_api_calls["list_findings"],
                  retry=retry,
                  timeout=timeout,
                  metadata=metadata,
              ),
              request=request,
              items_field="findings",
              request_token_field="page_token",
              response_token_field="next_page_token",
          )
          return iterator