

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# GetPublicProject
<a name="API_GetPublicProject"></a>

**注意**  
 AWS CLI 或 AWS 软件开发工具包中不包含此 API 元素。

## 请求语法
<a name="API_GetPublicProject_RequestSyntax"></a>

```
{
   "publicProjectAlias": "{{string}}"
}
```

## 请求参数
<a name="API_GetPublicProject_RequestParameters"></a>

有关所有操作的通用参数的信息，请参阅[常用参数](https://docs.aws.amazon.com/codebuild/latest/APIReference/CommonParameters.html)。

请求接受采用 JSON 格式的以下数据。

**注意**  
下表中首先描述了必需参数。

 **[公众 ProjectAlias](#API_GetPublicProject_RequestSyntax)**   <a name="CodeBuild-GetPublicProject-request-publicProjectAlias"></a>
类型：字符串  
长度限制：最小长度为 1。长度上限为 1024。  
模式：`^[0-9a-zA-Z%+=]+$`  
必需：是

## 响应语法
<a name="API_GetPublicProject_ResponseSyntax"></a>

```
{
   "project": { 
      "artifacts": { 
         "artifactIdentifier": "string",
         "location": "string",
         "type": "string"
      },
      "buildBatchConfig": { 
         "combineArtifacts": boolean,
         "restrictions": { 
            "[computeTypesAllowed](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BatchRestrictions.html)": [ "string" ],
            "[maximumBuildsAllowed](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BatchRestrictions.html)": number
         },
         "timeoutInMins": number
      },
      "concurrentBuildLimit": number,
      "description": "string",
      "environment": { 
         "computeType": "string",
         "environmentVariables": [ 
            { 
               "[name](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_EnvironmentVariable.html)": "string",
               "[type](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_EnvironmentVariable.html)": "string",
               "[value](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_EnvironmentVariable.html)": "string"
            }
         ],
         "image": "string",
         "type": "string"
      },
      "name": "string",
      "queuedTimeoutInMinutes": number,
      "secondaryArtifacts": [ 
         { 
            "artifactIdentifier": "string",
            "location": "string",
            "type": "string"
         }
      ],
      "secondarySources": [ 
         { 
            "buildspec": "string",
            "gitCloneDepth": number,
            "gitSubmodulesConfig": { 
               "[fetchSubmodules](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_GitSubmodulesConfig.html)": boolean
            },
            "location": "string",
            "sourceIdentifier": "string",
            "type": "string"
         }
      ],
      "secondarySourceVersions": [ 
         { 
            "[sourceIdentifier](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSourceVersion.html)": "string",
            "[sourceVersion](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSourceVersion.html)": "string"
         }
      ],
      "source": { 
         "buildspec": "string",
         "gitCloneDepth": number,
         "gitSubmodulesConfig": { 
            "[fetchSubmodules](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_GitSubmodulesConfig.html)": boolean
         },
         "location": "string",
         "sourceIdentifier": "string",
         "type": "string"
      },
      "sourceVersion": "string",
      "timeoutInMinutes": number,
      "webhook": { 
         "branchFilter": "string",
         "buildType": "string",
         "filterGroups": [ 
            [ 
               { 
                  "[excludeMatchedPattern](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_WebhookFilter.html)": boolean,
                  "[pattern](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_WebhookFilter.html)": "string",
                  "[type](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_WebhookFilter.html)": "string"
               }
            ]
         ],
         "payloadUrl": "string",
         "url": "string"
      }
   }
}
```

## 响应元素
<a name="API_GetPublicProject_ResponseElements"></a>

如果此操作成功，则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

 **[项目](#API_GetPublicProject_ResponseSyntax)**   <a name="CodeBuild-GetPublicProject-response-project"></a>
类型：[PublicProject](API_PublicProject.md) 对象

## 错误
<a name="API_GetPublicProject_Errors"></a>

有关所有操作中常见的错误的信息，请参阅[常见错误](https://docs.aws.amazon.com/codebuild/latest/APIReference/CommonErrors.html)。

 **InvalidInputException**   
HTTP 状态代码：400

 **ResourceNotFoundException**   
HTTP 状态代码：400