|
38 | 38 | import com.google.cloudbuild.v2.CreateRepositoryRequest;
|
39 | 39 | import com.google.cloudbuild.v2.DeleteConnectionRequest;
|
40 | 40 | import com.google.cloudbuild.v2.DeleteRepositoryRequest;
|
| 41 | +import com.google.cloudbuild.v2.FetchGitRefsRequest; |
| 42 | +import com.google.cloudbuild.v2.FetchGitRefsResponse; |
41 | 43 | import com.google.cloudbuild.v2.FetchLinkableRepositoriesRequest;
|
42 | 44 | import com.google.cloudbuild.v2.FetchLinkableRepositoriesResponse;
|
43 | 45 | import com.google.cloudbuild.v2.FetchReadTokenRequest;
|
|
71 | 73 |
|
72 | 74 | // AUTO-GENERATED DOCUMENTATION AND CLASS.
|
73 | 75 | /**
|
74 |
| - * Service Description: Manages connections to source code repostiories. |
| 76 | + * Service Description: Manages connections to source code repositories. |
75 | 77 | *
|
76 | 78 | * <p>This class provides the ability to make remote calls to the backing service through method
|
77 | 79 | * calls that map to API methods. Sample code to get started:
|
@@ -2102,6 +2104,126 @@ public final FetchLinkableRepositoriesPagedResponse fetchLinkableRepositories(
|
2102 | 2104 | return stub.fetchLinkableRepositoriesCallable();
|
2103 | 2105 | }
|
2104 | 2106 |
|
| 2107 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 2108 | + /** |
| 2109 | + * Fetch the list of branches or tags for a given repository. |
| 2110 | + * |
| 2111 | + * <p>Sample code: |
| 2112 | + * |
| 2113 | + * <pre>{@code |
| 2114 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 2115 | + * // It will require modifications to work: |
| 2116 | + * // - It may require correct/in-range values for request initialization. |
| 2117 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 2118 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 2119 | + * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { |
| 2120 | + * RepositoryName repository = |
| 2121 | + * RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); |
| 2122 | + * FetchGitRefsResponse response = repositoryManagerClient.fetchGitRefs(repository); |
| 2123 | + * } |
| 2124 | + * }</pre> |
| 2125 | + * |
| 2126 | + * @param repository Required. The resource name of the repository in the format |
| 2127 | + * `projects/*/locations/*/connections/*/repositories/*`. |
| 2128 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 2129 | + */ |
| 2130 | + public final FetchGitRefsResponse fetchGitRefs(RepositoryName repository) { |
| 2131 | + FetchGitRefsRequest request = |
| 2132 | + FetchGitRefsRequest.newBuilder() |
| 2133 | + .setRepository(repository == null ? null : repository.toString()) |
| 2134 | + .build(); |
| 2135 | + return fetchGitRefs(request); |
| 2136 | + } |
| 2137 | + |
| 2138 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 2139 | + /** |
| 2140 | + * Fetch the list of branches or tags for a given repository. |
| 2141 | + * |
| 2142 | + * <p>Sample code: |
| 2143 | + * |
| 2144 | + * <pre>{@code |
| 2145 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 2146 | + * // It will require modifications to work: |
| 2147 | + * // - It may require correct/in-range values for request initialization. |
| 2148 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 2149 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 2150 | + * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { |
| 2151 | + * String repository = |
| 2152 | + * RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString(); |
| 2153 | + * FetchGitRefsResponse response = repositoryManagerClient.fetchGitRefs(repository); |
| 2154 | + * } |
| 2155 | + * }</pre> |
| 2156 | + * |
| 2157 | + * @param repository Required. The resource name of the repository in the format |
| 2158 | + * `projects/*/locations/*/connections/*/repositories/*`. |
| 2159 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 2160 | + */ |
| 2161 | + public final FetchGitRefsResponse fetchGitRefs(String repository) { |
| 2162 | + FetchGitRefsRequest request = |
| 2163 | + FetchGitRefsRequest.newBuilder().setRepository(repository).build(); |
| 2164 | + return fetchGitRefs(request); |
| 2165 | + } |
| 2166 | + |
| 2167 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 2168 | + /** |
| 2169 | + * Fetch the list of branches or tags for a given repository. |
| 2170 | + * |
| 2171 | + * <p>Sample code: |
| 2172 | + * |
| 2173 | + * <pre>{@code |
| 2174 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 2175 | + * // It will require modifications to work: |
| 2176 | + * // - It may require correct/in-range values for request initialization. |
| 2177 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 2178 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 2179 | + * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { |
| 2180 | + * FetchGitRefsRequest request = |
| 2181 | + * FetchGitRefsRequest.newBuilder() |
| 2182 | + * .setRepository( |
| 2183 | + * RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") |
| 2184 | + * .toString()) |
| 2185 | + * .build(); |
| 2186 | + * FetchGitRefsResponse response = repositoryManagerClient.fetchGitRefs(request); |
| 2187 | + * } |
| 2188 | + * }</pre> |
| 2189 | + * |
| 2190 | + * @param request The request object containing all of the parameters for the API call. |
| 2191 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 2192 | + */ |
| 2193 | + public final FetchGitRefsResponse fetchGitRefs(FetchGitRefsRequest request) { |
| 2194 | + return fetchGitRefsCallable().call(request); |
| 2195 | + } |
| 2196 | + |
| 2197 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 2198 | + /** |
| 2199 | + * Fetch the list of branches or tags for a given repository. |
| 2200 | + * |
| 2201 | + * <p>Sample code: |
| 2202 | + * |
| 2203 | + * <pre>{@code |
| 2204 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 2205 | + * // It will require modifications to work: |
| 2206 | + * // - It may require correct/in-range values for request initialization. |
| 2207 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 2208 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 2209 | + * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { |
| 2210 | + * FetchGitRefsRequest request = |
| 2211 | + * FetchGitRefsRequest.newBuilder() |
| 2212 | + * .setRepository( |
| 2213 | + * RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") |
| 2214 | + * .toString()) |
| 2215 | + * .build(); |
| 2216 | + * ApiFuture<FetchGitRefsResponse> future = |
| 2217 | + * repositoryManagerClient.fetchGitRefsCallable().futureCall(request); |
| 2218 | + * // Do something. |
| 2219 | + * FetchGitRefsResponse response = future.get(); |
| 2220 | + * } |
| 2221 | + * }</pre> |
| 2222 | + */ |
| 2223 | + public final UnaryCallable<FetchGitRefsRequest, FetchGitRefsResponse> fetchGitRefsCallable() { |
| 2224 | + return stub.fetchGitRefsCallable(); |
| 2225 | + } |
| 2226 | + |
2105 | 2227 | // AUTO-GENERATED DOCUMENTATION AND METHOD.
|
2106 | 2228 | /**
|
2107 | 2229 | * Sets the access control policy on the specified resource. Replacesany existing policy.
|
|
0 commit comments