@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Documentation)) { return super.equals(obj); } com.google.monitoring.v3.AlertPolicy.Documentation other = (com.google.monitoring.v3.AlertPolicy.Documentation) obj; boolean result = true; result = result && getContent().equals(other.getContent()); result = result && getMimeType().equals(other.getMimeType()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getContentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); } if (!getMimeTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * * * <pre> * Documentation that is included with notifications and incidents related to * this policy. Best practice is for the documentation to include information * to help responders understand, mitigate, escalate, and correct the * underlying problems detected by the alerting policy. Notification channels * that have limited capacity might not show this documentation. * </pre> * * <code>.google.monitoring.v3.AlertPolicy.Documentation documentation = 13;</code> */ public com.google.monitoring.v3.AlertPolicy.Documentation getDocumentation() { if (documentationBuilder_ == null) { return documentation_ == null ? com.google.monitoring.v3.AlertPolicy.Documentation.getDefaultInstance() : documentation_; } else { return documentationBuilder_.getMessage(); } } /**
private static void listAlertPolicies(String projectId) throws IOException { try (AlertPolicyServiceClient client = AlertPolicyServiceClient.create()) { ListAlertPoliciesPagedResponse response = client.listAlertPolicies(ProjectName.of(projectId)); System.out.println("Alert Policies:"); for (AlertPolicy policy : response.iterateAll()) { System.out.println( String.format("\nPolicy %s\nalert-id: %s", policy.getDisplayName(), policy.getName())); int channels = policy.getNotificationChannelsCount(); if (channels > 0) { System.out.println("notification-channels:"); for (int i = 0; i < channels; i++) { System.out.println("\t" + policy.getNotificationChannels(i)); } } if (policy.hasDocumentation() && policy.getDocumentation().getContent() != null) { System.out.println(policy.getDocumentation().getContent()); } } } } // [END monitoring_alert_list_policies]
if (hasDocumentation()) { hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; hash = (53 * hash) + getDocumentation().hashCode();
result = result && (hasDocumentation() == other.hasDocumentation()); if (hasDocumentation()) { result = result && getDocumentation().equals(other.getDocumentation());
/** * * * <pre> * Documentation that is included with notifications and incidents related to * this policy. Best practice is for the documentation to include information * to help responders understand, mitigate, escalate, and correct the * underlying problems detected by the alerting policy. Notification channels * that have limited capacity might not show this documentation. * </pre> * * <code>.google.monitoring.v3.AlertPolicy.Documentation documentation = 13;</code> */ public com.google.monitoring.v3.AlertPolicy.DocumentationOrBuilder getDocumentationOrBuilder() { if (documentationBuilder_ != null) { return documentationBuilder_.getMessageOrBuilder(); } else { return documentation_ == null ? com.google.monitoring.v3.AlertPolicy.Documentation.getDefaultInstance() : documentation_; } } /**
/** * * * <pre> * Documentation that is included with notifications and incidents related to * this policy. Best practice is for the documentation to include information * to help responders understand, mitigate, escalate, and correct the * underlying problems detected by the alerting policy. Notification channels * that have limited capacity might not show this documentation. * </pre> * * <code>.google.monitoring.v3.AlertPolicy.Documentation documentation = 13;</code> */ public com.google.monitoring.v3.AlertPolicy.Documentation getDocumentation() { return documentation_ == null ? com.google.monitoring.v3.AlertPolicy.Documentation.getDefaultInstance() : documentation_; } /**
/** * * * <pre> * The format of the `content` field. Presently, only the value * `"text/markdown"` is supported. See * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. * </pre> * * <code>string mime_type = 2;</code> */ public Builder clearMimeType() { mimeType_ = getDefaultInstance().getMimeType(); onChanged(); return this; } /**
/** * * * <pre> * The text of the documentation, interpreted according to `mime_type`. * The content may not exceed 8,192 Unicode characters and may not exceed * more than 10,240 bytes when encoded in UTF-8 format, whichever is * smaller. * </pre> * * <code>string content = 1;</code> */ public Builder clearContent() { content_ = getDefaultInstance().getContent(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Documentation other) { if (other == com.google.monitoring.v3.AlertPolicy.Documentation.getDefaultInstance()) return this; if (!other.getContent().isEmpty()) { content_ = other.content_; onChanged(); } if (!other.getMimeType().isEmpty()) { mimeType_ = other.mimeType_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONTENT_FIELD_NUMBER; hash = (53 * hash) + getContent().hashCode(); hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; hash = (53 * hash) + getMimeType().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public com.google.monitoring.v3.AlertPolicy.Documentation getDefaultInstanceForType() { return com.google.monitoring.v3.AlertPolicy.Documentation.getDefaultInstance(); }
@java.lang.Override public com.google.monitoring.v3.AlertPolicy.Documentation buildPartial() { com.google.monitoring.v3.AlertPolicy.Documentation result = new com.google.monitoring.v3.AlertPolicy.Documentation(this); result.content_ = content_; result.mimeType_ = mimeType_; onBuilt(); return result; }
@java.lang.Override public com.google.monitoring.v3.AlertPolicy.Documentation build() { com.google.monitoring.v3.AlertPolicy.Documentation result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getContentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); } if (!getMimeTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); } unknownFields.writeTo(output); }