Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Remove ResourceNameType for api-common:1.6.0 compat #36

Merged
merged 1 commit into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions plugin/templates/resource_name.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.api.pathtemplate.PathTemplate;
import {{resourceNameGlobalPackageName}}.ResourceName;
import {{resourceNameGlobalPackageName}}.ResourceNameType;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -121,14 +120,6 @@ public class {{className}} {{extensionKeyword}} {{parentInterface}} {
return getFieldValuesMap().get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("{{className}}.getType() not supported");
}

@Override
public String toString() {
return PATH_TEMPLATE.instantiate({{#parameterList}}"{{parameter_name}}", {{parameter}}{{#not_last}}, {{/not_last}}{{/parameterList}});
Expand Down
18 changes: 0 additions & 18 deletions plugin/templates/resource_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@
from plugin.utils import casing_utils

RESOURCE_NAMES_GLOBAL_PACKAGE_JAVA = 'com.google.api.resourcenames'
RESOURCE_NAMES_TYPE_PACKAGE_JAVA = 'com.google.api.resourcenames.types'


class ResourceNameBase(object):

def resourceNameTypePackageName(self):
return RESOURCE_NAMES_TYPE_PACKAGE_JAVA

def resourceNameGlobalPackageName(self):
return RESOURCE_NAMES_GLOBAL_PACKAGE_JAVA

Expand Down Expand Up @@ -249,20 +245,6 @@ def package(self):
return self.untyped_package_name


class ResourceNameType(ResourceNameBase):

def __init__(self, class_name, java_package):
self.type_name_upper = casing_utils.get_resource_type_from_class_name(
class_name)
self.package_name = java_package

def className(self):
return self.type_name_upper

def package(self):
return self.package_name


class ResourceNameFixed(ResourceNameBase):

def __init__(self, fixed_config, java_package, oneof):
Expand Down
9 changes: 0 additions & 9 deletions plugin/templates/resource_name_fixed.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package {{package}};

import {{resourceNameGlobalPackageName}}.ResourceName;
import {{resourceNameGlobalPackageName}}.ResourceNameType;
import com.google.common.collect.ImmutableMap;
import java.util.Map;

Expand Down Expand Up @@ -52,14 +51,6 @@ public class {{className}} {{extensionKeyword}} {{parentInterface}} {
return valueMap.get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("{{className}}.getType() not supported");
}

@Override
public String toString() {
return FIXED_VALUE;
Expand Down
9 changes: 0 additions & 9 deletions plugin/templates/untyped_resource_name.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package {{package}};

import com.google.common.base.Preconditions;
import {{resourceNameGlobalPackageName}}.ResourceName;
import {{resourceNameGlobalPackageName}}.ResourceNameType;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -80,14 +79,6 @@ public class {{className}} {{extensionKeyword}} {{parentInterface}} {
return valueMap.get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("{{className}}.getType() not supported");
}

@Override
public String toString() {
return rawValue;
Expand Down
9 changes: 0 additions & 9 deletions test/testdata/java_archived_book_name.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.api.pathtemplate.PathTemplate;
import com.google.api.resourcenames.ResourceName;
import com.google.api.resourcenames.ResourceNameType;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -122,14 +121,6 @@ public class ArchivedBookName extends BookName {
return getFieldValuesMap().get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("ArchivedBookName.getType() not supported");
}

@Override
public String toString() {
return PATH_TEMPLATE.instantiate("archive_id", archiveId, "book_id", bookId);
Expand Down
9 changes: 0 additions & 9 deletions test/testdata/java_deleted_book.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package com.google.example.library.v1;

import com.google.api.resourcenames.ResourceName;
import com.google.api.resourcenames.ResourceNameType;
import com.google.common.collect.ImmutableMap;
import java.util.Map;

Expand Down Expand Up @@ -52,14 +51,6 @@ public class DeletedBook implements ResourceName {
return valueMap.get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("DeletedBook.getType() not supported");
}

@Override
public String toString() {
return FIXED_VALUE;
Expand Down
9 changes: 0 additions & 9 deletions test/testdata/java_shelf_book_name.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.api.pathtemplate.PathTemplate;
import com.google.api.resourcenames.ResourceName;
import com.google.api.resourcenames.ResourceNameType;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -122,14 +121,6 @@ public class ShelfBookName extends BookName {
return getFieldValuesMap().get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("ShelfBookName.getType() not supported");
}

@Override
public String toString() {
return PATH_TEMPLATE.instantiate("shelf_id", shelfId, "book_id", bookId);
Expand Down
9 changes: 0 additions & 9 deletions test/testdata/java_shelf_name.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.api.pathtemplate.PathTemplate;
import com.google.api.resourcenames.ResourceName;
import com.google.api.resourcenames.ResourceNameType;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -113,14 +112,6 @@ public class ShelfName implements ResourceName {
return getFieldValuesMap().get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("ShelfName.getType() not supported");
}

@Override
public String toString() {
return PATH_TEMPLATE.instantiate("shelf_id", shelfId);
Expand Down
9 changes: 0 additions & 9 deletions test/testdata/java_untyped_book_name.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package com.google.example.library.v1;

import com.google.common.base.Preconditions;
import com.google.api.resourcenames.ResourceName;
import com.google.api.resourcenames.ResourceNameType;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -80,14 +79,6 @@ public class UntypedBookName extends BookName {
return valueMap.get(fieldName);
}

/**
* @deprecated This method is only present to satisfy the ResourceName interface.
*/
@Deprecated
public ResourceNameType getType() {
throw new UnsupportedOperationException("UntypedBookName.getType() not supported");
}

@Override
public String toString() {
return rawValue;
Expand Down