Skip to content

Commit

Permalink
Merge pull request #4 from UweTrottmann/update-protos
Browse files Browse the repository at this point in the history
Update protos
  • Loading branch information
UweTrottmann authored Aug 30, 2023
2 parents c348083 + 823b594 commit 86e0cbd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 349 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@
public class ServiceControl extends com.google.api.client.googleapis.services.AbstractGoogleClient {
private static final ObjectParser parser = new ProtoObjectParser();

// Note: Leave this static initializer at the top of the file.
static {
com.google.api.client.util.Preconditions.checkState(
com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
"You are currently running with version %s of google-api-client. " +
"You need at least version 1.15 of google-api-client to run version " +
"1.22.0-SNAPSHOT of the Google Service Control API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
}

/**
* The default encoded root URL of the service. This is determined when the library is generated
* and normally should not be changed.
Expand Down
7 changes: 0 additions & 7 deletions endpoints-control/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
* limitations under the License.
*/

buildscript {
repositories {
mavenCentral()
}
dependencies { classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10' }
}

plugins {
id("ut-publish")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ public enum QuotaErrorInfo {
Code.RESOURCE_EXHAUSTED,
429,
"Quota allocation failed."),
PROJECT_SUSPENDED(
Code.PROJECT_SUSPENDED,
HttpServletResponse.SC_FORBIDDEN,
"Project suspended."),
SERVICE_NOT_ENABLED(
Code.SERVICE_NOT_ENABLED,
HttpServletResponse.SC_FORBIDDEN,
"API {service_name} is not available for the project."),
BILLING_NOT_ACTIVE(
Code.BILLING_NOT_ACTIVE,
HttpServletResponse.SC_FORBIDDEN,
Expand All @@ -56,22 +48,6 @@ public enum QuotaErrorInfo {
Code.PROJECT_DELETED,
HttpServletResponse.SC_BAD_REQUEST,
"Client project not valid. Please pass a valid project."),
PROJECT_INVALID(
Code.PROJECT_INVALID,
HttpServletResponse.SC_BAD_REQUEST,
"Client project not valid. Please pass a valid project."),
IP_ADDRESS_BLOCKED(
Code.IP_ADDRESS_BLOCKED,
HttpServletResponse.SC_FORBIDDEN,
"IP address blocked."),
REFERER_BLOCKED(
Code.REFERER_BLOCKED,
HttpServletResponse.SC_FORBIDDEN,
"Referer blocked."),
CLIENT_APP_BLOCKED(
Code.CLIENT_APP_BLOCKED,
HttpServletResponse.SC_FORBIDDEN,
"Client app blocked."),
API_KEY_INVALID(
Code.API_KEY_INVALID,
HttpServletResponse.SC_BAD_REQUEST,
Expand All @@ -80,22 +56,6 @@ public enum QuotaErrorInfo {
Code.API_KEY_EXPIRED,
HttpServletResponse.SC_BAD_REQUEST,
"API key expired. Please renew the API key."),
PROJECT_STATUS_UNAVAILABLE(
Code.PROJECT_STATUS_UNAVAILABLE,
HttpServletResponse.SC_OK,
""),
SERVICE_STATUS_UNAVAILABLE(
Code.SERVICE_STATUS_UNAVAILABLE,
HttpServletResponse.SC_OK,
""),
BILLING_STATUS_UNAVAILABLE(
Code.BILLING_STATUS_UNAVAILABLE,
HttpServletResponse.SC_OK,
""),
QUOTA_SYSTEM_UNAVAILABLE(
Code.QUOTA_SYSTEM_UNAVAILABLE,
HttpServletResponse.SC_OK,
""),
UNKNOWN(
Code.UNRECOGNIZED,
HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
Expand Down Expand Up @@ -169,7 +129,7 @@ public boolean isReallyError() {
*/
public static QuotaErrorInfo convert(@Nullable AllocateQuotaResponse response) {
if (response == null) {
return SERVICE_STATUS_UNAVAILABLE;
return UNKNOWN;
}
if (response.getAllocateErrorsCount() == 0) {
return OK;
Expand Down
20 changes: 7 additions & 13 deletions endpoints-management-protos/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
buildscript {
repositories {
mavenCentral()
}
dependencies { classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10' }
}

plugins {
id("ut-publish")
id("com.google.protobuf") version "0.9.4"
}

apply plugin: 'com.google.protobuf'

version = "1.0.15-SNAPSHOT"

// Set project-specific publishing properties
Expand Down Expand Up @@ -68,10 +60,12 @@ sourceSets {
srcDir 'build/generated/source/proto/main/java'
}
proto {
srcDir 'src/auxi/proto'
setIncludes([
"google/api/servicecontrol/v1/*.proto",
"google/api/distribution.proto",
"google/api/client.proto",
"google/api/launch_stage.proto"
])
}
}
}
sourceSets.main.proto.setIncludes([
'google/api/servicecontrol/v1/*.proto',
'google/api/experimental/*.proto'])
Loading

0 comments on commit 86e0cbd

Please sign in to comment.