@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getProjectIdsCount() > 0) { hash = (37 * hash) + PROJECT_IDS_FIELD_NUMBER; hash = (53 * hash) + getProjectIdsList().hashCode(); } if (getResourceNamesCount() > 0) { hash = (37 * hash) + RESOURCE_NAMES_FIELD_NUMBER; hash = (53 * hash) + getResourceNamesList().hashCode(); } hash = (37 * hash) + FILTER_FIELD_NUMBER; hash = (53 * hash) + getFilter().hashCode(); hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; hash = (53 * hash) + getOrderBy().hashCode(); hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(com.google.logging.v2.ListLogEntriesRequest other) { if (other == com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance()) return this; if (!other.projectIds_.isEmpty()) { if (projectIds_.isEmpty()) { if (!other.getFilter().isEmpty()) { filter_ = other.filter_; onChanged(); if (!other.getOrderBy().isEmpty()) { orderBy_ = other.orderBy_; onChanged(); if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.logging.v2.ListLogEntriesRequest)) { return super.equals(obj); } com.google.logging.v2.ListLogEntriesRequest other = (com.google.logging.v2.ListLogEntriesRequest) obj; boolean result = true; result = result && getProjectIdsList().equals(other.getProjectIdsList()); result = result && getResourceNamesList().equals(other.getResourceNamesList()); result = result && getFilter().equals(other.getFilter()); result = result && getOrderBy().equals(other.getOrderBy()); result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of * `next_page_token` from the previous response. The values of other method * parameters should be identical to those in the previous call. * </pre> * * <code>string page_token = 5;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
dataSize += computeStringSizeNoTag(projectIds_.getRaw(i)); size += 1 * getProjectIdsList().size(); if (!getFilterBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); if (!getOrderByBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); dataSize += computeStringSizeNoTag(resourceNames_.getRaw(i)); size += 1 * getResourceNamesList().size();
ListLogEntriesRequest actualRequest = (ListLogEntriesRequest) actualRequests.get(0); Assert.assertEquals(formattedResourceNames, actualRequest.getResourceNamesList()); Assert.assertEquals(filter, actualRequest.getFilter()); Assert.assertEquals(orderBy, actualRequest.getOrderBy()); Assert.assertTrue( channelProvider.isHeaderSent(
/** * * * <pre> * Optional. How the results should be sorted. Presently, the only permitted * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first * option returns entries in order of increasing values of * `LogEntry.timestamp` (oldest first), and the second option returns entries * in order of decreasing timestamps (newest first). Entries with equal * timestamps are returned in order of their `insert_id` values. * </pre> * * <code>string order_by = 3;</code> */ public Builder clearOrderBy() { orderBy_ = getDefaultInstance().getOrderBy(); onChanged(); return this; } /**
/** * * * <pre> * Optional. A filter that chooses which log entries to return. See [Advanced * Logs Filters](/logging/docs/view/advanced_filters). Only log entries that * match the filter are returned. An empty filter matches all log entries in * the resources listed in `resource_names`. Referencing a parent resource * that is not listed in `resource_names` will cause the filter to return no * results. * The maximum length of the filter is 20000 characters. * </pre> * * <code>string filter = 2;</code> */ public Builder clearFilter() { filter_ = getDefaultInstance().getFilter(); onChanged(); return this; } /**
@Test public void testEntryListOption() { EntryListOption listOption = EntryListOption.pageToken(PAGE_TOKEN); assertEquals(PAGE_TOKEN, listOption.getValue()); assertEquals(ListOption.OptionType.PAGE_TOKEN, listOption.getOptionType()); // page size listOption = EntryListOption.pageSize(PAGE_SIZE); assertEquals(PAGE_SIZE, listOption.getValue()); assertEquals(ListOption.OptionType.PAGE_SIZE, listOption.getOptionType()); // filter listOption = EntryListOption.filter(FILTER); assertEquals(FILTER, listOption.getValue()); assertEquals(EntryListOption.OptionType.FILTER, listOption.getOptionType()); // sort order listOption = EntryListOption.sortOrder(SortingField.TIMESTAMP, SortingOrder.ASCENDING); assertEquals("timestamp asc", listOption.getValue()); assertEquals(EntryListOption.OptionType.ORDER_BY, listOption.getOptionType()); listOption = EntryListOption.sortOrder(SortingField.TIMESTAMP, SortingOrder.DESCENDING); assertEquals("timestamp desc", listOption.getValue()); assertEquals(EntryListOption.OptionType.ORDER_BY, listOption.getOptionType()); ListLogEntriesRequest request = LoggingImpl.listLogEntriesRequest( "some-project-id", LoggingImpl.optionMap( EntryListOption.pageToken(PAGE_TOKEN), EntryListOption.pageSize(PAGE_SIZE))); assertThat(request.getPageToken()).isEqualTo(PAGE_TOKEN); assertThat(request.getPageSize()).isEqualTo(PAGE_SIZE); }
@Override public Integer extractPageSize(ListLogEntriesRequest payload) { return payload.getPageSize(); }
@java.lang.Override public com.google.logging.v2.ListLogEntriesRequest getDefaultInstanceForType() { return com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance(); }
@Override public void listLogEntries( ListLogEntriesRequest request, StreamObserver<ListLogEntriesResponse> responseObserver) { List<LogEntry> entries = new ArrayList<>(); for (ByteString proj : request.getProjectIdsList().asByteStringList()) { String prefix = "projects/" + proj.toStringUtf8() + "/"; for (Map.Entry<String, List<LogEntry>> entry : logs.entrySet()) { if (entry.getKey().startsWith(prefix)) { entries.addAll(entry.getValue()); } } } responseObserver.onNext(ListLogEntriesResponse.newBuilder().addAllEntries(entries).build()); responseObserver.onCompleted(); }
@java.lang.Override public com.google.logging.v2.ListLogEntriesRequest buildPartial() { com.google.logging.v2.ListLogEntriesRequest result = new com.google.logging.v2.ListLogEntriesRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { projectIds_ = projectIds_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); } result.projectIds_ = projectIds_; if (((bitField0_ & 0x00000002) == 0x00000002)) { resourceNames_ = resourceNames_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000002); } result.resourceNames_ = resourceNames_; result.filter_ = filter_; result.orderBy_ = orderBy_; result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@Override public Integer extractPageSize(ListLogEntriesRequest payload) { return payload.getPageSize(); }
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@Override public ListLogEntriesRequest injectPageSize( ListLogEntriesRequest payload, int pageSize) { return ListLogEntriesRequest.newBuilder(payload).setPageSize(pageSize).build(); }
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@Override public ListLogEntriesRequest injectToken(ListLogEntriesRequest payload, String token) { return ListLogEntriesRequest.newBuilder(payload).setPageToken(token).build(); }
List<String> resourceNames, String filter, String orderBy) { ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder() .addAllResourceNames(resourceNames) .setFilter(filter)