SecurityAgent / Client / update_integrated_resources

update_integrated_resources

SecurityAgent.Client.update_integrated_resources(**kwargs)

Updates the integrated resources for an agent space, including their capabilities.

See also: AWS API Documentation

Request Syntax

response = client.update_integrated_resources(
    agentSpaceId='string',
    integrationId='string',
    items=[
        {
            'resource': {
                'githubRepository': {
                    'name': 'string',
                    'owner': 'string'
                },
                'gitlabRepository': {
                    'name': 'string',
                    'namespace': 'string'
                },
                'bitbucketRepository': {
                    'name': 'string',
                    'workspace': 'string'
                },
                'confluenceDocument': {
                    'name': 'string',
                    'spaceKey': 'string',
                    'pageId': 'string',
                    'title': 'string',
                    'spaceTitle': 'string'
                },
                'azureDevOpsRepository': {
                    'name': 'string',
                    'organization': 'string',
                    'project': 'string'
                },
                'jiraProject': {
                    'name': 'string',
                    'projectKey': 'string',
                    'projectId': 'string',
                    'projectName': 'string'
                }
            },
            'capabilities': {
                'github': {
                    'triggerFilterGroups': [
                        {
                            'events': [
                                'PULL_REQUEST_READY_FOR_REVIEW'|'PULL_REQUEST_DRAFT'|'PULL_REQUEST_LABEL_ADDED',
                            ],
                            'filters': [
                                {
                                    'type': 'TARGET_BRANCH'|'LABEL',
                                    'patterns': [
                                        'string',
                                    ],
                                    'matchMode': 'INCLUDE'|'EXCLUDE'
                                },
                            ]
                        },
                    ],
                    'leaveComments': True|False,
                    'remediateCode': True|False
                },
                'gitlab': {
                    'triggerFilterGroups': [
                        {
                            'events': [
                                'PULL_REQUEST_READY_FOR_REVIEW'|'PULL_REQUEST_DRAFT'|'PULL_REQUEST_LABEL_ADDED',
                            ],
                            'filters': [
                                {
                                    'type': 'TARGET_BRANCH'|'LABEL',
                                    'patterns': [
                                        'string',
                                    ],
                                    'matchMode': 'INCLUDE'|'EXCLUDE'
                                },
                            ]
                        },
                    ],
                    'leaveComments': True|False,
                    'remediateCode': True|False
                },
                'bitbucket': {
                    'triggerFilterGroups': [
                        {
                            'events': [
                                'PULL_REQUEST_READY_FOR_REVIEW'|'PULL_REQUEST_DRAFT'|'PULL_REQUEST_LABEL_ADDED',
                            ],
                            'filters': [
                                {
                                    'type': 'TARGET_BRANCH'|'LABEL',
                                    'patterns': [
                                        'string',
                                    ],
                                    'matchMode': 'INCLUDE'|'EXCLUDE'
                                },
                            ]
                        },
                    ],
                    'leaveComments': True|False,
                    'remediateCode': True|False
                },
                'confluence': {
                    'fetchDocument': True|False,
                    'createDocument': True|False,
                    'updateDocument': True|False
                },
                'azureDevOps': {
                    'triggerFilterGroups': [
                        {
                            'events': [
                                'PULL_REQUEST_READY_FOR_REVIEW'|'PULL_REQUEST_DRAFT'|'PULL_REQUEST_LABEL_ADDED',
                            ],
                            'filters': [
                                {
                                    'type': 'TARGET_BRANCH'|'LABEL',
                                    'patterns': [
                                        'string',
                                    ],
                                    'matchMode': 'INCLUDE'|'EXCLUDE'
                                },
                            ]
                        },
                    ],
                    'leaveComments': True|False,
                    'remediateCode': True|False
                },
                'jira': {
                    'createIssue': True|False,
                    'commentIssue': True|False
                }
            }
        },
    ]
)
Parameters:
  • agentSpaceId (string) –

    [REQUIRED]

    The unique identifier of the agent space.

  • integrationId (string) –

    [REQUIRED]

    The unique identifier of the integration.

  • items (list) –

    [REQUIRED]

    The list of integrated resource items to update.

    • (dict) –

      Represents an input item for updating integrated resources, including the resource and its capabilities.

      • resource (dict) – [REQUIRED]

        The integrated resource to update.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: githubRepository, gitlabRepository, bitbucketRepository, confluenceDocument, azureDevOpsRepository, jiraProject.

        • githubRepository (dict) –

          The GitHub repository resource information.

          • name (string) – [REQUIRED]

            The name of the GitHub repository.

          • owner (string) – [REQUIRED]

            The owner of the GitHub repository.

        • gitlabRepository (dict) –

          A GitLab repository integrated as a resource.

          • name (string) – [REQUIRED]

            Name of the resource e.g. repository name, etc.

          • namespace (string) – [REQUIRED]

            The namespace (group or user path) that owns the project.

        • bitbucketRepository (dict) –

          A Bitbucket repository integrated as a resource.

          • name (string) – [REQUIRED]

            Name of the resource e.g. repository name, etc.

          • workspace (string) – [REQUIRED]

            The workspace slug that owns the repository.

        • confluenceDocument (dict) –

          A Confluence document (page) integrated as a resource.

          • name (string) – [REQUIRED]

            Name of the resource e.g. repository name, etc.

          • spaceKey (string) – [REQUIRED]

            The Confluence space key containing the document.

          • pageId (string) – [REQUIRED]

            The Confluence page identifier.

          • title (string) –

            The display title of the Confluence page.

          • spaceTitle (string) –

            The display title of the Confluence space.

        • azureDevOpsRepository (dict) –

          The Azure DevOps repository resource information.

          • name (string) – [REQUIRED]

            Name of the resource e.g. repository name, etc.

          • organization (string) – [REQUIRED]

            The name of the Azure DevOps organization that owns the repository.

          • project (string) –

            The name of the Azure DevOps project that contains the repository.

        • jiraProject (dict) –

          The Jira project resource information.

          • name (string) – [REQUIRED]

            Name of the resource e.g. repository name, etc.

          • projectKey (string) – [REQUIRED]

            The Jira project key, for example PROJ.

          • projectId (string) – [REQUIRED]

            The Jira project identifier.

          • projectName (string) –

            The display name of the Jira project.

      • capabilities (dict) –

        The capabilities to enable for the integrated resource.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: github, gitlab, bitbucket, confluence, azureDevOps, jira.

        • github (dict) –

          The GitHub-specific resource capabilities.

          • triggerFilterGroups (list) –

            The filter groups that control which pull request events start an automatic code review when leaveComments is enabled. A review starts when any group matches. If you omit this, a review starts on PULL_REQUEST_READY_FOR_REVIEW events.

            • (dict) –

              A set of conditions that start an automatic code review when they all pass. A filter group must include events, filters, or both.

              • events (list) –

                Passes when the pull request event is one of the listed events. If you omit this, the group matches PULL_REQUEST_READY_FOR_REVIEW and PULL_REQUEST_DRAFT events only.

                • (string) –

                  A pull request event that can start an automatic code review. For GitLab repositories, pull request refers to a merge request.

              • filters (list) –

                Passes when every filter passes. If you omit this, the group matches its events on any target branch and with any labels.

                • (dict) –

                  A condition on a pull request value.

                  • type (string) – [REQUIRED]

                    The pull request value to match.

                  • patterns (list) – [REQUIRED]

                    The regular expressions to match against the value.

                    • (string) –

                      A regular expression in RE2 syntax that must match the entire value, for example main or release/.*.

                  • matchMode (string) –

                    Whether the value must match the patterns. The default is INCLUDE.

          • leaveComments (boolean) –

            Indicates whether the integration can leave comments on pull requests.

          • remediateCode (boolean) –

            Indicates whether the integration can create code remediation pull requests.

        • gitlab (dict) –

          Capabilities for an integrated GitLab repository.

          • triggerFilterGroups (list) –

            The filter groups that control which merge request events start an automatic code review when leaveComments is enabled. A review starts when any group matches. If you omit this, a review starts on PULL_REQUEST_READY_FOR_REVIEW events.

            • (dict) –

              A set of conditions that start an automatic code review when they all pass. A filter group must include events, filters, or both.

              • events (list) –

                Passes when the pull request event is one of the listed events. If you omit this, the group matches PULL_REQUEST_READY_FOR_REVIEW and PULL_REQUEST_DRAFT events only.

                • (string) –

                  A pull request event that can start an automatic code review. For GitLab repositories, pull request refers to a merge request.

              • filters (list) –

                Passes when every filter passes. If you omit this, the group matches its events on any target branch and with any labels.

                • (dict) –

                  A condition on a pull request value.

                  • type (string) – [REQUIRED]

                    The pull request value to match.

                  • patterns (list) – [REQUIRED]

                    The regular expressions to match against the value.

                    • (string) –

                      A regular expression in RE2 syntax that must match the entire value, for example main or release/.*.

                  • matchMode (string) –

                    Whether the value must match the patterns. The default is INCLUDE.

          • leaveComments (boolean) –

            Whether to post code review comments on merge request discussions.

          • remediateCode (boolean) –

            Whether to create merge requests with automated fixes.

        • bitbucket (dict) –

          Capabilities for an integrated Bitbucket repository.

          • triggerFilterGroups (list) –

            The filter groups that control which pull request events start an automatic code review when leaveComments is enabled. A review starts when any group matches. If you omit this, a review starts on PULL_REQUEST_READY_FOR_REVIEW events.

            • (dict) –

              A set of conditions that start an automatic code review when they all pass. A filter group must include events, filters, or both.

              • events (list) –

                Passes when the pull request event is one of the listed events. If you omit this, the group matches PULL_REQUEST_READY_FOR_REVIEW and PULL_REQUEST_DRAFT events only.

                • (string) –

                  A pull request event that can start an automatic code review. For GitLab repositories, pull request refers to a merge request.

              • filters (list) –

                Passes when every filter passes. If you omit this, the group matches its events on any target branch and with any labels.

                • (dict) –

                  A condition on a pull request value.

                  • type (string) – [REQUIRED]

                    The pull request value to match.

                  • patterns (list) – [REQUIRED]

                    The regular expressions to match against the value.

                    • (string) –

                      A regular expression in RE2 syntax that must match the entire value, for example main or release/.*.

                  • matchMode (string) –

                    Whether the value must match the patterns. The default is INCLUDE.

          • leaveComments (boolean) –

            Whether to post code review comments on pull requests.

          • remediateCode (boolean) –

            Whether to create pull requests with automated fixes.

        • confluence (dict) –

          Capabilities for an integrated Confluence space.

          • fetchDocument (boolean) –

            Whether to fetch documents from this space.

          • createDocument (boolean) –

            Whether to create documents in this space.

          • updateDocument (boolean) –

            Whether to update documents in this space.

        • azureDevOps (dict) –

          The Azure DevOps-specific resource capabilities.

          • triggerFilterGroups (list) –

            The filter groups that control which pull request events start an automatic code review when leaveComments is enabled. A review starts when any group matches. If you omit this, a review starts on PULL_REQUEST_READY_FOR_REVIEW events.

            • (dict) –

              A set of conditions that start an automatic code review when they all pass. A filter group must include events, filters, or both.

              • events (list) –

                Passes when the pull request event is one of the listed events. If you omit this, the group matches PULL_REQUEST_READY_FOR_REVIEW and PULL_REQUEST_DRAFT events only.

                • (string) –

                  A pull request event that can start an automatic code review. For GitLab repositories, pull request refers to a merge request.

              • filters (list) –

                Passes when every filter passes. If you omit this, the group matches its events on any target branch and with any labels.

                • (dict) –

                  A condition on a pull request value.

                  • type (string) – [REQUIRED]

                    The pull request value to match.

                  • patterns (list) – [REQUIRED]

                    The regular expressions to match against the value.

                    • (string) –

                      A regular expression in RE2 syntax that must match the entire value, for example main or release/.*.

                  • matchMode (string) –

                    Whether the value must match the patterns. The default is INCLUDE.

          • leaveComments (boolean) –

            Whether to post code review comments on pull requests.

          • remediateCode (boolean) –

            Whether to create pull requests with automated fixes.

        • jira (dict) –

          The Jira-specific resource capabilities.

          • createIssue (boolean) –

            Whether to create issues in the integrated jira project.

          • commentIssue (boolean) –

            Whether to post comments on issues in the integrated jira project.

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions