Skip to content
Permalink
Browse files
fix: deprecate handwritten code (#458)
  • Loading branch information
Neenu1995 committed Apr 20, 2021
1 parent e6c973e commit 5eac339395251aa62222eb6c6fcaa967e7c53b4a
Showing with 91 additions and 2 deletions.
  1. +2 −0 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ConstraintInfo.java
  2. +6 −1 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/Option.java
  3. +3 −0 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/OrgPolicyInfo.java
  4. +2 −0 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/PolicyMarshaller.java
  5. +3 −0 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/Project.java
  6. +3 −0 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ProjectInfo.java
  7. +50 −0 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java
  8. +2 −0 ...loud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java
  9. +6 −1 ...-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerFactory.java
  10. +2 −0 google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java
  11. +2 −0 ...-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java
  12. +3 −0 ...resourcemanager/src/main/java/com/google/cloud/resourcemanager/spi/ResourceManagerRpcFactory.java
  13. +2 −0 ...rcemanager/src/main/java/com/google/cloud/resourcemanager/spi/v1beta1/HttpResourceManagerRpc.java
  14. +2 −0 ...esourcemanager/src/main/java/com/google/cloud/resourcemanager/spi/v1beta1/ResourceManagerRpc.java
  15. +3 −0 ...rcemanager/src/main/java/com/google/cloud/resourcemanager/testing/LocalResourceManagerHelper.java
@@ -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 =
@@ -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;
@@ -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 =
@@ -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> {

@@ -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;
@@ -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 =
@@ -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";
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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. */
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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);

/**
@@ -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);
}
@@ -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
@@ -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> {}
@@ -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 {

@@ -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> {

@@ -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> {}
@@ -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();
@@ -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 {
@@ -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());

0 comments on commit 5eac339

Please sign in to comment.