Skip to content

Commit

Permalink
[ggj][codegen] fix: use lowerCamelCase param names in ServiceClient J…
Browse files Browse the repository at this point in the history
…avaDocs (#590)

* fix: fix dep ordering in Bazel dedupe rules

* fix: use lowerCamelCase param names in ServiceClient JavaDocs
  • Loading branch information
miraleung authored Dec 7, 2020
1 parent 98bb43d commit ab20de9
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.api.generator.gapic.model.Method;
import com.google.api.generator.gapic.model.MethodArgument;
import com.google.api.generator.gapic.model.Service;
import com.google.api.generator.gapic.utils.JavaStyle;
import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -181,7 +182,7 @@ static List<CommentStatement> createRpcMethodHeaderComment(
// TODO(miraleung): Remove the newline replacement when we support CommonMark.
String description =
argument.field().hasDescription() ? argument.field().description() : EMPTY_STRING;
methodJavadocBuilder.addParam(argument.name(), description);
methodJavadocBuilder.addParam(JavaStyle.toLowerCamelCase(argument.name()), description);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public class EchoClient implements BackgroundResource {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* @param end_time
* @param endTime
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<WaitResponse, WaitMetadata> waitAsync(Timestamp endTime) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public class IdentityClient implements BackgroundResource {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* @param parent
* @param display_name
* @param displayName
* @param email
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand All @@ -142,12 +142,12 @@ public class IdentityClient implements BackgroundResource {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* @param parent
* @param display_name
* @param displayName
* @param email
* @param age
* @param nickname
* @param enable_notifications
* @param height_feet
* @param enableNotifications
* @param heightFeet
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final User createUser(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/goldens/asset/AssetServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public final UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
* "us-west1" region or the "global" location.
* </ul>
*
* @param asset_types Optional. A list of asset types that this request searches for. If empty, it
* @param assetTypes Optional. A list of asset types that this request searches for. If empty, it
* will search all the [searchable asset
* types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
Expand Down
16 changes: 8 additions & 8 deletions test/integration/goldens/library/LibraryServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public final UnaryCallable<DeleteShelfRequest, Empty> deleteShelfCallable() {
* shelves are the same.
*
* @param name The name of the shelf we're adding books to.
* @param other_shelf_name The name of the shelf we're removing books from and deleting.
* @param otherShelfName The name of the shelf we're removing books from and deleting.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Shelf mergeShelves(ShelfName name, ShelfName otherShelfName) {
Expand All @@ -358,7 +358,7 @@ public final Shelf mergeShelves(ShelfName name, ShelfName otherShelfName) {
* shelves are the same.
*
* @param name The name of the shelf we're adding books to.
* @param other_shelf_name The name of the shelf we're removing books from and deleting.
* @param otherShelfName The name of the shelf we're removing books from and deleting.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Shelf mergeShelves(ShelfName name, String otherShelfName) {
Expand All @@ -380,7 +380,7 @@ public final Shelf mergeShelves(ShelfName name, String otherShelfName) {
* shelves are the same.
*
* @param name The name of the shelf we're adding books to.
* @param other_shelf_name The name of the shelf we're removing books from and deleting.
* @param otherShelfName The name of the shelf we're removing books from and deleting.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Shelf mergeShelves(String name, ShelfName otherShelfName) {
Expand All @@ -402,7 +402,7 @@ public final Shelf mergeShelves(String name, ShelfName otherShelfName) {
* shelves are the same.
*
* @param name The name of the shelf we're adding books to.
* @param other_shelf_name The name of the shelf we're removing books from and deleting.
* @param otherShelfName The name of the shelf we're removing books from and deleting.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Shelf mergeShelves(String name, String otherShelfName) {
Expand Down Expand Up @@ -668,7 +668,7 @@ public final UnaryCallable<UpdateBookRequest, Book> updateBookCallable() {
* the same as the original book.
*
* @param name The name of the book to move.
* @param other_shelf_name The name of the destination shelf.
* @param otherShelfName The name of the destination shelf.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Book moveBook(BookName name, ShelfName otherShelfName) {
Expand All @@ -686,7 +686,7 @@ public final Book moveBook(BookName name, ShelfName otherShelfName) {
* the same as the original book.
*
* @param name The name of the book to move.
* @param other_shelf_name The name of the destination shelf.
* @param otherShelfName The name of the destination shelf.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Book moveBook(BookName name, String otherShelfName) {
Expand All @@ -704,7 +704,7 @@ public final Book moveBook(BookName name, String otherShelfName) {
* the same as the original book.
*
* @param name The name of the book to move.
* @param other_shelf_name The name of the destination shelf.
* @param otherShelfName The name of the destination shelf.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Book moveBook(String name, ShelfName otherShelfName) {
Expand All @@ -722,7 +722,7 @@ public final Book moveBook(String name, ShelfName otherShelfName) {
* the same as the original book.
*
* @param name The name of the book to move.
* @param other_shelf_name The name of the destination shelf.
* @param otherShelfName The name of the destination shelf.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Book moveBook(String name, String otherShelfName) {
Expand Down
36 changes: 18 additions & 18 deletions test/integration/goldens/logging/ConfigClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public final UnaryCallable<ListSinksRequest, ListSinksResponse> listSinksCallabl
/**
* Gets a sink.
*
* @param sink_name Required. The resource name of the sink:
* @param sinkName Required. The resource name of the sink:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
Expand All @@ -495,7 +495,7 @@ public final LogSink getSink(LogSinkName sinkName) {
/**
* Gets a sink.
*
* @param sink_name Required. The resource name of the sink:
* @param sinkName Required. The resource name of the sink:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
Expand Down Expand Up @@ -681,7 +681,7 @@ public final UnaryCallable<CreateSinkRequest, LogSink> createSinkCallable() {
* <p>The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
* field.
*
* @param sink_name Required. The full resource name of the sink to update, including the parent
* @param sinkName Required. The full resource name of the sink to update, including the parent
* resource and the sink identifier:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
Expand Down Expand Up @@ -709,7 +709,7 @@ public final LogSink updateSink(LogSinkName sinkName, LogSink sink) {
* <p>The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
* field.
*
* @param sink_name Required. The full resource name of the sink to update, including the parent
* @param sinkName Required. The full resource name of the sink to update, including the parent
* resource and the sink identifier:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
Expand All @@ -734,7 +734,7 @@ public final LogSink updateSink(String sinkName, LogSink sink) {
* <p>The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
* field.
*
* @param sink_name Required. The full resource name of the sink to update, including the parent
* @param sinkName Required. The full resource name of the sink to update, including the parent
* resource and the sink identifier:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
Expand All @@ -743,9 +743,9 @@ public final LogSink updateSink(String sinkName, LogSink sink) {
* <p>Example: `"projects/my-project-id/sinks/my-sink-id"`.
* @param sink Required. The updated sink, whose name is the same identifier that appears as part
* of `sink_name`.
* @param update_mask Optional. Field mask that specifies the fields in `sink` that need an
* update. A sink field will be overwritten if, and only if, it is in the update mask. `name`
* and output only fields cannot be updated.
* @param updateMask Optional. Field mask that specifies the fields in `sink` that need an update.
* A sink field will be overwritten if, and only if, it is in the update mask. `name` and
* output only fields cannot be updated.
* <p>An empty updateMask is temporarily treated as using the following mask for backwards
* compatibility purposes: destination,filter,includeChildren At some point in the future,
* behavior will be removed and specifying an empty updateMask will be an error.
Expand All @@ -772,7 +772,7 @@ public final LogSink updateSink(LogSinkName sinkName, LogSink sink, FieldMask up
* <p>The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
* field.
*
* @param sink_name Required. The full resource name of the sink to update, including the parent
* @param sinkName Required. The full resource name of the sink to update, including the parent
* resource and the sink identifier:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
Expand All @@ -781,9 +781,9 @@ public final LogSink updateSink(LogSinkName sinkName, LogSink sink, FieldMask up
* <p>Example: `"projects/my-project-id/sinks/my-sink-id"`.
* @param sink Required. The updated sink, whose name is the same identifier that appears as part
* of `sink_name`.
* @param update_mask Optional. Field mask that specifies the fields in `sink` that need an
* update. A sink field will be overwritten if, and only if, it is in the update mask. `name`
* and output only fields cannot be updated.
* @param updateMask Optional. Field mask that specifies the fields in `sink` that need an update.
* A sink field will be overwritten if, and only if, it is in the update mask. `name` and
* output only fields cannot be updated.
* <p>An empty updateMask is temporarily treated as using the following mask for backwards
* compatibility purposes: destination,filter,includeChildren At some point in the future,
* behavior will be removed and specifying an empty updateMask will be an error.
Expand Down Expand Up @@ -836,7 +836,7 @@ public final UnaryCallable<UpdateSinkRequest, LogSink> updateSinkCallable() {
* Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
* deleted.
*
* @param sink_name Required. The full resource name of the sink to delete, including the parent
* @param sinkName Required. The full resource name of the sink to delete, including the parent
* resource and the sink identifier:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
Expand All @@ -858,7 +858,7 @@ public final void deleteSink(LogSinkName sinkName) {
* Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
* deleted.
*
* @param sink_name Required. The full resource name of the sink to delete, including the parent
* @param sinkName Required. The full resource name of the sink to delete, including the parent
* resource and the sink identifier:
* <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
Expand Down Expand Up @@ -1208,8 +1208,8 @@ public final UnaryCallable<CreateExclusionRequest, LogExclusion> createExclusion
* <p>Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
* @param exclusion Required. New values for the existing exclusion. Only the fields specified in
* `update_mask` are relevant.
* @param update_mask Required. A non-empty list of fields to change in the existing exclusion.
* New values for the fields are taken from the corresponding fields in the
* @param updateMask Required. A non-empty list of fields to change in the existing exclusion. New
* values for the fields are taken from the corresponding fields in the
* [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not
* mentioned in `update_mask` are not changed and are ignored in the request.
* <p>For example, to change the filter and description of an exclusion, specify an
Expand Down Expand Up @@ -1239,8 +1239,8 @@ public final LogExclusion updateExclusion(
* <p>Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
* @param exclusion Required. New values for the existing exclusion. Only the fields specified in
* `update_mask` are relevant.
* @param update_mask Required. A non-empty list of fields to change in the existing exclusion.
* New values for the fields are taken from the corresponding fields in the
* @param updateMask Required. A non-empty list of fields to change in the existing exclusion. New
* values for the fields are taken from the corresponding fields in the
* [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not
* mentioned in `update_mask` are not changed and are ignored in the request.
* <p>For example, to change the filter and description of an exclusion, specify an
Expand Down
22 changes: 11 additions & 11 deletions test/integration/goldens/logging/LoggingClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public LoggingServiceV2Stub getStub() {
* written shortly before the delete operation might not be deleted. Entries received after the
* delete operation with a timestamp before the operation will be deleted.
*
* @param log_name Required. The resource name of the log to delete:
* @param logName Required. The resource name of the log to delete:
* <p>"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]"
* <p>`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`,
Expand All @@ -185,7 +185,7 @@ public final void deleteLog(LogName logName) {
* written shortly before the delete operation might not be deleted. Entries received after the
* delete operation with a timestamp before the operation will be deleted.
*
* @param log_name Required. The resource name of the log to delete:
* @param logName Required. The resource name of the log to delete:
* <p>"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]"
* <p>`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`,
Expand Down Expand Up @@ -230,7 +230,7 @@ public final UnaryCallable<DeleteLogRequest, Empty> deleteLogCallable() {
* libraries configured to use Logging. A single request may contain log entries for a maximum of
* 1000 different resources (projects, organizations, billing accounts or folders)
*
* @param log_name Optional. A default log resource name that is assigned to all log entries in
* @param logName Optional. A default log resource name that is assigned to all log entries in
* `entries` that do not specify a value for `log_name`:
* <p>"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]"
Expand Down Expand Up @@ -292,7 +292,7 @@ public final WriteLogEntriesResponse writeLogEntries(
* libraries configured to use Logging. A single request may contain log entries for a maximum of
* 1000 different resources (projects, organizations, billing accounts or folders)
*
* @param log_name Optional. A default log resource name that is assigned to all log entries in
* @param logName Optional. A default log resource name that is assigned to all log entries in
* `entries` that do not specify a value for `log_name`:
* <p>"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]"
Expand Down Expand Up @@ -381,8 +381,8 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ
* project/folder/organization/billing account. For ways to export log entries, see [Exporting
* Logs](https://cloud.google.com/logging/docs/export).
*
* @param resource_names Required. Names of one or more parent resources from which to retrieve
* log entries:
* @param resourceNames Required. Names of one or more parent resources from which to retrieve log
* entries:
* <p>"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
* <p>Projects listed in the `project_ids` field are added to this list.
Expand All @@ -392,11 +392,11 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ
* 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.
* @param order_by 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.
* @param orderBy 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListLogEntriesPagedResponse listLogEntries(
Expand Down
Loading

0 comments on commit ab20de9

Please sign in to comment.