GeezerVison is showing github.com — Updated bigquery, cloud-tasks, and compute folders. (#985) · llatif/java-docs-samples@adea168
File treeExpand file treeCollapse file tree Open diff view settings main/java/com/example/bigquery test/java/com/example/bigquery
datatransfer/cloud-client main/java/com/example/bigquerydatatransfer test/java/com/example/bigquerydatatransfer
main/java/com/example/bigquery test/java/com/example/bigquery
main/java/com.example.cloudtasks test/java/com/example/cloudtasks
src/main/java/com/example/compute/errorreporting
main/java/com/example/compute/mailjet test/java/com/example/compute/mailjet
src/main/java/com/example/compute/sendgrid
src/main/java/com/example/compute/signedmetadata
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/README.md +3Lines changed: 3 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | # Getting Started with BigQuery and the Google Java API Client library | 2 | 2 |
| | 3 | +<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=bigquery/cloud-client/README.md"> | | 4 | +<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a> | | 5 | + | 3 | 6 | [Google's BigQuery Service][BigQuery] features a REST-based API that allows | 4 | 7 | developers to create applications to run ad-hoc queries on massive datasets. | 5 | 8 | These sample Java applications demonstrate how to access the BigQuery API using | |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/pom.xml +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 19 | 19 | <artifactId>bigquery-google-cloud-samples</artifactId> | 20 | 20 | <packaging>jar</packaging> | 21 | 21 |
| 22 | | - <!-- Parent defines config for testing & linting. --> | | 22 | + <!-- | | 23 | + The parent pom defines common style checks and testing strategies for our samples. | | 24 | + Removing or replacing it should not affect the execution of the samples in anyway. | | 25 | + --> | 23 | 26 | <parent> | 24 | | - <artifactId>doc-samples</artifactId> | 25 | | - <groupId>com.google.cloud</groupId> | 26 | | - <version>1.0.0</version> | 27 | | - <relativePath>../..</relativePath> | | 27 | + <groupId>com.google.cloud.samples</groupId> | | 28 | + <artifactId>shared-configuration</artifactId> | | 29 | + <version>1.0.8</version> | 28 | 30 | </parent> | 29 | 31 |
| 30 | 32 | <properties> | |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/src/main/java/com/example/bigquery/AuthSnippets.java +14-15Lines changed: 14 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - Copyright 2017, Google, Inc. | 3 | | -
| 4 | | - Licensed under the Apache License, Version 2.0 (the "License"); | 5 | | - you may not use this file except in compliance with the License. | 6 | | - You may obtain a copy of the License at | 7 | | -
| 8 | | - http://www.apache.org/licenses/LICENSE-2.0 | 9 | | -
| 10 | | - Unless required by applicable law or agreed to in writing, software | 11 | | - distributed under the License is distributed on an "AS IS" BASIS, | 12 | | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | | - See the License for the specific language governing permissions and | 14 | | - limitations under the License. | 15 | | -*/ | | 2 | + * Copyright 2017 Google Inc. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | | 5 | + * you may not use this file except in compliance with the License. | | 6 | + * You may obtain a copy of the License at | | 7 | + * | | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | | 9 | + * | | 10 | + * Unless required by applicable law or agreed to in writing, software | | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | | 13 | + * See the License for the specific language governing permissions and | | 14 | + * limitations under the License. | | 15 | + */ | 16 | 16 |
| 17 | 17 | package com.example.bigquery; | 18 | 18 |
| | 21 | 21 | import com.google.cloud.bigquery.BigQuery; | 22 | 22 | import com.google.cloud.bigquery.BigQueryOptions; | 23 | 23 | import com.google.cloud.bigquery.Dataset; | 24 | | - | 25 | 24 | import java.io.File; | 26 | 25 | import java.io.FileInputStream; | 27 | 26 | import java.io.IOException; | |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/src/main/java/com/example/bigquery/QueryParametersSample.java +18-19Lines changed: 18 additions & 19 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - Copyright 2016 Google Inc. | 3 | | -
| 4 | | - Licensed under the Apache License, Version 2.0 (the "License"); | 5 | | - you may not use this file except in compliance with the License. | 6 | | - You may obtain a copy of the License at | 7 | | -
| 8 | | - http://www.apache.org/licenses/LICENSE-2.0 | 9 | | -
| 10 | | - Unless required by applicable law or agreed to in writing, software | 11 | | - distributed under the License is distributed on an "AS IS" BASIS, | 12 | | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | | - See the License for the specific language governing permissions and | 14 | | - limitations under the License. | 15 | | -*/ | | 2 | + * Copyright 2016 Google Inc. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | | 5 | + * you may not use this file except in compliance with the License. | | 6 | + * You may obtain a copy of the License at | | 7 | + * | | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | | 9 | + * | | 10 | + * Unless required by applicable law or agreed to in writing, software | | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | | 13 | + * See the License for the specific language governing permissions and | | 14 | + * limitations under the License. | | 15 | + */ | 16 | 16 |
| 17 | 17 | package com.example.bigquery; | 18 | 18 |
| 19 | 19 | import com.google.cloud.bigquery.BigQuery; | 20 | 20 | import com.google.cloud.bigquery.BigQueryOptions; | 21 | 21 | import com.google.cloud.bigquery.FieldValue; | 22 | | -import com.google.cloud.bigquery.QueryParameterValue; | 23 | 22 | import com.google.cloud.bigquery.QueryJobConfiguration; | | 23 | +import com.google.cloud.bigquery.QueryParameterValue; | 24 | 24 | import com.google.cloud.bigquery.QueryResponse; | 25 | 25 | import com.google.cloud.bigquery.QueryResult; | | 26 | +import java.io.IOException; | | 27 | +import java.util.Arrays; | | 28 | +import java.util.List; | 26 | 29 | import org.joda.time.DateTime; | 27 | 30 | import org.joda.time.DateTimeZone; | 28 | 31 | import org.joda.time.format.DateTimeFormatter; | 29 | 32 | import org.joda.time.format.ISODateTimeFormat; | 30 | 33 |
| 31 | | -import java.io.IOException; | 32 | | -import java.util.Arrays; | 33 | | -import java.util.List; | 34 | | - | 35 | 34 | /** A sample that demonstrates use of query parameters. */ | 36 | 35 | public class QueryParametersSample { | 37 | 36 | private static final int ERROR_CODE = 1; | |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/src/main/java/com/example/bigquery/QuerySample.java +20-20Lines changed: 20 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - Copyright 2016, Google, Inc. | 3 | | -
| 4 | | - Licensed under the Apache License, Version 2.0 (the "License"); | 5 | | - you may not use this file except in compliance with the License. | 6 | | - You may obtain a copy of the License at | 7 | | -
| 8 | | - http://www.apache.org/licenses/LICENSE-2.0 | 9 | | -
| 10 | | - Unless required by applicable law or agreed to in writing, software | 11 | | - distributed under the License is distributed on an "AS IS" BASIS, | 12 | | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | | - See the License for the specific language governing permissions and | 14 | | - limitations under the License. | 15 | | -*/ | | 2 | + * Copyright 2016 Google Inc. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | | 5 | + * you may not use this file except in compliance with the License. | | 6 | + * You may obtain a copy of the License at | | 7 | + * | | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | | 9 | + * | | 10 | + * Unless required by applicable law or agreed to in writing, software | | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | | 13 | + * See the License for the specific language governing permissions and | | 14 | + * limitations under the License. | | 15 | + */ | 16 | 16 |
| 17 | 17 | package com.example.bigquery; | 18 | 18 |
| | 26 | 26 | import com.google.cloud.bigquery.QueryResponse; | 27 | 27 | import com.google.cloud.bigquery.QueryResult; | 28 | 28 | import com.google.cloud.bigquery.TableId; | | 29 | +import java.io.IOException; | | 30 | +import java.util.List; | | 31 | +import java.util.UUID; | | 32 | +import java.util.concurrent.TimeoutException; | 29 | 33 | import org.apache.commons.cli.CommandLine; | 30 | 34 | import org.apache.commons.cli.CommandLineParser; | 31 | 35 | import org.apache.commons.cli.DefaultParser; | | 34 | 38 | import org.apache.commons.cli.Options; | 35 | 39 | import org.apache.commons.cli.ParseException; | 36 | 40 |
| 37 | | -import java.io.IOException; | 38 | | -import java.util.List; | 39 | | -import java.util.UUID; | 40 | | -import java.util.concurrent.TimeoutException; | 41 | | - | 42 | 41 | /** Runs a query against BigQuery. */ | 43 | 42 | public class QuerySample { | 44 | 43 | // [START query_config_simple] | @@ -158,8 +157,9 @@ public static void runQuery(QueryJobConfiguration queryConfig) | 158 | 157 | /** Prompts the user for the required parameters to perform a query. */ | 159 | 158 | public static void main(final String[] args) | 160 | 159 | throws IOException, InterruptedException, TimeoutException, ParseException { | | 160 | + //CHECKSTYLE OFF: VariableDeclarationUsageDistance - improves readability | 161 | 161 | Options options = new Options(); | 162 | | - | | 162 | + //CHECKSTLYE ON: VariableDeclarationUsageDistance | 163 | 163 | // Use an OptionsGroup to choose which sample to run. | 164 | 164 | OptionGroup samples = new OptionGroup(); | 165 | 165 | samples.addOption(Option.builder().longOpt("runSimpleQuery").build()); | |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/src/main/java/com/example/bigquery/QuickstartSample.java +14-14Lines changed: 14 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - Copyright 2016, Google, Inc. | 3 | | -
| 4 | | - Licensed under the Apache License, Version 2.0 (the "License"); | 5 | | - you may not use this file except in compliance with the License. | 6 | | - You may obtain a copy of the License at | 7 | | -
| 8 | | - http://www.apache.org/licenses/LICENSE-2.0 | 9 | | -
| 10 | | - Unless required by applicable law or agreed to in writing, software | 11 | | - distributed under the License is distributed on an "AS IS" BASIS, | 12 | | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | | - See the License for the specific language governing permissions and | 14 | | - limitations under the License. | 15 | | -*/ | | 2 | + * Copyright 2016 Google Inc. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | | 5 | + * you may not use this file except in compliance with the License. | | 6 | + * You may obtain a copy of the License at | | 7 | + * | | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | | 9 | + * | | 10 | + * Unless required by applicable law or agreed to in writing, software | | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | | 13 | + * See the License for the specific language governing permissions and | | 14 | + * limitations under the License. | | 15 | + */ | 16 | 16 |
| 17 | 17 | package com.example.bigquery; | 18 | 18 |
| |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/src/main/java/com/example/bigquery/SimpleApp.java +15-16Lines changed: 15 additions & 16 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - Copyright 2016, Google, Inc. | 3 | | -
| 4 | | - Licensed under the Apache License, Version 2.0 (the "License"); | 5 | | - you may not use this file except in compliance with the License. | 6 | | - You may obtain a copy of the License at | 7 | | -
| 8 | | - http://www.apache.org/licenses/LICENSE-2.0 | 9 | | -
| 10 | | - Unless required by applicable law or agreed to in writing, software | 11 | | - distributed under the License is distributed on an "AS IS" BASIS, | 12 | | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | | - See the License for the specific language governing permissions and | 14 | | - limitations under the License. | 15 | | -*/ | | 2 | + * Copyright 2016 Google Inc. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | | 5 | + * you may not use this file except in compliance with the License. | | 6 | + * You may obtain a copy of the License at | | 7 | + * | | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | | 9 | + * | | 10 | + * Unless required by applicable law or agreed to in writing, software | | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | | 13 | + * See the License for the specific language governing permissions and | | 14 | + * limitations under the License. | | 15 | + */ | 16 | 16 |
| 17 | 17 | package com.example.bigquery; | 18 | 18 |
| 19 | 19 | // [START bigquery_simple_app_all] | 20 | 20 | // [START bigquery_simple_app_deps] | | 21 | + | 21 | 22 | import com.google.cloud.bigquery.BigQuery; | 22 | 23 | import com.google.cloud.bigquery.BigQueryOptions; | 23 | | -import com.google.cloud.bigquery.FieldValue; | 24 | 24 | import com.google.cloud.bigquery.FieldValueList; | 25 | 25 | import com.google.cloud.bigquery.Job; | 26 | 26 | import com.google.cloud.bigquery.JobId; | 27 | 27 | import com.google.cloud.bigquery.JobInfo; | 28 | 28 | import com.google.cloud.bigquery.QueryJobConfiguration; | 29 | 29 | import com.google.cloud.bigquery.QueryResponse; | 30 | 30 | import com.google.cloud.bigquery.QueryResult; | 31 | | -import java.util.List; | 32 | 31 | import java.util.UUID; | 33 | 32 | // [END bigquery_simple_app_deps] | 34 | 33 |
| |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/src/test/java/com/example/bigquery/AuthSnippetsIT.java +16-17Lines changed: 16 additions & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - Copyright 2017, Google, Inc. | 3 | | -
| 4 | | - Licensed under the Apache License, Version 2.0 (the "License"); | 5 | | - you may not use this file except in compliance with the License. | 6 | | - You may obtain a copy of the License at | 7 | | -
| 8 | | - http://www.apache.org/licenses/LICENSE-2.0 | 9 | | -
| 10 | | - Unless required by applicable law or agreed to in writing, software | 11 | | - distributed under the License is distributed on an "AS IS" BASIS, | 12 | | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | | - See the License for the specific language governing permissions and | 14 | | - limitations under the License. | 15 | | -*/ | | 2 | + * Copyright 2017 Google Inc. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | | 5 | + * you may not use this file except in compliance with the License. | | 6 | + * You may obtain a copy of the License at | | 7 | + * | | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | | 9 | + * | | 10 | + * Unless required by applicable law or agreed to in writing, software | | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | | 13 | + * See the License for the specific language governing permissions and | | 14 | + * limitations under the License. | | 15 | + */ | 16 | 16 |
| 17 | 17 | package com.example.bigquery; | 18 | 18 |
| 19 | 19 | import static com.google.common.truth.Truth.assertThat; | 20 | 20 |
| | 21 | +import java.io.ByteArrayOutputStream; | | 22 | +import java.io.PrintStream; | 21 | 23 | import org.junit.After; | 22 | 24 | import org.junit.Before; | 23 | 25 | import org.junit.Test; | 24 | 26 | import org.junit.runner.RunWith; | 25 | 27 | import org.junit.runners.JUnit4; | 26 | 28 |
| 27 | | -import java.io.ByteArrayOutputStream; | 28 | | -import java.io.PrintStream; | 29 | | - | 30 | 29 | /** Tests for auth samples. */ | 31 | 30 | @RunWith(JUnit4.class) | 32 | 31 | @SuppressWarnings("checkstyle:abbreviationaswordinname") | |
Collapse file Copy file name to clipboardExpand all lines: bigquery/cloud-client/src/test/java/com/example/bigquery/QueryParametersSampleIT.java +16-17Lines changed: 16 additions & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - Copyright 2016 Google Inc. | 3 | | -
| 4 | | - Licensed under the Apache License, Version 2.0 (the "License"); | 5 | | - you may not use this file except in compliance with the License. | 6 | | - You may obtain a copy of the License at | 7 | | -
| 8 | | - http://www.apache.org/licenses/LICENSE-2.0 | 9 | | -
| 10 | | - Unless required by applicable law or agreed to in writing, software | 11 | | - distributed under the License is distributed on an "AS IS" BASIS, | 12 | | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | | - See the License for the specific language governing permissions and | 14 | | - limitations under the License. | 15 | | -*/ | | 2 | + * Copyright 2016 Google Inc. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | | 5 | + * you may not use this file except in compliance with the License. | | 6 | + * You may obtain a copy of the License at | | 7 | + * | | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | | 9 | + * | | 10 | + * Unless required by applicable law or agreed to in writing, software | | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | | 13 | + * See the License for the specific language governing permissions and | | 14 | + * limitations under the License. | | 15 | + */ | 16 | 16 |
| 17 | 17 | package com.example.bigquery; | 18 | 18 |
| 19 | 19 | import static com.google.common.truth.Truth.assertThat; | 20 | 20 |
| | 21 | +import java.io.ByteArrayOutputStream; | | 22 | +import java.io.PrintStream; | 21 | 23 | import org.junit.After; | 22 | 24 | import org.junit.Before; | 23 | 25 | import org.junit.Test; | 24 | 26 | import org.junit.runner.RunWith; | 25 | 27 | import org.junit.runners.JUnit4; | 26 | 28 |
| 27 | | -import java.io.ByteArrayOutputStream; | 28 | | -import java.io.PrintStream; | 29 | | - | 30 | 29 | /** Tests for simple app sample. */ | 31 | 30 | @RunWith(JUnit4.class) | 32 | 31 | @SuppressWarnings("checkstyle:abbreviationaswordinname") | |
|