Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
fix: deprecate handwritten code (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neenu1995 committed Apr 20, 2021
1 parent e6c973e commit 5eac339
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
*
* @see <a
* href="https://cloud.google.com/resource-manager/reference/rest/v1/ListAvailableOrgPolicyConstraintsResponse#Constraint">Constraint</a>
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public class ConstraintInfo {

static final Function<Constraint, ConstraintInfo> FROM_PROTOBUF_FUNCTION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
import java.io.Serializable;
import java.util.Objects;

/** Base class for Resource Manager operation options. */
/**
* Base class for Resource Manager operation options.
*
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
abstract class Option implements Serializable {

private static final long serialVersionUID = 2655177550880762967L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
*
* <p>Defines a Cloud Organization Policy which specifies constraints for configurations of Cloud
* Platform resources.
*
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public class OrgPolicyInfo {

static final Function<OrgPolicy, OrgPolicyInfo> FROM_PROTOBUF_FUNCTION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.util.Map;
import java.util.Set;

/** @deprecated v3 GAPIC client of ResourceManager is now available */
@Deprecated
final class PolicyMarshaller
extends Marshaller<com.google.api.services.cloudresourcemanager.model.Policy> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
* AppEngine Apps, VMs, and other Google Cloud Platform resources. This class' member variables are
* immutable. Methods that change or update the underlying Project information return a new Project
* instance. {@code Project} adds a layer of service-related functionality over {@link ProjectInfo}.
*
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public class Project extends ProjectInfo {

private static final long serialVersionUID = 6767630161335155133L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
* A Google Cloud Resource Manager project metadata object. A Project is a high-level Google Cloud
* Platform entity. It is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud
* Platform resources.
*
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public class ProjectInfo implements Serializable {

public static final DateTimeFormatter DATE_TIME_FORMATTER =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,25 @@
import com.google.cloud.Policy;
import com.google.cloud.Service;
import com.google.cloud.resourcemanager.spi.v1beta1.ResourceManagerRpc;
import com.google.cloud.resourcemanager.v3.GetProjectRequest;
import com.google.cloud.resourcemanager.v3.ListProjectsRequest;
import com.google.cloud.resourcemanager.v3.ProjectName;
import com.google.cloud.resourcemanager.v3.ProjectsSettings;
import com.google.cloud.resourcemanager.v3.UndeleteProjectRequest;
import com.google.cloud.resourcemanager.v3.UpdateProjectRequest;
import com.google.common.collect.ImmutableList;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import java.util.List;
import java.util.Map;

/**
* An interface for Google Cloud Resource Manager.
*
* @see <a href="https://cloud.google.com/resource-manager/">Google Cloud Resource Manager</a>
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public interface ResourceManager extends Service<ResourceManagerOptions> {

String DEFAULT_CONTENT_TYPE = "application/octet-stream";
Expand Down Expand Up @@ -176,7 +186,10 @@ public static ProjectListOption fields(ProjectField... fields) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/create">Cloud
* Resource Manager create</a>
* @deprecated Please use {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#create(ProjectsSettings)} instead
*/
@Deprecated
Project create(ProjectInfo project);

/**
Expand All @@ -202,7 +215,10 @@ public static ProjectListOption fields(ProjectField... fields) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/delete">Cloud
* Resource Manager delete</a>
* @deprecated Please use {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#deleteProjectAsync(ProjectName)} instead
*/
@Deprecated
void delete(String projectId);

/**
Expand All @@ -214,7 +230,10 @@ public static ProjectListOption fields(ProjectField... fields) {
* @throws ResourceManagerException upon failure
* @see <a href="https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/get">
* Cloud Resource Manager get</a>
* @deprecated Please use {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#getProject(GetProjectRequest)} instead
*/
@Deprecated
Project get(String projectId, ProjectGetOption... options);

/**
Expand All @@ -229,7 +248,11 @@ public static ProjectListOption fields(ProjectField... fields) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/list">Cloud
* Resource Manager list</a>
* @deprecated Please use {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#listProjects(ListProjectsRequest)}
* instead
*/
@Deprecated
Page<Project> list(ProjectListOption... options);

/**
Expand All @@ -242,7 +265,11 @@ public static ProjectListOption fields(ProjectField... fields) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/update">Cloud
* Resource Manager update</a>
* @deprecated Please use {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#updateProjectAsync(UpdateProjectRequest)}
* instead
*/
@Deprecated
Project replace(ProjectInfo newProject);

/**
Expand All @@ -257,7 +284,11 @@ public static ProjectListOption fields(ProjectField... fields) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/undelete">Cloud
* Resource Manager undelete</a>
* @deprecated Please use {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#undeleteProjectAsync(UndeleteProjectRequest)}
* instead
*/
@Deprecated
void undelete(String projectId);

/**
Expand All @@ -269,7 +300,11 @@ public static ProjectListOption fields(ProjectField... fields) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/getIamPolicy">
* Resource Manager getIamPolicy</a>
* @deprecated Please use {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#getIamPolicy(GetIamPolicyRequest)}
* instead
*/
@Deprecated
Policy getPolicy(String projectId);

/**
Expand Down Expand Up @@ -316,7 +351,9 @@ public static ProjectListOption fields(ProjectField... fields) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/setIamPolicy">
* Resource Manager setIamPolicy</a>
* @deprecated
*/
@Deprecated
Policy replacePolicy(String projectId, Policy newPolicy);

/**
Expand All @@ -336,7 +373,10 @@ public static ProjectListOption fields(ProjectField... fields) {
* Resource Manager testIamPermissions</a>
* @see <a href= "https://cloud.google.com/iam/#supported_cloud_platform_services">Supported Cloud
* Platform Services</a>
* @deprecated {@link
* com.google.cloud.resourcemanager.v3.ProjectsClient#testIamPermissions(TestIamPermissionsRequest)}
*/
@Deprecated
List<Boolean> testPermissions(String projectId, List<String> permissions);

/** Class for specifying project list options. */
Expand Down Expand Up @@ -379,7 +419,9 @@ public static ListOption pageSize(int pageSize) {
* @see <a href=
* "https://cloud.google.com/resource-manager/reference/rest/v1/organizations/testIamPermissions">
* Resource Manager testIamPermissions</a>
* @deprecated
*/
@Deprecated
Map<String, Boolean> testOrgPermissions(String resource, List<String> permissions);

/**
Expand All @@ -403,7 +445,9 @@ public static ListOption pageSize(int pageSize) {
* @see <a
* href="https://cloud.google.com/resource-manager/reference/rest/v1/folders/getEffectiveOrgPolicy">Resource
* Manager getEffectiveOrgPolicy</a>
* @deprecated
*/
@Deprecated
OrgPolicyInfo getEffectiveOrgPolicy(String resource, String constraint);

/**
Expand All @@ -427,7 +471,9 @@ public static ListOption pageSize(int pageSize) {
* @see <a
* href="https://cloud.google.com/resource-manager/reference/rest/v1/folders/listAvailableOrgPolicyConstraints">Resource
* Manager listAvailableOrgPolicyConstraints</a>
* @deprecated
*/
@Deprecated
Page<ConstraintInfo> listAvailableOrgPolicyConstraints(String resource, ListOption... options);

/**
Expand All @@ -437,7 +483,9 @@ public static ListOption pageSize(int pageSize) {
* @see <a
* href="https://cloud.google.com/resource-manager/reference/rest/v1/folders/listOrgPolicies">Resource
* Manager listOrgPolicies</a>
* @deprecated
*/
@Deprecated
Page<OrgPolicyInfo> listOrgPolicies(String resource, ListOption... options);

/**
Expand All @@ -450,6 +498,8 @@ public static ListOption pageSize(int pageSize) {
* @see <a
* href="https://cloud.google.com/resource-manager/reference/rest/v1/folders/setOrgPolicy">Resource
* Manager setOrgPolicy</a>
* @deprecated
*/
@Deprecated
OrgPolicyInfo replaceOrgPolicy(String resource, OrgPolicyInfo orgPolicy);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
*
* @see <a href="https://cloud.google.com/resource-manager/v1/errors/core_errors">Google Cloud
* Resource Manager error codes</a>
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public final class ResourceManagerException extends BaseHttpServiceException {

// see https://cloud.google.com/resource-manager/v1/errors/core_errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

import com.google.cloud.ServiceFactory;

/** An interface for ResourceManager factories. */
/**
* An interface for ResourceManager factories.
*
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public interface ResourceManagerFactory
extends ServiceFactory<ResourceManager, ResourceManagerOptions> {}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import java.util.Map;
import java.util.concurrent.Callable;

/** @deprecated v3 GAPIC client of ResourceManager is now available */
@Deprecated
final class ResourceManagerImpl extends BaseService<ResourceManagerOptions>
implements ResourceManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.google.common.collect.ImmutableSet;
import java.util.Set;

/** @deprecated v3 GAPIC client of ResourceManager is now available */
@Deprecated
public class ResourceManagerOptions
extends ServiceOptions<ResourceManager, ResourceManagerOptions> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
/**
* An interface for Resource Manager RPC factory. Implementation will be loaded via {@link
* java.util.ServiceLoader}.
*
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
public interface ResourceManagerRpcFactory extends ServiceRpcFactory<ResourceManagerOptions> {}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
import java.util.concurrent.Callable;
import org.threeten.bp.Duration;

/** @deprecated v3 GAPIC client of ResourceManager is now available */
@Deprecated
public class HttpResourceManagerRpc implements ResourceManagerRpc {

private static final JsonFactory JSON_FACTORY = new JacksonFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import java.util.List;
import java.util.Map;

/** @deprecated v3 GAPIC client of ResourceManager is now available */
@Deprecated
public interface ResourceManagerRpc extends ServiceRpc {

enum Option {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@
* <li>The messages in the error responses given by this mock do not necessarily match the
* messages given by the actual service.
* </ul>
*
* @deprecated v3 GAPIC client of ResourceManager is now available
*/
@Deprecated
@SuppressWarnings("restriction")
public class LocalResourceManagerHelper {
private static final Logger log = Logger.getLogger(LocalResourceManagerHelper.class.getName());
Expand Down

0 comments on commit 5eac339

Please sign in to comment.