
# 获取仓库详情 - ShowRepository
#### 功能介绍
获取仓库详情
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/CodeArtsRepo/doc?api=ShowRepository&version=v4)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号根用户具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备如下身份策略权限，更多的权限说明请参见[权限和授权项](https://support.huaweicloud.com/api-codeartsrepo/codeartsrepo_05_0036.html)。
| 授权项                                   | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项 |
|:---|:---|:---|:---|:---|:---|
| codeartsrepo:repository:getRepository | Read | -           | -   | -  | -      |
   
#### URI
GET /v4/repositories/{repository_id}
表1路径参数 
| 参数            | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|:---|
| repository_id | 是    | Integer | **参数解释：** 仓库的ID，通过[查询用户所有仓库](https://support.huaweicloud.com/api-codeartsrepo/ListUserAllRepositories.html)接口查询项目列表获取。 **约束限制：** 不涉及。 **默认取值：** 不涉及。 **取值范围：** 1\~2147483647 |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | **参数解释：** 用户Token。 通过调用IAM服务[获取用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)接口获取（响应消息头中X-Subject-Token的值）。 **约束限制：** 不涉及。 **取值范围：** 字符串长度不少于1，不超过10万。 **默认取值：** 不涉及。 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数                                               | 参数类型                                                                                      | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|
| id                                               | Integer                                                                                   | **参数解释：** 仓库ID。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| description                                      | String                                                                                    | **参数解释：** 仓库描述信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| name                                             | String                                                                                    | **参数解释：** 仓库名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| name_with_namespace                              | String                                                                                    | **参数解释：** 仓库完整名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| path                                             | String                                                                                    | **参数解释：** 仓库路径。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| path_with_namespace                              | String                                                                                    | **参数解释：** 仓库完整路径。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| created_at                                       | String                                                                                    | **参数解释：** 创建时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| updated_at                                       | String                                                                                    | **参数解释：** 更新时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| archived                                         | Boolean                                                                                   | **参数解释：** 是否归档。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ssh_url_to_repo                                  | String                                                                                    | **参数解释：** 仓库ssh地址。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| http_url_to_repo                                 | String                                                                                    | **参数解释：** 仓库http地址。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| project_id                                       | String                                                                                    | **参数解释：** 仓库所属项目ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| project_name                                     | String                                                                                    | **参数解释：** 仓库所属项目名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| develop_mode                                     | String                                                                                    | **参数解释：** 仓库开发模式。 **取值范围：** - normal   - CR                                                                                                                                                                                                                                                                                                                                                                |
| moderation_result                                | Boolean                                                                                   | **参数解释：** 审核状态。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| default_branch                                   | String                                                                                    | **参数解释：** 仓库默认分支 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| avatar_url                                       | String                                                                                    | **参数解释：** 仓库图标url **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| star_count                                       | Integer                                                                                   | **参数解释：** 关注数 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| forks_count                                      | Integer                                                                                   | **参数解释：** fork数 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| open_issues_count                                | Integer                                                                                   | **参数解释：** 开启issue数 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| open_merge_requests_count                        | Integer                                                                                   | **参数解释：** 开启中的CR、MR数量 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| last_activity_at                                 | String                                                                                    | **参数解释：** 最后活跃时间 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| namespace                                        | [NamespaceBasicDto] object                   | **参数解释：** 命名空间 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| empty_repo                                       | Boolean                                                                                   | **参数解释：** 空仓库 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| starred                                          | Boolean                                                                                   | **参数解释：** 是否已关注 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| visibility                                       | String                                                                                    | **参数解释：** 仓库可见等级 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| security_tag                                     | String                                                                                    | **参数解释：** 仓库保密等级 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| security                                         | String                                                                                    | **参数解释：** 仓库保密等级 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| network_type                                     | String                                                                                    | **参数解释：** 网络类型 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| owner                                            | [RepositoryUserBasicDto] object         | **参数解释：** 仓库所有者 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| creator                                          | [RepositoryUserBasicDto] object         | **参数解释：** 仓库创建者 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| creator_id                                       | Integer                                                                                   | **参数解释：** 创建者ID **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| forked_from_repository                           | [RepositorySimpleDto] object               | **参数解释：** fork仓库源仓 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| encryption_status                                | String                                                                                    | **参数解释：** 仓库加密状态 **取值范围：** - encrypting，加密中。   - encrypted，已加密。   - decrypting，解密中。   - decrypted，已解密。    **默认取值：** 不涉及。 |
| repo_encryption_enabled                          | Boolean                                                                                   | **参数解释：** 是否开启仓库加密 **取值范围：** - true，已开启加密。   - false，未开启加密。                                                                                                                                                                                                                                                                                                                                                |
| uuid                                             | String                                                                                    | **参数解释：** 仓库唯一标识符。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ancestor_ids                                     | Array of integers                                                                         | **参数解释：** 祖先仓库ID列表。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ancestor_names                                   | Array of strings                                                                          | **参数解释：** 祖先仓库名称列表。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| import_status                                    | String                                                                                    | **参数解释：** 导入状态。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| import_url                                       | String                                                                                    | **参数解释：** 导入源地址。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| import_error                                     | String                                                                                    | **参数解释：** 导入错误信息。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| repo_type                                        | String                                                                                    | **参数解释：** 仓库类型。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| only_allow_merge_if_pipeline_succeeds            | Boolean                                                                                   | **参数解释：** 是否仅在流水线成功时允许合并。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| request_access_enabled                           | Boolean                                                                                   | **参数解释：** 是否启用访问请求。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| only_allow_merge_if_all_discussions_are_resolved | Boolean                                                                                   | **参数解释：** 是否仅在所有检视意见解决时允许合并。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| merge_method                                     | String                                                                                    | **参数解释：** 合并方法。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| fork_network_repositories                        | Array of [RepositoryIdentityDto] objects | **参数解释：** fork关联仓库列表。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| permissions                                      | [PermissionsDto] object                         | 权限                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| repository_type                                  | String                                                                                    | **参数解释：** 仓库类型。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| statistics                                       | [RepositoryStatisticsDto] object       | **参数解释：** 项目统计信息。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| branch_count                                     | Integer                                                                                   | **参数解释：** 分支数量。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| tag_count                                        | Integer                                                                                   | **参数解释：** Tag数量。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| label_count                                      | Integer                                                                                   | **参数解释：** 标签数量。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| member_count                                     | Integer                                                                                   | **参数解释：** 成员数量。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   
 表4NamespaceBasicDto 
| 参数                  | 参数类型    | 描述                                                                                                                                                                                                                                 |
|:---|:---|:---|
| id                  | Integer | **参数解释：** 命名空间ID。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647 |
| name                | String  | **参数解释：** 命名空间名称。 **约束限制：** 不涉及。                                                                                             |
| path                | String  | **参数解释：** 路径。 **约束限制：** 不涉及。                                                                                                 |
| develop_mode        | String  | **参数解释：** 开发模式。 **约束限制：** 不涉及。                                                                                               |
| kind                | String  | **参数解释：** 类型。 **约束限制：** 不涉及。                                                                                                 |
| full_path           | String  | **参数解释：** 完整路径。 **约束限制：** 不涉及。                                                                                               |
| full_name           | String  | **参数解释：** 完整名称。 **约束限制：** 不涉及。                                                                                               |
| parent_id           | Integer | **参数解释：** 父级ID。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647   |
| visibility_level    | Integer | **参数解释：** 可见级别。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647   |
| enable_file_control | Boolean | **参数解释：** 开启文件权限控制。 **约束限制：** 不涉及。                                                                                           |
| owner_id            | Integer | **参数解释：** 所有人ID。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647  |
   
 表5RepositoryUserBasicDto 
| 参数                     | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| id                     | Integer | **参数解释：** 用户id **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                   |
| name                   | String  | **参数解释：** 用户名称 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                               |
| username               | String  | **参数解释：** 用户名 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                |
| state                  | String  | **参数解释：** 用户状态。 **取值范围：** - active，激活。   - blocked，禁用。    |
| service_license_status | Integer | **参数解释：** 服务级权限状态 0：停用 1：启用 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647                                                                                                                                                                                                      |
| name_cn                | String  | **参数解释：** 用户中文名称 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                             |
| nick_name              | String  | **参数解释：** 用户昵称 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                               |
| tenant_name            | String  | **参数解释：** 租户名称 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                               |
   
 表6RepositorySimpleDto 
| 参数                  | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|
| id                  | Integer | **参数解释：** 仓库ID。 **取值范围：** 1\~2147483647                                                                                                                                                                                                                                                                                          |
| description         | String  | **参数解释：** 仓库描述信息。                                                                                                                                                                                                                                                                                                                                                                                    |
| name                | String  | **参数解释：** 仓库名称。                                                                                                                                                                                                                                                                                                                                                                                      |
| name_with_namespace | String  | **参数解释：** 仓库完整名称。                                                                                                                                                                                                                                                                                                                                                                                    |
| path                | String  | **参数解释：** 仓库路径。                                                                                                                                                                                                                                                                                                                                                                                      |
| path_with_namespace | String  | **参数解释：** 仓库完整路径。                                                                                                                                                                                                                                                                                                                                                                                    |
| created_at          | String  | **参数解释：** 创建时间。                                                                                                                                                                                                                                                                                                                                                                                      |
| updated_at          | String  | **参数解释：** 更新时间。                                                                                                                                                                                                                                                                                                                                                                                      |
| archived            | Boolean | **参数解释：** 是否归档。                                                                                                                                                                                                                                                                                                                                                                                      |
| ssh_url_to_repo     | String  | **参数解释：** 仓库ssh地址。                                                                                                                                                                                                                                                                                                                                                                                   |
| http_url_to_repo    | String  | **参数解释：** 仓库http地址。                                                                                                                                                                                                                                                                                                                                                                                  |
| project_id          | String  | **参数解释：** 仓库所属项目ID。                                                                                                                                                                                                                                                                                                                                                                                  |
| project_name        | String  | **参数解释：** 仓库所属项目名称。                                                                                                                                                                                                                                                                                                                                                                                  |
| develop_mode        | String  | **参数解释：** 仓库开发模式。 **取值范围：** - normal   - CR    |
| moderation_result   | Boolean | **参数解释：** 审核状态。                                                                                                                                                                                                                                                                                                                                                                                      |
   
 表7RepositoryIdentityDto 
| 参数                  | 参数类型    | 描述                                                                                                                                                                                                                               |
|:---|:---|:---|
| id                  | Integer | **参数解释：** 项目ID。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647 |
| path_with_namespace | String  | **参数解释：** 项目路径。 **约束限制：** 不涉及。                                                                                             |
   
 表8PermissionsDto 
| 参数                | 参数类型                                                          | 描述                                                                                                                                    |
|:---|:---|:---|
| repository_access | [MemberAccess] object | **参数解释：** 仓库权限。 **约束限制：** 不涉及。  |
| group_access      | [MemberAccess] object | **参数解释：** 代码组权限。 **约束限制：** 不涉及。 |
   
 表9MemberAccess 
| 参数                 | 参数类型    | 描述                                                                                                                                                                                                                               |
|:---|:---|:---|
| access_level       | Integer | **参数解释：** 访问级别。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647 |
| notification_level | Integer | **参数解释：** 通知级别。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647 |
   
 表10RepositoryStatisticsDto 
| 参数                     | 参数类型    | 描述                                                                                                                                                                                                                                   |
|:---|:---|:---|
| commit_count           | Integer | **参数解释：** 提交数量。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647     |
| storage_size           | Double  | **参数解释：** 存储大小。 **约束限制：** 不涉及。 **取值范围：** 1.0\~1024000.0    |
| repository_size        | Double  | **参数解释：** 仓库大小。 **约束限制：** 不涉及。 **取值范围：** 1.0\~1024000.0    |
| lfs_objects_size       | Double  | **参数解释：** LFS对象大小。 **约束限制：** 不涉及。 **取值范围：** 1.0\~1024000.0 |
| tenant_repo_size_limit | Long    | **参数解释：** 租户仓库大小限制。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647 |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
获取仓库详情
```
{
  "id" : 2111993598,
  "description" : null,
  "name" : "test_import",
  "name_with_namespace" : "22d9c8e7fe464697bc2a358df175dd29 / g111 / g22 / g3 / g4 / g5 / test_import",
  "path" : "test_import",
  "path_with_namespace" : "22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5/test_import",
  "created_at" : "2025-01-14T20:13:56.000+08:00",
  "updated_at" : "2025-01-14T20:13:56.000+08:00",
  "archived" : false,
  "ssh_url_to_repo" : "git@repo.com:22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5/test_import.git",
  "http_url_to_repo" : "https://repo.com/22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5/test_import.git",
  "project_id" : "22d9c8e7fe464697bc2a358df175dd29",
  "project_name" : "SubscriptionTest",
  "develop_mode" : "normal",
  "moderation_result" : true,
  "default_branch" : "master",
  "star_count" : 0,
  "forks_count" : 0,
  "open_merge_requests_count" : 0,
  "last_activity_at" : "2025-01-14T20:13:56.000+08:00",
  "namespace" : {
    "id" : 2111853526,
    "name" : "g5",
    "path" : "g5",
    "develop_mode" : "normal",
    "kind" : "group",
    "full_path" : "22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5",
    "full_name" : null,
    "parent_id" : 2111853525,
    "visibility_level" : 0,
    "enable_file_control" : null,
    "owner_id" : null
  },
  "empty_repo" : false,
  "starred" : false,
  "visibility" : "private",
  "security" : "internal",
  "owner" : { },
  "creator" : {
    "id" : 9124,
    "name" : "test_user",
    "username" : "c369c68f1ff84679b5a8ed904d8bff1c",
    "state" : "active",
    "service_license_status" : null,
    "name_cn" : "test_user",
    "nick_name" : "beta_dv",
    "tenant_name" : "test_tenant"
  },
  "creator_id" : 9124,
  "statistics" : { },
  "branch_count" : 2,
  "tag_count" : 0,
  "member_count" : 8,
  "import_status" : "none",
  "import_url" : "https://gitee.com/api-review-test-group/return-test.git",
  "import_error" : null,
  "repo_type" : "normal",
  "only_allow_merge_if_pipeline_succeeds" : false,
  "only_allow_merge_if_all_discussions_are_resolved" : false,
  "merge_method" : "merge",
  "fork_network_repositories" : [ ],
  "permissions" : {
    "repository_access" : {
      "access_level" : 50,
      "notification_level" : 3
    },
    "group_access" : {
      "access_level" : 50,
      "notification_level" : 3
    }
  },
  "repository_type" : null,
  "uuid" : "b166cca9cf9442a0b82159769d6aec4c",
  "ancestor_ids" : [ 2111851014, 2111853523, 2111853524, 2111853525, 2111853526 ],
  "ancestor_names" : [ "g111", "g22", "g3", "g4", "g5" ]
}
```
#### SDK代码示例
SDK代码示例如下。
#### Java
```
package com.huaweicloud.sdk.test;
import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.codeartsrepo.v4.region.CodeArtsRepoRegion;
import com.huaweicloud.sdk.codeartsrepo.v4.*;
import com.huaweicloud.sdk.codeartsrepo.v4.model.*;
public class ShowRepositorySolution {
    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        ICredential auth = new BasicCredentials()
                .withAk(ak)
                .withSk(sk);
        CodeArtsRepoClient client = CodeArtsRepoClient.newBuilder()
                .withCredential(auth)
                .withRegion(CodeArtsRepoRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowRepositoryRequest request = new ShowRepositoryRequest();
        request.withRepositoryId({repository_id});
        try {
            ShowRepositoryResponse response = client.showRepository(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
```
#### Python
```
# coding: utf-8
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcodeartsrepo.v4.region.codeartsrepo_region import CodeArtsRepoRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcodeartsrepo.v4 import *
if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    credentials = BasicCredentials(ak, sk)
    client = CodeArtsRepoClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(CodeArtsRepoRegion.value_of("<YOUR REGION>")) \
        .build()
    try:
        request = ShowRepositoryRequest()
        request.repository_id = {repository_id}
        response = client.show_repository(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
```
#### Go
```
package main
import (
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    codeartsrepo "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsrepo/v4"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsrepo/v4/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsrepo/v4/region"
)
func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    auth, err := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        SafeBuild()
    if err != nil {
        fmt.Println(err)
        return
    }
    hcClient, err := codeartsrepo.CodeArtsRepoClientBuilder().
         WithRegion(region.ValueOf("<YOUR REGION>")).
         WithCredential(auth).
         SafeBuild()
    if err != nil {
        fmt.Println(err)
        return
    }
    client := codeartsrepo.NewCodeArtsRepoClient(hcClient)
    request := &model.ShowRepositoryRequest{}
request.RepositoryId = int32({repository_id})
response, err := client.ShowRepository(request)
if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}
```
#### 更多
更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/CodeArtsRepo/sdk?api=ShowRepository&version=v4)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述     |
|:---|:---|
| 200 | 获取仓库详情 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-codeartsrepo/ErrorCode.html)。
