diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java index d50c54f4..a0ef4181 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java @@ -1141,6 +1141,33 @@ public interface HttpCheckOrBuilder // @@protoc_insertion_point(interface_extends:google.monitoring.v3.UptimeCheckConfig.HttpCheck) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+     * The HTTP request method to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @return The enum numeric value on the wire for requestMethod. + */ + int getRequestMethodValue(); + /** + * + * + *
+     * The HTTP request method to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @return The requestMethod. + */ + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod getRequestMethod(); + /** * * @@ -1352,6 +1379,31 @@ public interface HttpCheckOrBuilder */ java.lang.String getHeadersOrThrow(java.lang.String key); + /** + * + * + *
+     * The content type to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * @return The enum numeric value on the wire for contentType. + */ + int getContentTypeValue(); + /** + * + * + *
+     * The content type to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * @return The contentType. + */ + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType getContentType(); + /** * * @@ -1367,6 +1419,23 @@ public interface HttpCheckOrBuilder * @return The validateSsl. */ boolean getValidateSsl(); + + /** + * + * + *
+     * The request body associated with the HTTP request. If `content_type` is
+     * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
+     * a `Content-Length` header via the `headers` field or the API will do
+     * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
+     * JSON representations are base64 encoded.
+     * 
+ * + * bytes body = 10; + * + * @return The body. + */ + com.google.protobuf.ByteString getBody(); } /** * @@ -1388,7 +1457,10 @@ private HttpCheck(com.google.protobuf.GeneratedMessageV3.Builder builder) { } private HttpCheck() { + requestMethod_ = 0; path_ = ""; + contentType_ = 0; + body_ = com.google.protobuf.ByteString.EMPTY; } @java.lang.Override @@ -1482,6 +1554,25 @@ private HttpCheck( validateSsl_ = input.readBool(); break; } + case 64: + { + int rawValue = input.readEnum(); + + requestMethod_ = rawValue; + break; + } + case 72: + { + int rawValue = input.readEnum(); + + contentType_ = rawValue; + break; + } + case 82: + { + body_ = input.readBytes(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -1515,16 +1606,312 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { default: throw new RuntimeException("Invalid map field number: " + number); } - } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.UptimeProto + .internal_static_google_monitoring_v3_UptimeCheckConfig_HttpCheck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.class, + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.Builder.class); + } + + /** + * + * + *
+     * The HTTP request method options.
+     * 
+ * + * Protobuf enum {@code google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod} + */ + public enum RequestMethod implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * No request method specified.
+       * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + METHOD_UNSPECIFIED(0), + /** + * + * + *
+       * GET request.
+       * 
+ * + * GET = 1; + */ + GET(1), + /** + * + * + *
+       * POST request.
+       * 
+ * + * POST = 2; + */ + POST(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * No request method specified.
+       * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + public static final int METHOD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * GET request.
+       * 
+ * + * GET = 1; + */ + public static final int GET_VALUE = 1; + /** + * + * + *
+       * POST request.
+       * 
+ * + * POST = 2; + */ + public static final int POST_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RequestMethod valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RequestMethod forNumber(int value) { + switch (value) { + case 0: + return METHOD_UNSPECIFIED; + case 1: + return GET; + case 2: + return POST; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RequestMethod findValueByNumber(int number) { + return RequestMethod.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RequestMethod[] VALUES = values(); + + public static RequestMethod valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RequestMethod(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod) + } + + /** + * + * + *
+     * Header options corresponding to the Content-Type of the body in HTTP
+     * requests. Note that a `Content-Type` header cannot be present in the
+     * `headers` field if this field is specified.
+     * 
+ * + * Protobuf enum {@code google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType} + */ + public enum ContentType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * No content type specified. If the request method is POST, an
+       * unspecified content type results in a check creation rejection.
+       * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * `body` is in URL-encoded form. Equivalent to setting the `Content-Type`
+       * to `application/x-www-form-urlencoded` in the HTTP request.
+       * 
+ * + * URL_ENCODED = 1; + */ + URL_ENCODED(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * No content type specified. If the request method is POST, an
+       * unspecified content type results in a check creation rejection.
+       * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * `body` is in URL-encoded form. Equivalent to setting the `Content-Type`
+       * to `application/x-www-form-urlencoded` in the HTTP request.
+       * 
+ * + * URL_ENCODED = 1; + */ + public static final int URL_ENCODED_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ContentType forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return URL_ENCODED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContentType findValueByNumber(int number) { + return ContentType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final ContentType[] VALUES = values(); + + public static ContentType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContentType(int value) { + this.value = value; + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.UptimeProto - .internal_static_google_monitoring_v3_UptimeCheckConfig_HttpCheck_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.class, - com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.Builder.class); + // @@protoc_insertion_point(enum_scope:google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType) } public interface BasicAuthenticationOrBuilder @@ -2413,6 +2800,45 @@ public com.google.protobuf.Parser getParserForType() { } } + public static final int REQUEST_METHOD_FIELD_NUMBER = 8; + private int requestMethod_; + /** + * + * + *
+     * The HTTP request method to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @return The enum numeric value on the wire for requestMethod. + */ + public int getRequestMethodValue() { + return requestMethod_; + } + /** + * + * + *
+     * The HTTP request method to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @return The requestMethod. + */ + public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod getRequestMethod() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod result = + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod.valueOf( + requestMethod_); + return result == null + ? com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod.UNRECOGNIZED + : result; + } + public static final int USE_SSL_FIELD_NUMBER = 1; private boolean useSsl_; /** @@ -2702,6 +3128,42 @@ public java.lang.String getHeadersOrThrow(java.lang.String key) { return map.get(key); } + public static final int CONTENT_TYPE_FIELD_NUMBER = 9; + private int contentType_; + /** + * + * + *
+     * The content type to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * @return The enum numeric value on the wire for contentType. + */ + public int getContentTypeValue() { + return contentType_; + } + /** + * + * + *
+     * The content type to use for the check.
+     * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * @return The contentType. + */ + public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType getContentType() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType result = + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType.valueOf(contentType_); + return result == null + ? com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType.UNRECOGNIZED + : result; + } + public static final int VALIDATE_SSL_FIELD_NUMBER = 7; private boolean validateSsl_; /** @@ -2722,6 +3184,27 @@ public boolean getValidateSsl() { return validateSsl_; } + public static final int BODY_FIELD_NUMBER = 10; + private com.google.protobuf.ByteString body_; + /** + * + * + *
+     * The request body associated with the HTTP request. If `content_type` is
+     * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
+     * a `Content-Length` header via the `headers` field or the API will do
+     * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
+     * JSON representations are base64 encoded.
+     * 
+ * + * bytes body = 10; + * + * @return The body. + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2756,6 +3239,19 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (validateSsl_ != false) { output.writeBool(7, validateSsl_); } + if (requestMethod_ + != com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod.METHOD_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, requestMethod_); + } + if (contentType_ + != com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, contentType_); + } + if (!body_.isEmpty()) { + output.writeBytes(10, body_); + } unknownFields.writeTo(output); } @@ -2793,6 +3289,19 @@ public int getSerializedSize() { if (validateSsl_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, validateSsl_); } + if (requestMethod_ + != com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod.METHOD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, requestMethod_); + } + if (contentType_ + != com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, contentType_); + } + if (!body_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(10, body_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -2809,6 +3318,7 @@ public boolean equals(final java.lang.Object obj) { com.google.monitoring.v3.UptimeCheckConfig.HttpCheck other = (com.google.monitoring.v3.UptimeCheckConfig.HttpCheck) obj; + if (requestMethod_ != other.requestMethod_) return false; if (getUseSsl() != other.getUseSsl()) return false; if (!getPath().equals(other.getPath())) return false; if (getPort() != other.getPort()) return false; @@ -2818,7 +3328,9 @@ public boolean equals(final java.lang.Object obj) { } if (getMaskHeaders() != other.getMaskHeaders()) return false; if (!internalGetHeaders().equals(other.internalGetHeaders())) return false; + if (contentType_ != other.contentType_) return false; if (getValidateSsl() != other.getValidateSsl()) return false; + if (!getBody().equals(other.getBody())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -2830,6 +3342,8 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQUEST_METHOD_FIELD_NUMBER; + hash = (53 * hash) + requestMethod_; hash = (37 * hash) + USE_SSL_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseSsl()); hash = (37 * hash) + PATH_FIELD_NUMBER; @@ -2846,8 +3360,12 @@ public int hashCode() { hash = (37 * hash) + HEADERS_FIELD_NUMBER; hash = (53 * hash) + internalGetHeaders().hashCode(); } + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + contentType_; hash = (37 * hash) + VALIDATE_SSL_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateSsl()); + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -3016,6 +3534,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + requestMethod_ = 0; + useSsl_ = false; path_ = ""; @@ -3031,8 +3551,12 @@ public Builder clear() { maskHeaders_ = false; internalGetMutableHeaders().clear(); + contentType_ = 0; + validateSsl_ = false; + body_ = com.google.protobuf.ByteString.EMPTY; + return this; } @@ -3061,6 +3585,7 @@ public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck buildPartial() { com.google.monitoring.v3.UptimeCheckConfig.HttpCheck result = new com.google.monitoring.v3.UptimeCheckConfig.HttpCheck(this); int from_bitField0_ = bitField0_; + result.requestMethod_ = requestMethod_; result.useSsl_ = useSsl_; result.path_ = path_; result.port_ = port_; @@ -3072,7 +3597,9 @@ public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck buildPartial() { result.maskHeaders_ = maskHeaders_; result.headers_ = internalGetHeaders(); result.headers_.makeImmutable(); + result.contentType_ = contentType_; result.validateSsl_ = validateSsl_; + result.body_ = body_; onBuilt(); return result; } @@ -3125,6 +3652,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.monitoring.v3.UptimeCheckConfig.HttpCheck other) { if (other == com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.getDefaultInstance()) return this; + if (other.requestMethod_ != 0) { + setRequestMethodValue(other.getRequestMethodValue()); + } if (other.getUseSsl() != false) { setUseSsl(other.getUseSsl()); } @@ -3142,9 +3672,15 @@ public Builder mergeFrom(com.google.monitoring.v3.UptimeCheckConfig.HttpCheck ot setMaskHeaders(other.getMaskHeaders()); } internalGetMutableHeaders().mergeFrom(other.internalGetHeaders()); + if (other.contentType_ != 0) { + setContentTypeValue(other.getContentTypeValue()); + } if (other.getValidateSsl() != false) { setValidateSsl(other.getValidateSsl()); } + if (other.getBody() != com.google.protobuf.ByteString.EMPTY) { + setBody(other.getBody()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -3177,6 +3713,103 @@ public Builder mergeFrom( private int bitField0_; + private int requestMethod_ = 0; + /** + * + * + *
+       * The HTTP request method to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @return The enum numeric value on the wire for requestMethod. + */ + public int getRequestMethodValue() { + return requestMethod_; + } + /** + * + * + *
+       * The HTTP request method to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @param value The enum numeric value on the wire for requestMethod to set. + * @return This builder for chaining. + */ + public Builder setRequestMethodValue(int value) { + requestMethod_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The HTTP request method to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @return The requestMethod. + */ + public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod getRequestMethod() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod result = + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod.valueOf( + requestMethod_); + return result == null + ? com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The HTTP request method to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @param value The requestMethod to set. + * @return This builder for chaining. + */ + public Builder setRequestMethod( + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod value) { + if (value == null) { + throw new NullPointerException(); + } + + requestMethod_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The HTTP request method to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * + * + * @return This builder for chaining. + */ + public Builder clearRequestMethod() { + + requestMethod_ = 0; + onChanged(); + return this; + } + private boolean useSsl_; /** * @@ -3897,6 +4530,102 @@ public Builder putAllHeaders(java.util.Map v return this; } + private int contentType_ = 0; + /** + * + * + *
+       * The content type to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * + * @return The enum numeric value on the wire for contentType. + */ + public int getContentTypeValue() { + return contentType_; + } + /** + * + * + *
+       * The content type to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * + * @param value The enum numeric value on the wire for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeValue(int value) { + contentType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The content type to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * + * @return The contentType. + */ + public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType getContentType() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType result = + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType.valueOf(contentType_); + return result == null + ? com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The content type to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType( + com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The content type to use for the check.
+       * 
+ * + * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * + * + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = 0; + onChanged(); + return this; + } + private boolean validateSsl_; /** * @@ -3957,6 +4686,72 @@ public Builder clearValidateSsl() { return this; } + private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+       * The request body associated with the HTTP request. If `content_type` is
+       * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
+       * a `Content-Length` header via the `headers` field or the API will do
+       * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
+       * JSON representations are base64 encoded.
+       * 
+ * + * bytes body = 10; + * + * @return The body. + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + /** + * + * + *
+       * The request body associated with the HTTP request. If `content_type` is
+       * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
+       * a `Content-Length` header via the `headers` field or the API will do
+       * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
+       * JSON representations are base64 encoded.
+       * 
+ * + * bytes body = 10; + * + * @param value The body to set. + * @return This builder for chaining. + */ + public Builder setBody(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + body_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The request body associated with the HTTP request. If `content_type` is
+       * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
+       * a `Content-Length` header via the `headers` field or the API will do
+       * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
+       * JSON representations are base64 encoded.
+       * 
+ * + * bytes body = 10; + * + * @return This builder for chaining. + */ + public Builder clearBody() { + + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeProto.java index 1509ea58..e8ca93da 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeProto.java @@ -81,7 +81,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\t\022\027\n\017peer_project_id\030\006 \001(\t\022:\n\005state\030\007" + " \001(\0162+.google.monitoring.v3.InternalChec" + "ker.State\"3\n\005State\022\017\n\013UNSPECIFIED\020\000\022\014\n\010C" - + "REATING\020\001\022\013\n\007RUNNING\020\002:\002\030\001\"\315\r\n\021UptimeChe" + + "REATING\020\001\022\013\n\007RUNNING\020\002:\002\030\001\"\373\017\n\021UptimeChe" + "ckConfig\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002" + " \001(\t\022;\n\022monitored_resource\030\003 \001(\0132\035.googl" + "e.api.MonitoredResourceH\000\022O\n\016resource_gr" @@ -101,44 +101,51 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "3.InternalCheckerB\002\030\001\032a\n\rResourceGroup\022\020" + "\n\010group_id\030\001 \001(\t\022>\n\rresource_type\030\002 \001(\0162" + "\'.google.monitoring.v3.GroupResourceType" - + "\032\372\002\n\tHttpCheck\022\017\n\007use_ssl\030\001 \001(\010\022\014\n\004path\030" - + "\002 \001(\t\022\014\n\004port\030\003 \001(\005\022X\n\tauth_info\030\004 \001(\0132E" + + "\032\250\005\n\tHttpCheck\022W\n\016request_method\030\010 \001(\0162?" + ".google.monitoring.v3.UptimeCheckConfig." - + "HttpCheck.BasicAuthentication\022\024\n\014mask_he" - + "aders\030\005 \001(\010\022O\n\007headers\030\006 \003(\0132>.google.mo" - + "nitoring.v3.UptimeCheckConfig.HttpCheck." - + "HeadersEntry\022\024\n\014validate_ssl\030\007 \001(\010\0329\n\023Ba" - + "sicAuthentication\022\020\n\010username\030\001 \001(\t\022\020\n\010p" - + "assword\030\002 \001(\t\032.\n\014HeadersEntry\022\013\n\003key\030\001 \001" - + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032\030\n\010TcpCheck\022\014\n\004por" - + "t\030\001 \001(\005\032\230\002\n\016ContentMatcher\022\017\n\007content\030\001 " - + "\001(\t\022\\\n\007matcher\030\002 \001(\0162K.google.monitoring" - + ".v3.UptimeCheckConfig.ContentMatcher.Con" - + "tentMatcherOption\"\226\001\n\024ContentMatcherOpti" - + "on\022&\n\"CONTENT_MATCHER_OPTION_UNSPECIFIED" - + "\020\000\022\023\n\017CONTAINS_STRING\020\001\022\027\n\023NOT_CONTAINS_" - + "STRING\020\002\022\021\n\rMATCHES_REGEX\020\003\022\025\n\021NOT_MATCH" - + "ES_REGEX\020\004:\363\001\352A\357\001\n+monitoring.googleapis" - + ".com/UptimeCheckConfig\022;projects/{projec" - + "t}/uptimeCheckConfigs/{uptime_check_conf" - + "ig}\022Eorganizations/{organization}/uptime" - + "CheckConfigs/{uptime_check_config}\0229fold" - + "ers/{folder}/uptimeCheckConfigs/{uptime_" - + "check_config}\022\001*B\n\n\010resourceB\024\n\022check_re" - + "quest_type\"n\n\rUptimeCheckIp\0227\n\006region\030\001 " - + "\001(\0162\'.google.monitoring.v3.UptimeCheckRe" - + "gion\022\020\n\010location\030\002 \001(\t\022\022\n\nip_address\030\003 \001" - + "(\t*e\n\021UptimeCheckRegion\022\026\n\022REGION_UNSPEC" - + "IFIED\020\000\022\007\n\003USA\020\001\022\n\n\006EUROPE\020\002\022\021\n\rSOUTH_AM" - + "ERICA\020\003\022\020\n\014ASIA_PACIFIC\020\004*[\n\021GroupResour" - + "ceType\022\035\n\031RESOURCE_TYPE_UNSPECIFIED\020\000\022\014\n" - + "\010INSTANCE\020\001\022\031\n\025AWS_ELB_LOAD_BALANCER\020\002B\303" - + "\001\n\030com.google.monitoring.v3B\013UptimeProto" - + "P\001Z>google.golang.org/genproto/googleapi" - + "s/monitoring/v3;monitoring\252\002\032Google.Clou" - + "d.Monitoring.V3\312\002\032Google\\Cloud\\Monitorin" - + "g\\V3\352\002\035Google::Cloud::Monitoring::V3b\006pr" - + "oto3" + + "HttpCheck.RequestMethod\022\017\n\007use_ssl\030\001 \001(\010" + + "\022\014\n\004path\030\002 \001(\t\022\014\n\004port\030\003 \001(\005\022X\n\tauth_inf" + + "o\030\004 \001(\0132E.google.monitoring.v3.UptimeChe" + + "ckConfig.HttpCheck.BasicAuthentication\022\024" + + "\n\014mask_headers\030\005 \001(\010\022O\n\007headers\030\006 \003(\0132>." + + "google.monitoring.v3.UptimeCheckConfig.H" + + "ttpCheck.HeadersEntry\022S\n\014content_type\030\t " + + "\001(\0162=.google.monitoring.v3.UptimeCheckCo" + + "nfig.HttpCheck.ContentType\022\024\n\014validate_s" + + "sl\030\007 \001(\010\022\014\n\004body\030\n \001(\014\0329\n\023BasicAuthentic" + + "ation\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(" + + "\t\032.\n\014HeadersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001\":\n\rRequestMethod\022\026\n\022METHOD_UNS" + + "PECIFIED\020\000\022\007\n\003GET\020\001\022\010\n\004POST\020\002\"4\n\013Content" + + "Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\017\n\013URL_ENCODE" + + "D\020\001\032\030\n\010TcpCheck\022\014\n\004port\030\001 \001(\005\032\230\002\n\016Conten" + + "tMatcher\022\017\n\007content\030\001 \001(\t\022\\\n\007matcher\030\002 \001" + + "(\0162K.google.monitoring.v3.UptimeCheckCon" + + "fig.ContentMatcher.ContentMatcherOption\"" + + "\226\001\n\024ContentMatcherOption\022&\n\"CONTENT_MATC" + + "HER_OPTION_UNSPECIFIED\020\000\022\023\n\017CONTAINS_STR" + + "ING\020\001\022\027\n\023NOT_CONTAINS_STRING\020\002\022\021\n\rMATCHE" + + "S_REGEX\020\003\022\025\n\021NOT_MATCHES_REGEX\020\004:\363\001\352A\357\001\n" + + "+monitoring.googleapis.com/UptimeCheckCo" + + "nfig\022;projects/{project}/uptimeCheckConf" + + "igs/{uptime_check_config}\022Eorganizations" + + "/{organization}/uptimeCheckConfigs/{upti" + + "me_check_config}\0229folders/{folder}/uptim" + + "eCheckConfigs/{uptime_check_config}\022\001*B\n" + + "\n\010resourceB\024\n\022check_request_type\"n\n\rUpti" + + "meCheckIp\0227\n\006region\030\001 \001(\0162\'.google.monit" + + "oring.v3.UptimeCheckRegion\022\020\n\010location\030\002" + + " \001(\t\022\022\n\nip_address\030\003 \001(\t*e\n\021UptimeCheckR" + + "egion\022\026\n\022REGION_UNSPECIFIED\020\000\022\007\n\003USA\020\001\022\n" + + "\n\006EUROPE\020\002\022\021\n\rSOUTH_AMERICA\020\003\022\020\n\014ASIA_PA" + + "CIFIC\020\004*[\n\021GroupResourceType\022\035\n\031RESOURCE" + + "_TYPE_UNSPECIFIED\020\000\022\014\n\010INSTANCE\020\001\022\031\n\025AWS" + + "_ELB_LOAD_BALANCER\020\002B\303\001\n\030com.google.moni" + + "toring.v3B\013UptimeProtoP\001Z>google.golang." + + "org/genproto/googleapis/monitoring/v3;mo" + + "nitoring\252\002\032Google.Cloud.Monitoring.V3\312\002\032" + + "Google\\Cloud\\Monitoring\\V3\352\002\035Google::Clo" + + "ud::Monitoring::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -191,7 +198,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_UptimeCheckConfig_HttpCheck_descriptor, new java.lang.String[] { - "UseSsl", "Path", "Port", "AuthInfo", "MaskHeaders", "Headers", "ValidateSsl", + "RequestMethod", + "UseSsl", + "Path", + "Port", + "AuthInfo", + "MaskHeaders", + "Headers", + "ContentType", + "ValidateSsl", + "Body", }); internal_static_google_monitoring_v3_UptimeCheckConfig_HttpCheck_BasicAuthentication_descriptor = internal_static_google_monitoring_v3_UptimeCheckConfig_HttpCheck_descriptor diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto index 6ef4e0dd..54a9b11e 100644 --- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto +++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto @@ -28,27 +28,6 @@ option java_package = "com.google.monitoring.v3"; option php_namespace = "Google\\Cloud\\Monitoring\\V3"; option ruby_package = "Google::Cloud::Monitoring::V3"; -// The regions from which an Uptime check can be run. -enum UptimeCheckRegion { - // Default value if no region is specified. Will result in Uptime checks - // running from all regions. - REGION_UNSPECIFIED = 0; - - // Allows checks to run from locations within the United States of America. - USA = 1; - - // Allows checks to run from locations within the continent of Europe. - EUROPE = 2; - - // Allows checks to run from locations within the continent of South - // America. - SOUTH_AMERICA = 3; - - // Allows checks to run from locations within the Asia Pacific area (ex: - // Singapore). - ASIA_PACIFIC = 4; -} - // An internal checker allows Uptime checks to run on private/internal GCP // resources. message InternalChecker { @@ -105,6 +84,27 @@ message InternalChecker { State state = 7; } +// The regions from which an Uptime check can be run. +enum UptimeCheckRegion { + // Default value if no region is specified. Will result in Uptime checks + // running from all regions. + REGION_UNSPECIFIED = 0; + + // Allows checks to run from locations within the United States of America. + USA = 1; + + // Allows checks to run from locations within the continent of Europe. + EUROPE = 2; + + // Allows checks to run from locations within the continent of South + // America. + SOUTH_AMERICA = 3; + + // Allows checks to run from locations within the Asia Pacific area (ex: + // Singapore). + ASIA_PACIFIC = 4; +} + // This message configures which resources and services to monitor for // availability. message UptimeCheckConfig { @@ -142,6 +142,34 @@ message UptimeCheckConfig { string password = 2; } + // The HTTP request method options. + enum RequestMethod { + // No request method specified. + METHOD_UNSPECIFIED = 0; + + // GET request. + GET = 1; + + // POST request. + POST = 2; + } + + // Header options corresponding to the Content-Type of the body in HTTP + // requests. Note that a `Content-Type` header cannot be present in the + // `headers` field if this field is specified. + enum ContentType { + // No content type specified. If the request method is POST, an + // unspecified content type results in a check creation rejection. + TYPE_UNSPECIFIED = 0; + + // `body` is in URL-encoded form. Equivalent to setting the `Content-Type` + // to `application/x-www-form-urlencoded` in the HTTP request. + URL_ENCODED = 1; + } + + // The HTTP request method to use for the check. + RequestMethod request_method = 8; + // If `true`, use HTTPS instead of HTTP to run the check. bool use_ssl = 1; @@ -180,11 +208,21 @@ message UptimeCheckConfig { // The maximum number of headers allowed is 100. map headers = 6; + // The content type to use for the check. + ContentType content_type = 9; + // Boolean specifying whether to include SSL certificate validation as a // part of the Uptime check. Only applies to checks where // `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, // setting `validate_ssl` to `true` has no effect. bool validate_ssl = 7; + + // The request body associated with the HTTP request. If `content_type` is + // `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide + // a `Content-Length` header via the `headers` field or the API will do + // so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields + // JSON representations are base64 encoded. + bytes body = 10; } // Information required for a TCP Uptime check request. @@ -314,23 +352,6 @@ message UptimeCheckConfig { repeated InternalChecker internal_checkers = 14 [deprecated = true]; } -// The supported resource types that can be used as values of -// `group_resource.resource_type`. -// `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types. -// The resource types `gae_app` and `uptime_url` are not valid here because -// group checks on App Engine modules and URLs are not allowed. -enum GroupResourceType { - // Default value (not valid). - RESOURCE_TYPE_UNSPECIFIED = 0; - - // A group of instances from Google Cloud Platform (GCP) or - // Amazon Web Services (AWS). - INSTANCE = 1; - - // A group of Amazon ELB load balancers. - AWS_ELB_LOAD_BALANCER = 2; -} - // Contains the region, location, and list of IP // addresses where checkers in the location run from. message UptimeCheckIp { @@ -349,3 +370,20 @@ message UptimeCheckIp { // interpreting this field in either IPv4 or IPv6 format. string ip_address = 3; } + +// The supported resource types that can be used as values of +// `group_resource.resource_type`. +// `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types. +// The resource types `gae_app` and `uptime_url` are not valid here because +// group checks on App Engine modules and URLs are not allowed. +enum GroupResourceType { + // Default value (not valid). + RESOURCE_TYPE_UNSPECIFIED = 0; + + // A group of instances from Google Cloud Platform (GCP) or + // Amazon Web Services (AWS). + INSTANCE = 1; + + // A group of Amazon ELB load balancers. + AWS_ELB_LOAD_BALANCER = 2; +} diff --git a/synth.metadata b/synth.metadata index 5dbc5f6f..d4454129 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-monitoring.git", - "sha": "63c3f2ca64c8697c77c12e7078651202e015cd6b" + "sha": "3f3320ebad71636d3c82da41a23a526e1a5b6399" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "160e3187dc93265ed635ad68e12c483c8ab4f7be", - "internalRef": "306560315" + "sha": "101d31acd73076c52d78e18322be01f3debe8cb5", + "internalRef": "306855444" } }, {