:doc:`Inspector2 <../../inspector2>` / Client / batch_get_code_snippet

**********************
batch_get_code_snippet
**********************



.. py:method:: Inspector2.Client.batch_get_code_snippet(**kwargs)

  

  Retrieves code snippets from findings that Amazon Inspector detected code vulnerabilities in.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/inspector2-2020-06-08/BatchGetCodeSnippet>`_  


  **Request Syntax**
  ::

    response = client.batch_get_code_snippet(
        findingArns=[
            'string',
        ]
    )
    
  :type findingArns: list
  :param findingArns: **[REQUIRED]** 

    An array of finding ARNs for the findings you want to retrieve code snippets from.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'codeSnippetResults': [
              {
                  'findingArn': 'string',
                  'startLine': 123,
                  'endLine': 123,
                  'codeSnippet': [
                      {
                          'content': 'string',
                          'lineNumber': 123
                      },
                  ],
                  'suggestedFixes': [
                      {
                          'description': 'string',
                          'code': 'string'
                      },
                  ]
              },
          ],
          'errors': [
              {
                  'findingArn': 'string',
                  'errorCode': 'INTERNAL_ERROR'|'ACCESS_DENIED'|'CODE_SNIPPET_NOT_FOUND'|'INVALID_INPUT',
                  'errorMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **codeSnippetResults** *(list) --* 

        The retrieved code snippets associated with the provided finding ARNs.

        
        

        - *(dict) --* 

          Contains information on a code snippet retrieved by Amazon Inspector from a code vulnerability finding.

          
          

          - **findingArn** *(string) --* 

            The ARN of a finding that the code snippet is associated with.

            
          

          - **startLine** *(integer) --* 

            The line number of the first line of a code snippet.

            
          

          - **endLine** *(integer) --* 

            The line number of the last line of a code snippet.

            
          

          - **codeSnippet** *(list) --* 

            Contains information on the retrieved code snippet.

            
            

            - *(dict) --* 

              Contains information on the lines of code associated with a code snippet.

              
              

              - **content** *(string) --* 

                The content of a line of code

                
              

              - **lineNumber** *(integer) --* 

                The line number that a section of code is located at.

                
          
        
          

          - **suggestedFixes** *(list) --* 

            Details of a suggested code fix.

            
            

            - *(dict) --* 

              A suggested fix for a vulnerability in your Lambda function code.

              
              

              - **description** *(string) --* 

                The fix's description.

                
              

              - **code** *(string) --* 

                The fix's code.

                
          
        
      
    
      

      - **errors** *(list) --* 

        Any errors Amazon Inspector encountered while trying to retrieve the requested code snippets.

        
        

        - *(dict) --* 

          Contains information about any errors encountered while trying to retrieve a code snippet.

          
          

          - **findingArn** *(string) --* 

            The ARN of the finding that a code snippet couldn't be retrieved for.

            
          

          - **errorCode** *(string) --* 

            The error code for the error that prevented a code snippet from being retrieved.

            
          

          - **errorMessage** *(string) --* 

            The error message received when Amazon Inspector failed to retrieve a code snippet.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`Inspector2.Client.exceptions.ValidationException`

  
  *   :py:class:`Inspector2.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Inspector2.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Inspector2.Client.exceptions.InternalServerException`

  