From c1530ff6bae192e83ffb6f32bdfefb5f1319ba38 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 13 Mar 2024 03:12:02 +0000 Subject: [PATCH] feat: Automated regeneration of Places client --- clients/places/.gitignore | 37 ++ clients/places/LICENSE | 201 ++++++++++ clients/places/README.md | 23 ++ clients/places/config/config.exs | 20 + .../lib/google_api/places/v1/api/places.ex | 344 ++++++++++++++++++ .../lib/google_api/places/v1/connection.ex | 47 +++ .../lib/google_api/places/v1/metadata.ex | 26 ++ .../v1/model/google_geo_type_viewport.ex | 49 +++ ...oogle_maps_places_v1_author_attribution.ex | 52 +++ ...s_places_v1_autocomplete_places_request.ex | 87 +++++ ...tocomplete_places_request_location_bias.ex | 54 +++ ...ete_places_request_location_restriction.ex | 54 +++ ..._places_v1_autocomplete_places_response.ex | 55 +++ ...autocomplete_places_response_suggestion.ex | 65 ++++ ...es_response_suggestion_formattable_text.ex | 65 ++++ ...es_response_suggestion_place_prediction.ex | 81 +++++ ...es_response_suggestion_query_prediction.ex | 67 ++++ ...places_response_suggestion_string_range.ex | 54 +++ ...s_response_suggestion_structured_format.ex | 67 ++++ .../v1/model/google_maps_places_v1_circle.ex | 49 +++ ...google_maps_places_v1_ev_charge_options.ex | 57 +++ ...ev_charge_options_connector_aggregation.ex | 66 ++++ .../google_maps_places_v1_fuel_options.ex | 50 +++ ..._maps_places_v1_fuel_options_fuel_price.ex | 52 +++ .../v1/model/google_maps_places_v1_photo.ex | 60 +++ .../google_maps_places_v1_photo_media.ex | 49 +++ .../v1/model/google_maps_places_v1_place.ex | 266 ++++++++++++++ ...s_places_v1_place_accessibility_options.ex | 55 +++ ..._maps_places_v1_place_address_component.ex | 55 +++ ...google_maps_places_v1_place_attribution.ex | 49 +++ ...ogle_maps_places_v1_place_opening_hours.ex | 71 ++++ ...ps_places_v1_place_opening_hours_period.ex | 51 +++ ...ces_v1_place_opening_hours_period_point.ex | 63 ++++ ...aces_v1_place_opening_hours_special_day.ex | 48 +++ ...le_maps_places_v1_place_parking_options.ex | 64 ++++ ...le_maps_places_v1_place_payment_options.ex | 55 +++ .../google_maps_places_v1_place_plus_code.ex | 49 +++ ...le_maps_places_v1_place_sub_destination.ex | 49 +++ .../v1/model/google_maps_places_v1_review.ex | 65 ++++ ...le_maps_places_v1_search_nearby_request.ex | 76 ++++ ...rch_nearby_request_location_restriction.ex | 51 +++ ...e_maps_places_v1_search_nearby_response.ex | 46 +++ ...ogle_maps_places_v1_search_text_request.ex | 93 +++++ ...laces_v1_search_text_request_ev_options.ex | 51 +++ ...es_v1_search_text_request_location_bias.ex | 54 +++ ...earch_text_request_location_restriction.ex | 51 +++ ...gle_maps_places_v1_search_text_response.ex | 46 +++ .../places/v1/model/google_type_date.ex | 52 +++ .../places/v1/model/google_type_lat_lng.ex | 49 +++ .../v1/model/google_type_localized_text.ex | 49 +++ .../places/v1/model/google_type_money.ex | 52 +++ clients/places/mix.exs | 66 ++++ clients/places/test/test_helper.exs | 35 ++ 53 files changed, 3542 insertions(+) create mode 100644 clients/places/.gitignore create mode 100644 clients/places/LICENSE create mode 100644 clients/places/README.md create mode 100644 clients/places/config/config.exs create mode 100644 clients/places/lib/google_api/places/v1/api/places.ex create mode 100644 clients/places/lib/google_api/places/v1/connection.ex create mode 100644 clients/places/lib/google_api/places/v1/metadata.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_geo_type_viewport.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_author_attribution.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_bias.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_restriction.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_formattable_text.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_place_prediction.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_query_prediction.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_string_range.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_structured_format.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_circle.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options_connector_aggregation.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options_fuel_price.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo_media.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_accessibility_options.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_address_component.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_attribution.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period_point.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_special_day.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_parking_options.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_payment_options.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_plus_code.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_sub_destination.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_review.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request_location_restriction.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_response.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_ev_options.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_bias.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_restriction.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_response.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_type_date.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_type_lat_lng.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_type_localized_text.ex create mode 100644 clients/places/lib/google_api/places/v1/model/google_type_money.ex create mode 100644 clients/places/mix.exs create mode 100644 clients/places/test/test_helper.exs diff --git a/clients/places/.gitignore b/clients/places/.gitignore new file mode 100644 index 0000000000..6bf4496152 --- /dev/null +++ b/clients/places/.gitignore @@ -0,0 +1,37 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +# The directory Mix will write compiled artifacts to. +/_build + +# If you run "mix test --cover", coverage assets end up here. +/cover + +# The directory Mix downloads your dependencies sources to. +/deps + +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez diff --git a/clients/places/LICENSE b/clients/places/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/clients/places/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/clients/places/README.md b/clients/places/README.md new file mode 100644 index 0000000000..3cc614b327 --- /dev/null +++ b/clients/places/README.md @@ -0,0 +1,23 @@ +# GoogleApi.Places + +Places API (New) client library. + + + +## Installation + +Install this package from [Hex](https://hex.pm) by adding +`google_api_places` to your list of dependencies in `mix.exs`: + +```elixir +def deps do + [{:google_api_places, "~> 0.2"}] +end +``` + +## For more information + +Product documentation is available at [https://mapsplatform.google.com/maps-products/#places-section](https://mapsplatform.google.com/maps-products/#places-section). + +Library reference documentation is published on Hexdocs at +[https://hexdocs.pm/google_api_places](https://hexdocs.pm/google_api_places). diff --git a/clients/places/config/config.exs b/clients/places/config/config.exs new file mode 100644 index 0000000000..07afe5f311 --- /dev/null +++ b/clients/places/config/config.exs @@ -0,0 +1,20 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +use Mix.Config + + diff --git a/clients/places/lib/google_api/places/v1/api/places.ex b/clients/places/lib/google_api/places/v1/api/places.ex new file mode 100644 index 0000000000..0bd7ac6f64 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/api/places.ex @@ -0,0 +1,344 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Api.Places do + @moduledoc """ + API calls for all endpoints tagged `Places`. + """ + + alias GoogleApi.Places.V1.Connection + alias GoogleApi.Gax.{Request, Response} + + @library_version Mix.Project.config() |> Keyword.get(:version, "") + + @doc """ + Returns predictions for the given input. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Places.V1.Connection.t`) - Connection to server + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponse{}}` on success + * `{:error, info}` on failure + """ + @spec places_places_autocomplete(Tesla.Env.client(), keyword(), keyword()) :: + {:ok, GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def places_places_autocomplete(connection, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/places:autocomplete", %{}) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode( + opts ++ [struct: %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponse{}] + ) + end + + @doc """ + Get the details of a place based on its resource name, which is a string in the `places/{place_id}` format. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Places.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Required. The resource name of a place, in the `places/{place_id}` format. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:languageCode` (*type:* `String.t`) - Optional. Place details will be displayed with the preferred language if available. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. + * `:regionCode` (*type:* `String.t`) - Optional. The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. + * `:sessionToken` (*type:* `String.t`) - Optional. A string which identifies an Autocomplete session for billing purposes. Must be a URL and filename safe base64 string with at most 36 ASCII characters in length. Otherwise an INVALID_ARGUMENT error is returned. The session begins when the user starts typing a query, and concludes when they select a place and a call to Place Details or Address Validation is made. Each session can have multiple queries, followed by one Place Details or Address Validation request. The credentials used for each request within a session must belong to the same Google Cloud Console project. Once a session has concluded, the token is no longer valid; your app must generate a fresh token for each session. If the `session_token` parameter is omitted, or if you reuse a session token, the session is charged as if no session token was provided (each request is billed separately). We recommend the following guidelines: * Use session tokens for all Place Autocomplete calls. * Generate a fresh token for each session. Using a version 4 UUID is recommended. * Ensure that the credentials used for all Place Autocomplete, Place Details, and Address Validation requests within a session belong to the same Cloud Console project. * Be sure to pass a unique session token for each new session. Using the same token for more than one session will result in each request being billed individually. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place{}}` on success + * `{:error, info}` on failure + """ + @spec places_places_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def places_places_get(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :languageCode => :query, + :regionCode => :query, + :sessionToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place{}]) + end + + @doc """ + Search for places near locations. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Places.V1.Connection.t`) - Connection to server + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse{}}` on success + * `{:error, info}` on failure + """ + @spec places_places_search_nearby(Tesla.Env.client(), keyword(), keyword()) :: + {:ok, GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def places_places_search_nearby(connection, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/places:searchNearby", %{}) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode( + opts ++ [struct: %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse{}] + ) + end + + @doc """ + Text query based place search. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Places.V1.Connection.t`) - Connection to server + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse{}}` on success + * `{:error, info}` on failure + """ + @spec places_places_search_text(Tesla.Env.client(), keyword(), keyword()) :: + {:ok, GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def places_places_search_text(connection, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/places:searchText", %{}) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode( + opts ++ [struct: %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse{}] + ) + end + + @doc """ + Get a photo media with a photo reference string. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Places.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Required. The resource name of a photo media in the format: `places/{place_id}/photos/{photo_reference}/media`. The resource name of a photo as returned in a Place object's `photos.name` field comes with the format `places/{place_id}/photos/{photo_reference}`. You need to append `/media` at the end of the photo resource to get the photo media resource name. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:maxHeightPx` (*type:* `integer()`) - Optional. Specifies the maximum desired height, in pixels, of the image. If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. Both the max_height_px and max_width_px properties accept an integer between 1 and 4800, inclusively. If the value is not within the allowed range, an INVALID_ARGUMENT error will be returned. At least one of max_height_px or max_width_px needs to be specified. If neither max_height_px nor max_width_px is specified, an INVALID_ARGUMENT error will be returned. + * `:maxWidthPx` (*type:* `integer()`) - Optional. Specifies the maximum desired width, in pixels, of the image. If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. Both the max_height_px and max_width_px properties accept an integer between 1 and 4800, inclusively. If the value is not within the allowed range, an INVALID_ARGUMENT error will be returned. At least one of max_height_px or max_width_px needs to be specified. If neither max_height_px nor max_width_px is specified, an INVALID_ARGUMENT error will be returned. + * `:skipHttpRedirect` (*type:* `boolean()`) - Optional. If set, skip the default HTTP redirect behavior and render a text format (for example, in JSON format for HTTP use case) response. If not set, an HTTP redirect will be issued to redirect the call to the image media. This option is ignored for non-HTTP requests. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PhotoMedia{}}` on success + * `{:error, info}` on failure + """ + @spec places_places_photos_get_media(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PhotoMedia.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def places_places_photos_get_media(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :maxHeightPx => :query, + :maxWidthPx => :query, + :skipHttpRedirect => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode( + opts ++ [struct: %GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PhotoMedia{}] + ) + end +end diff --git a/clients/places/lib/google_api/places/v1/connection.ex b/clients/places/lib/google_api/places/v1/connection.ex new file mode 100644 index 0000000000..90bf9804d1 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/connection.ex @@ -0,0 +1,47 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Connection do + @moduledoc """ + Handle Tesla connections for GoogleApi.Places.V1. + """ + + @type t :: Tesla.Env.client() + + use GoogleApi.Gax.Connection, + scopes: [ + # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. + "https://www.googleapis.com/auth/cloud-platform", + + # Private Service: https://www.googleapis.com/auth/maps-platform.places + "https://www.googleapis.com/auth/maps-platform.places", + + # Private Service: https://www.googleapis.com/auth/maps-platform.places.autocomplete + "https://www.googleapis.com/auth/maps-platform.places.autocomplete", + + # Private Service: https://www.googleapis.com/auth/maps-platform.places.details + "https://www.googleapis.com/auth/maps-platform.places.details", + + # Private Service: https://www.googleapis.com/auth/maps-platform.places.nearbysearch + "https://www.googleapis.com/auth/maps-platform.places.nearbysearch", + + # Private Service: https://www.googleapis.com/auth/maps-platform.places.textsearch + "https://www.googleapis.com/auth/maps-platform.places.textsearch" + ], + otp_app: :google_api_places, + base_url: "https://places.googleapis.com/" +end diff --git a/clients/places/lib/google_api/places/v1/metadata.ex b/clients/places/lib/google_api/places/v1/metadata.ex new file mode 100644 index 0000000000..067bdbd29c --- /dev/null +++ b/clients/places/lib/google_api/places/v1/metadata.ex @@ -0,0 +1,26 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1 do + @moduledoc """ + API client metadata for GoogleApi.Places.V1. + """ + + @discovery_revision "20240310" + + def discovery_revision(), do: @discovery_revision +end diff --git a/clients/places/lib/google_api/places/v1/model/google_geo_type_viewport.ex b/clients/places/lib/google_api/places/v1/model/google_geo_type_viewport.ex new file mode 100644 index 0000000000..751ee2ad00 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_geo_type_viewport.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleGeoTypeViewport do + @moduledoc """ + A latitude-longitude viewport, represented as two diagonally opposite `low` and `high` points. A viewport is considered a closed region, i.e. it includes its boundary. The latitude bounds must range between -90 to 90 degrees inclusive, and the longitude bounds must range between -180 to 180 degrees inclusive. Various cases include: - If `low` = `high`, the viewport consists of that single point. - If `low.longitude` > `high.longitude`, the longitude range is inverted (the viewport crosses the 180 degree longitude line). - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, the viewport includes all longitudes. - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, the longitude range is empty. - If `low.latitude` > `high.latitude`, the latitude range is empty. Both `low` and `high` must be populated, and the represented box cannot be empty (as specified by the definitions above). An empty viewport will result in an error. For example, this viewport fully encloses New York City: { "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } } + + ## Attributes + + * `high` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLatLng.t`, *default:* `nil`) - Required. The high point of the viewport. + * `low` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLatLng.t`, *default:* `nil`) - Required. The low point of the viewport. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :high => GoogleApi.Places.V1.Model.GoogleTypeLatLng.t() | nil, + :low => GoogleApi.Places.V1.Model.GoogleTypeLatLng.t() | nil + } + + field(:high, as: GoogleApi.Places.V1.Model.GoogleTypeLatLng) + field(:low, as: GoogleApi.Places.V1.Model.GoogleTypeLatLng) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleGeoTypeViewport do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleGeoTypeViewport do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_author_attribution.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_author_attribution.ex new file mode 100644 index 0000000000..71b3b6f59e --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_author_attribution.ex @@ -0,0 +1,52 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution do + @moduledoc """ + Information about the author of the UGC data. Used in Photo, and Review. + + ## Attributes + + * `displayName` (*type:* `String.t`, *default:* `nil`) - Name of the author of the Photo or Review. + * `photoUri` (*type:* `String.t`, *default:* `nil`) - Profile photo URI of the author of the Photo or Review. + * `uri` (*type:* `String.t`, *default:* `nil`) - URI of the author of the Photo or Review. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :displayName => String.t() | nil, + :photoUri => String.t() | nil, + :uri => String.t() | nil + } + + field(:displayName) + field(:photoUri) + field(:uri) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request.ex new file mode 100644 index 0000000000..34feb214e9 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request.ex @@ -0,0 +1,87 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequest do + @moduledoc """ + Request proto for AutocompletePlaces. + + ## Attributes + + * `includeQueryPredictions` (*type:* `boolean()`, *default:* `nil`) - Optional. If true, the response will include both Place and query predictions. Otherwise the response will only return Place predictions. + * `includedPrimaryTypes` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Included primary Place type (for example, "restaurant" or "gas_station") from https://developers.google.com/maps/documentation/places/web-service/place-types. A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. + * `includedRegionCodes` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both `location_restriction` and `included_region_codes` are set, the results will be located in the area of intersection. + * `input` (*type:* `String.t`, *default:* `nil`) - Required. The text string on which to search. + * `inputOffset` (*type:* `integer()`, *default:* `nil`) - Optional. A zero-based Unicode character offset of `input` indicating the cursor position in `input`. The cursor position may influence what predictions are returned. If empty, defaults to the length of `input`. + * `languageCode` (*type:* `String.t`, *default:* `nil`) - Optional. The language in which to return results. Defaults to en-US. The results may be in mixed languages if the language used in `input` is different from `language_code` or if the returned Place does not have a translation from the local language to `language_code`. + * `locationBias` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias.t`, *default:* `nil`) - Optional. Bias results to a specified location. At most one of `location_bias` or `location_restriction` should be set. If neither are set, the results will be biased by IP address, meaning the IP address will be mapped to an imprecise location and used as a biasing signal. + * `locationRestriction` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction.t`, *default:* `nil`) - Optional. Restrict results to a specified location. At most one of `location_bias` or `location_restriction` should be set. If neither are set, the results will be biased by IP address, meaning the IP address will be mapped to an imprecise location and used as a biasing signal. + * `origin` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLatLng.t`, *default:* `nil`) - Optional. The origin point from which to calculate geodesic distance to the destination (returned as `distance_meters`). If this value is omitted, geodesic distance will not be returned. + * `regionCode` (*type:* `String.t`, *default:* `nil`) - Optional. The region code, specified as a CLDR two-character region code. This affects address formatting, result ranking, and may influence what results are returned. This does not restrict results to the specified region. To restrict results to a region, use `region_code_restriction`. + * `sessionToken` (*type:* `String.t`, *default:* `nil`) - Optional. A string which identifies an Autocomplete session for billing purposes. Must be a URL and filename safe base64 string with at most 36 ASCII characters in length. Otherwise an INVALID_ARGUMENT error is returned. The session begins when the user starts typing a query, and concludes when they select a place and a call to Place Details or Address Validation is made. Each session can have multiple queries, followed by one Place Details or Address Validation request. The credentials used for each request within a session must belong to the same Google Cloud Console project. Once a session has concluded, the token is no longer valid; your app must generate a fresh token for each session. If the `session_token` parameter is omitted, or if you reuse a session token, the session is charged as if no session token was provided (each request is billed separately). We recommend the following guidelines: * Use session tokens for all Place Autocomplete calls. * Generate a fresh token for each session. Using a version 4 UUID is recommended. * Ensure that the credentials used for all Place Autocomplete, Place Details, and Address Validation requests within a session belong to the same Cloud Console project. * Be sure to pass a unique session token for each new session. Using the same token for more than one session will result in each request being billed individually. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :includeQueryPredictions => boolean() | nil, + :includedPrimaryTypes => list(String.t()) | nil, + :includedRegionCodes => list(String.t()) | nil, + :input => String.t() | nil, + :inputOffset => integer() | nil, + :languageCode => String.t() | nil, + :locationBias => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias.t() + | nil, + :locationRestriction => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction.t() + | nil, + :origin => GoogleApi.Places.V1.Model.GoogleTypeLatLng.t() | nil, + :regionCode => String.t() | nil, + :sessionToken => String.t() | nil + } + + field(:includeQueryPredictions) + field(:includedPrimaryTypes, type: :list) + field(:includedRegionCodes, type: :list) + field(:input) + field(:inputOffset) + field(:languageCode) + + field(:locationBias, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias + ) + + field(:locationRestriction, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction + ) + + field(:origin, as: GoogleApi.Places.V1.Model.GoogleTypeLatLng) + field(:regionCode) + field(:sessionToken) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequest do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_bias.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_bias.ex new file mode 100644 index 0000000000..2063250381 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_bias.ex @@ -0,0 +1,54 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias do + @moduledoc """ + The region to search. The results may be biased around the specified region. + + ## Attributes + + * `circle` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t`, *default:* `nil`) - A circle defined by a center point and radius. + * `rectangle` (*type:* `GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t`, *default:* `nil`) - A viewport defined by a northeast and a southwest corner. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :circle => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t() | nil, + :rectangle => GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t() | nil + } + + field(:circle, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle) + field(:rectangle, as: GoogleApi.Places.V1.Model.GoogleGeoTypeViewport) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_restriction.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_restriction.ex new file mode 100644 index 0000000000..a1f77b0c61 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_request_location_restriction.ex @@ -0,0 +1,54 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction do + @moduledoc """ + The region to search. The results will be restricted to the specified region. + + ## Attributes + + * `circle` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t`, *default:* `nil`) - A circle defined by a center point and radius. + * `rectangle` (*type:* `GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t`, *default:* `nil`) - A viewport defined by a northeast and a southwest corner. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :circle => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t() | nil, + :rectangle => GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t() | nil + } + + field(:circle, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle) + field(:rectangle, as: GoogleApi.Places.V1.Model.GoogleGeoTypeViewport) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response.ex new file mode 100644 index 0000000000..d5d61e1170 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response.ex @@ -0,0 +1,55 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponse do + @moduledoc """ + Response proto for AutocompletePlaces. + + ## Attributes + + * `suggestions` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion.t)`, *default:* `nil`) - Contains a list of suggestions, ordered in descending order of relevance. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :suggestions => + list( + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion.t() + ) + | nil + } + + field(:suggestions, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion, + type: :list + ) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponse do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion.ex new file mode 100644 index 0000000000..aa374d9cbf --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion.ex @@ -0,0 +1,65 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion do + @moduledoc """ + An Autocomplete suggestion result. + + ## Attributes + + * `placePrediction` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction.t`, *default:* `nil`) - A prediction for a Place. + * `queryPrediction` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction.t`, *default:* `nil`) - A prediction for a query. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :placePrediction => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction.t() + | nil, + :queryPrediction => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction.t() + | nil + } + + field(:placePrediction, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction + ) + + field(:queryPrediction, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction + ) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_formattable_text.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_formattable_text.ex new file mode 100644 index 0000000000..0f8eb1b1ab --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_formattable_text.ex @@ -0,0 +1,65 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText do + @moduledoc """ + Text representing a Place or query prediction. The text may be used as is or formatted. + + ## Attributes + + * `matches` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange.t)`, *default:* `nil`) - A list of string ranges identifying where the input request matched in `text`. The ranges can be used to format specific parts of `text`. The substrings may not be exact matches of `input` if the matching was determined by criteria other than string matching (for example, spell corrections or transliterations). These values are Unicode character offsets of `text`. The ranges are guaranteed to be ordered in increasing offset values. + * `text` (*type:* `String.t`, *default:* `nil`) - Text that may be used as is or formatted with `matches`. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :matches => + list( + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange.t() + ) + | nil, + :text => String.t() | nil + } + + field(:matches, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange, + type: :list + ) + + field(:text) +end + +defimpl Poison.Decoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_place_prediction.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_place_prediction.ex new file mode 100644 index 0000000000..f115f8b672 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_place_prediction.ex @@ -0,0 +1,81 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction do + @moduledoc """ + Prediction results for a Place Autocomplete prediction. + + ## Attributes + + * `distanceMeters` (*type:* `integer()`, *default:* `nil`) - The length of the geodesic in meters from `origin` if `origin` is specified. Certain predictions such as routes may not populate this field. + * `place` (*type:* `String.t`, *default:* `nil`) - The resource name of the suggested Place. This name can be used in other APIs that accept Place names. + * `placeId` (*type:* `String.t`, *default:* `nil`) - The unique identifier of the suggested Place. This identifier can be used in other APIs that accept Place IDs. + * `structuredFormat` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat.t`, *default:* `nil`) - A breakdown of the Place prediction into main text containing the name of the Place and secondary text containing additional disambiguating features (such as a city or region). `structured_format` is recommended for developers who wish to show two separate, but related, UI elements. Developers who wish to show a single UI element may want to use `text` instead. They are two different ways to represent a Place prediction. Users should not try to parse `structured_format` into `text` or vice versa. + * `text` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t`, *default:* `nil`) - Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address. `text` is recommended for developers who wish to show a single UI element. Developers who wish to show two separate, but related, UI elements may want to use `structured_format` instead. They are two different ways to represent a Place prediction. Users should not try to parse `structured_format` into `text` or vice versa. This text may be different from the `display_name` returned by GetPlace. May be in mixed languages if the request `input` and `language_code` are in different languages or if the Place does not have a translation from the local language to `language_code`. + * `types` (*type:* `list(String.t)`, *default:* `nil`) - List of types that apply to this Place from Table A or Table B in https://developers.google.com/maps/documentation/places/web-service/place-types. A type is a categorization of a Place. Places with shared types will share similar characteristics. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :distanceMeters => integer() | nil, + :place => String.t() | nil, + :placeId => String.t() | nil, + :structuredFormat => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat.t() + | nil, + :text => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t() + | nil, + :types => list(String.t()) | nil + } + + field(:distanceMeters) + field(:place) + field(:placeId) + + field(:structuredFormat, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat + ) + + field(:text, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText + ) + + field(:types, type: :list) +end + +defimpl Poison.Decoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_query_prediction.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_query_prediction.ex new file mode 100644 index 0000000000..b79ddb3e76 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_query_prediction.ex @@ -0,0 +1,67 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction do + @moduledoc """ + Prediction results for a Query Autocomplete prediction. + + ## Attributes + + * `structuredFormat` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat.t`, *default:* `nil`) - A breakdown of the query prediction into main text containing the query and secondary text containing additional disambiguating features (such as a city or region). `structured_format` is recommended for developers who wish to show two separate, but related, UI elements. Developers who wish to show a single UI element may want to use `text` instead. They are two different ways to represent a query prediction. Users should not try to parse `structured_format` into `text` or vice versa. + * `text` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t`, *default:* `nil`) - The predicted text. This text does not represent a Place, but rather a text query that could be used in a search endpoint (for example, TextSearch). `text` is recommended for developers who wish to show a single UI element. Developers who wish to show two separate, but related, UI elements may want to use `structured_format` instead. They are two different ways to represent a query prediction. Users should not try to parse `structured_format` into `text` or vice versa. May be in mixed languages if the request `input` and `language_code` are in different languages or if part of the query does not have a translation from the local language to `language_code`. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :structuredFormat => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat.t() + | nil, + :text => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t() + | nil + } + + field(:structuredFormat, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat + ) + + field(:text, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText + ) +end + +defimpl Poison.Decoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_string_range.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_string_range.ex new file mode 100644 index 0000000000..d5f0388c82 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_string_range.ex @@ -0,0 +1,54 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange do + @moduledoc """ + Identifies a substring within a given text. + + ## Attributes + + * `endOffset` (*type:* `integer()`, *default:* `nil`) - Zero-based offset of the last Unicode character (exclusive). + * `startOffset` (*type:* `integer()`, *default:* `nil`) - Zero-based offset of the first Unicode character of the string (inclusive). + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :endOffset => integer() | nil, + :startOffset => integer() | nil + } + + field(:endOffset) + field(:startOffset) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_structured_format.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_structured_format.ex new file mode 100644 index 0000000000..27e76c5b1b --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_autocomplete_places_response_suggestion_structured_format.ex @@ -0,0 +1,67 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat do + @moduledoc """ + Contains a breakdown of a Place or query prediction into main text and secondary text. For Place predictions, the main text contains the specific name of the Place. For query predictions, the main text contains the query. The secondary text contains additional disambiguating features (such as a city or region) to further identify the Place or refine the query. + + ## Attributes + + * `mainText` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t`, *default:* `nil`) - Represents the name of the Place or query. + * `secondaryText` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t`, *default:* `nil`) - Represents additional disambiguating features (such as a city or region) to further identify the Place or refine the query. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :mainText => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t() + | nil, + :secondaryText => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText.t() + | nil + } + + field(:mainText, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText + ) + + field(:secondaryText, + as: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText + ) +end + +defimpl Poison.Decoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_circle.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_circle.ex new file mode 100644 index 0000000000..ccf2f3798a --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_circle.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle do + @moduledoc """ + Circle with a LatLng as center and radius. + + ## Attributes + + * `center` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLatLng.t`, *default:* `nil`) - Required. Center latitude and longitude. The range of latitude must be within [-90.0, 90.0]. The range of the longitude must be within [-180.0, 180.0]. + * `radius` (*type:* `float()`, *default:* `nil`) - Required. Radius measured in meters. The radius must be within [0.0, 50000.0]. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :center => GoogleApi.Places.V1.Model.GoogleTypeLatLng.t() | nil, + :radius => float() | nil + } + + field(:center, as: GoogleApi.Places.V1.Model.GoogleTypeLatLng) + field(:radius) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options.ex new file mode 100644 index 0000000000..42b4399ca0 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options.ex @@ -0,0 +1,57 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptions do + @moduledoc """ + Information about the EV Charge Station hosted in Place. Terminology follows https://afdc.energy.gov/fuels/electricity_infrastructure.html One port could charge one car at a time. One port has one or more connectors. One station has one or more ports. + + ## Attributes + + * `connectorAggregation` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation.t)`, *default:* `nil`) - A list of EV charging connector aggregations that contain connectors of the same type and same charge rate. + * `connectorCount` (*type:* `integer()`, *default:* `nil`) - Number of connectors at this station. However, because some ports can have multiple connectors but only be able to charge one car at a time (e.g.) the number of connectors may be greater than the total number of cars which can charge simultaneously. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :connectorAggregation => + list( + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation.t() + ) + | nil, + :connectorCount => integer() | nil + } + + field(:connectorAggregation, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation, + type: :list + ) + + field(:connectorCount) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptions do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptions.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptions do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options_connector_aggregation.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options_connector_aggregation.ex new file mode 100644 index 0000000000..5bca911cae --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_ev_charge_options_connector_aggregation.ex @@ -0,0 +1,66 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation do + @moduledoc """ + EV charging information grouped by [type, max_charge_rate_kw]. Shows EV charge aggregation of connectors that have the same type and max charge rate in kw. + + ## Attributes + + * `availabilityLastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp when the connector availability information in this aggregation was last updated. + * `availableCount` (*type:* `integer()`, *default:* `nil`) - Number of connectors in this aggregation that are currently available. + * `count` (*type:* `integer()`, *default:* `nil`) - Number of connectors in this aggregation. + * `maxChargeRateKw` (*type:* `float()`, *default:* `nil`) - The static max charging rate in kw of each connector in the aggregation. + * `outOfServiceCount` (*type:* `integer()`, *default:* `nil`) - Number of connectors in this aggregation that are currently out of service. + * `type` (*type:* `String.t`, *default:* `nil`) - The connector type of this aggregation. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :availabilityLastUpdateTime => DateTime.t() | nil, + :availableCount => integer() | nil, + :count => integer() | nil, + :maxChargeRateKw => float() | nil, + :outOfServiceCount => integer() | nil, + :type => String.t() | nil + } + + field(:availabilityLastUpdateTime, as: DateTime) + field(:availableCount) + field(:count) + field(:maxChargeRateKw) + field(:outOfServiceCount) + field(:type) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options.ex new file mode 100644 index 0000000000..9981a23bed --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options.ex @@ -0,0 +1,50 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptions do + @moduledoc """ + The most recent information about fuel options in a gas station. This information is updated regularly. + + ## Attributes + + * `fuelPrices` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptionsFuelPrice.t)`, *default:* `nil`) - The last known fuel price for each type of fuel this station has. There is one entry per fuel type this station has. Order is not important. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :fuelPrices => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptionsFuelPrice.t()) | nil + } + + field(:fuelPrices, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptionsFuelPrice, + type: :list + ) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptions do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptions.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptions do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options_fuel_price.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options_fuel_price.ex new file mode 100644 index 0000000000..132211b601 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_fuel_options_fuel_price.ex @@ -0,0 +1,52 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptionsFuelPrice do + @moduledoc """ + Fuel price information for a given type. + + ## Attributes + + * `price` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeMoney.t`, *default:* `nil`) - The price of the fuel. + * `type` (*type:* `String.t`, *default:* `nil`) - The type of fuel. + * `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the fuel price was last updated. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :price => GoogleApi.Places.V1.Model.GoogleTypeMoney.t() | nil, + :type => String.t() | nil, + :updateTime => DateTime.t() | nil + } + + field(:price, as: GoogleApi.Places.V1.Model.GoogleTypeMoney) + field(:type) + field(:updateTime, as: DateTime) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptionsFuelPrice do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptionsFuelPrice.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptionsFuelPrice do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo.ex new file mode 100644 index 0000000000..7097775fff --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo.ex @@ -0,0 +1,60 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo do + @moduledoc """ + Information about a photo of a place. + + ## Attributes + + * `authorAttributions` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t)`, *default:* `nil`) - This photo's authors. + * `heightPx` (*type:* `integer()`, *default:* `nil`) - The maximum available height, in pixels. + * `name` (*type:* `String.t`, *default:* `nil`) - Identifier. A reference representing this place photo which may be used to look up this place photo again (also called the API "resource" name: `places/{place_id}/photos/{photo}`). + * `widthPx` (*type:* `integer()`, *default:* `nil`) - The maximum available width, in pixels. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :authorAttributions => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t()) | nil, + :heightPx => integer() | nil, + :name => String.t() | nil, + :widthPx => integer() | nil + } + + field(:authorAttributions, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution, + type: :list + ) + + field(:heightPx) + field(:name) + field(:widthPx) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo_media.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo_media.ex new file mode 100644 index 0000000000..ac705b1938 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_photo_media.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PhotoMedia do + @moduledoc """ + A photo media from Places API. + + ## Attributes + + * `name` (*type:* `String.t`, *default:* `nil`) - The resource name of a photo media in the format: `places/{place_id}/photos/{photo_reference}/media`. + * `photoUri` (*type:* `String.t`, *default:* `nil`) - A short-lived uri that can be used to render the photo. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :name => String.t() | nil, + :photoUri => String.t() | nil + } + + field(:name) + field(:photoUri) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PhotoMedia do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PhotoMedia.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PhotoMedia do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place.ex new file mode 100644 index 0000000000..1fbe58ecbe --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place.ex @@ -0,0 +1,266 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place do + @moduledoc """ + All the information representing a Place. + + ## Attributes + + * `restroom` (*type:* `boolean()`, *default:* `nil`) - Place has restroom. + * `shortFormattedAddress` (*type:* `String.t`, *default:* `nil`) - A short, human-readable address for this place. + * `reviews` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review.t)`, *default:* `nil`) - List of reviews about this place, sorted by relevance. A maximum of 5 reviews can be returned. + * `priceLevel` (*type:* `String.t`, *default:* `nil`) - Price level of the place. + * `takeout` (*type:* `boolean()`, *default:* `nil`) - Specifies if the business supports takeout. + * `userRatingCount` (*type:* `integer()`, *default:* `nil`) - The total number of reviews (with or without text) for this place. + * `evChargeOptions` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptions.t`, *default:* `nil`) - Information of ev charging options. + * `displayName` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - The localized name of the place, suitable as a short human-readable description. For example, "Google Sydney", "Starbucks", "Pyrmont", etc. + * `curbsidePickup` (*type:* `boolean()`, *default:* `nil`) - Specifies if the business supports curbside pickup. + * `servesWine` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place serves wine. + * `googleMapsUri` (*type:* `String.t`, *default:* `nil`) - A URL providing more information about this place. + * `addressComponents` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAddressComponent.t)`, *default:* `nil`) - Repeated components for each locality level. Note the following facts about the address_components[] array: - The array of address components may contain more components than the formatted_address. - The array does not necessarily include all the political entities that contain an address, apart from those included in the formatted_address. To retrieve all the political entities that contain a specific address, you should use reverse geocoding, passing the latitude/longitude of the address as a parameter to the request. - The format of the response is not guaranteed to remain the same between requests. In particular, the number of address_components varies based on the address requested and can change over time for the same address. A component can change position in the array. The type of the component can change. A particular component may be missing in a later response. + * `primaryType` (*type:* `String.t`, *default:* `nil`) - The primary type of the given result. This type must one of the Places API supported types. For example, "restaurant", "cafe", "airport", etc. A place can only have a single primary type. For the complete list of possible values, see Table A and Table B at https://developers.google.com/maps/documentation/places/web-service/place-types + * `internationalPhoneNumber` (*type:* `String.t`, *default:* `nil`) - A human-readable phone number for the place, in international format. + * `servesDessert` (*type:* `boolean()`, *default:* `nil`) - Place serves dessert. + * `servesBreakfast` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place serves breakfast. + * `websiteUri` (*type:* `String.t`, *default:* `nil`) - The authoritative website for this place, e.g. a business' homepage. Note that for places that are part of a chain (e.g. an IKEA store), this will usually be the website for the individual store, not the overall chain. + * `regularSecondaryOpeningHours` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t)`, *default:* `nil`) - Contains an array of entries for information about regular secondary hours of a business. Secondary hours are different from a business's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. This field populates the type subfield, which draws from a predefined list of opening hours types (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place. + * `formattedAddress` (*type:* `String.t`, *default:* `nil`) - A full, human-readable address for this place. + * `nationalPhoneNumber` (*type:* `String.t`, *default:* `nil`) - A human-readable phone number for the place, in national format. + * `name` (*type:* `String.t`, *default:* `nil`) - This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place. + * `primaryTypeDisplayName` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - The display name of the primary type, localized to the request language if applicable. For the complete list of possible values, see Table A and Table B at https://developers.google.com/maps/documentation/places/web-service/place-types + * `servesBrunch` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place serves brunch. + * `goodForGroups` (*type:* `boolean()`, *default:* `nil`) - Place accommodates groups. + * `location` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLatLng.t`, *default:* `nil`) - The position of this place. + * `servesCocktails` (*type:* `boolean()`, *default:* `nil`) - Place serves cocktails. + * `currentSecondaryOpeningHours` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t)`, *default:* `nil`) - Contains an array of entries for the next seven days including information about secondary hours of a business. Secondary hours are different from a business's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. This field populates the type subfield, which draws from a predefined list of opening hours types (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place. This field includes the special_days subfield of all hours, set for dates that have exceptional hours. + * `goodForWatchingSports` (*type:* `boolean()`, *default:* `nil`) - Place is suitable for watching sports. + * `dineIn` (*type:* `boolean()`, *default:* `nil`) - Specifies if the business supports indoor or outdoor seating options. + * `liveMusic` (*type:* `boolean()`, *default:* `nil`) - Place provides live music. + * `businessStatus` (*type:* `String.t`, *default:* `nil`) - The business status for the place. + * `parkingOptions` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions.t`, *default:* `nil`) - Options of parking provided by the place. + * `servesVegetarianFood` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place serves vegetarian food. + * `iconMaskBaseUri` (*type:* `String.t`, *default:* `nil`) - A truncated URL to an icon mask. User can access different icon type by appending type suffix to the end (eg, ".svg" or ".png"). + * `reservable` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place supports reservations. + * `fuelOptions` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptions.t`, *default:* `nil`) - The most recent information about fuel options in a gas station. This information is updated regularly. + * `delivery` (*type:* `boolean()`, *default:* `nil`) - Specifies if the business supports delivery. + * `servesCoffee` (*type:* `boolean()`, *default:* `nil`) - Place serves coffee. + * `types` (*type:* `list(String.t)`, *default:* `nil`) - A set of type tags for this result. For example, "political" and "locality". For the complete list of possible values, see Table A and Table B at https://developers.google.com/maps/documentation/places/web-service/place-types + * `menuForChildren` (*type:* `boolean()`, *default:* `nil`) - Place has a children's menu. + * `regularOpeningHours` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t`, *default:* `nil`) - The regular hours of operation. + * `allowsDogs` (*type:* `boolean()`, *default:* `nil`) - Place allows dogs. + * `adrFormatAddress` (*type:* `String.t`, *default:* `nil`) - The place's address in adr microformat: http://microformats.org/wiki/adr. + * `attributions` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAttribution.t)`, *default:* `nil`) - A set of data provider that must be shown with this result. + * `id` (*type:* `String.t`, *default:* `nil`) - The unique identifier of a place. + * `accessibilityOptions` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAccessibilityOptions.t`, *default:* `nil`) - Information about the accessibility options a place offers. + * `photos` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo.t)`, *default:* `nil`) - Information (including references) about photos of this place. A maximum of 10 photos can be returned. + * `rating` (*type:* `float()`, *default:* `nil`) - A rating between 1.0 and 5.0, based on user reviews of this place. + * `subDestinations` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceSubDestination.t)`, *default:* `nil`) - A list of sub destinations related to the place. + * `goodForChildren` (*type:* `boolean()`, *default:* `nil`) - Place is good for children. + * `utcOffsetMinutes` (*type:* `integer()`, *default:* `nil`) - Number of minutes this place's timezone is currently offset from UTC. This is expressed in minutes to support timezones that are offset by fractions of an hour, e.g. X hours and 15 minutes. + * `outdoorSeating` (*type:* `boolean()`, *default:* `nil`) - Place provides outdoor seating. + * `editorialSummary` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - Contains a summary of the place. A summary is comprised of a textual overview, and also includes the language code for these if applicable. Summary text must be presented as-is and can not be modified or altered. + * `paymentOptions` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePaymentOptions.t`, *default:* `nil`) - Payment options the place accepts. If a payment option data is not available, the payment option field will be unset. + * `servesBeer` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place serves beer. + * `currentOpeningHours` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t`, *default:* `nil`) - The hours of operation for the next seven days (including today). The time period starts at midnight on the date of the request and ends at 11:59 pm six days later. This field includes the special_days subfield of all hours, set for dates that have exceptional hours. + * `viewport` (*type:* `GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t`, *default:* `nil`) - A viewport suitable for displaying the place on an average-sized map. + * `plusCode` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePlusCode.t`, *default:* `nil`) - Plus code of the place location lat/long. + * `iconBackgroundColor` (*type:* `String.t`, *default:* `nil`) - Background color for icon_mask in hex format, e.g. #909CE1. + * `servesDinner` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place serves dinner. + * `servesLunch` (*type:* `boolean()`, *default:* `nil`) - Specifies if the place serves lunch. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :restroom => boolean() | nil, + :shortFormattedAddress => String.t() | nil, + :reviews => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review.t()) | nil, + :priceLevel => String.t() | nil, + :takeout => boolean() | nil, + :userRatingCount => integer() | nil, + :evChargeOptions => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptions.t() | nil, + :displayName => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil, + :curbsidePickup => boolean() | nil, + :servesWine => boolean() | nil, + :googleMapsUri => String.t() | nil, + :addressComponents => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAddressComponent.t()) | nil, + :primaryType => String.t() | nil, + :internationalPhoneNumber => String.t() | nil, + :servesDessert => boolean() | nil, + :servesBreakfast => boolean() | nil, + :websiteUri => String.t() | nil, + :regularSecondaryOpeningHours => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t()) | nil, + :formattedAddress => String.t() | nil, + :nationalPhoneNumber => String.t() | nil, + :name => String.t() | nil, + :primaryTypeDisplayName => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil, + :servesBrunch => boolean() | nil, + :goodForGroups => boolean() | nil, + :location => GoogleApi.Places.V1.Model.GoogleTypeLatLng.t() | nil, + :servesCocktails => boolean() | nil, + :currentSecondaryOpeningHours => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t()) | nil, + :goodForWatchingSports => boolean() | nil, + :dineIn => boolean() | nil, + :liveMusic => boolean() | nil, + :businessStatus => String.t() | nil, + :parkingOptions => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions.t() | nil, + :servesVegetarianFood => boolean() | nil, + :iconMaskBaseUri => String.t() | nil, + :reservable => boolean() | nil, + :fuelOptions => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptions.t() | nil, + :delivery => boolean() | nil, + :servesCoffee => boolean() | nil, + :types => list(String.t()) | nil, + :menuForChildren => boolean() | nil, + :regularOpeningHours => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t() | nil, + :allowsDogs => boolean() | nil, + :adrFormatAddress => String.t() | nil, + :attributions => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAttribution.t()) | nil, + :id => String.t() | nil, + :accessibilityOptions => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAccessibilityOptions.t() | nil, + :photos => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo.t()) | nil, + :rating => float() | nil, + :subDestinations => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceSubDestination.t()) | nil, + :goodForChildren => boolean() | nil, + :utcOffsetMinutes => integer() | nil, + :outdoorSeating => boolean() | nil, + :editorialSummary => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil, + :paymentOptions => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePaymentOptions.t() | nil, + :servesBeer => boolean() | nil, + :currentOpeningHours => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.t() | nil, + :viewport => GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t() | nil, + :plusCode => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePlusCode.t() | nil, + :iconBackgroundColor => String.t() | nil, + :servesDinner => boolean() | nil, + :servesLunch => boolean() | nil + } + + field(:restroom) + field(:shortFormattedAddress) + field(:reviews, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review, type: :list) + field(:priceLevel) + field(:takeout) + field(:userRatingCount) + field(:evChargeOptions, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1EVChargeOptions) + field(:displayName, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText) + field(:curbsidePickup) + field(:servesWine) + field(:googleMapsUri) + + field(:addressComponents, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAddressComponent, + type: :list + ) + + field(:primaryType) + field(:internationalPhoneNumber) + field(:servesDessert) + field(:servesBreakfast) + field(:websiteUri) + + field(:regularSecondaryOpeningHours, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours, + type: :list + ) + + field(:formattedAddress) + field(:nationalPhoneNumber) + field(:name) + field(:primaryTypeDisplayName, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText) + field(:servesBrunch) + field(:goodForGroups) + field(:location, as: GoogleApi.Places.V1.Model.GoogleTypeLatLng) + field(:servesCocktails) + + field(:currentSecondaryOpeningHours, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours, + type: :list + ) + + field(:goodForWatchingSports) + field(:dineIn) + field(:liveMusic) + field(:businessStatus) + field(:parkingOptions, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions) + field(:servesVegetarianFood) + field(:iconMaskBaseUri) + field(:reservable) + field(:fuelOptions, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1FuelOptions) + field(:delivery) + field(:servesCoffee) + field(:types, type: :list) + field(:menuForChildren) + field(:regularOpeningHours, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours) + field(:allowsDogs) + field(:adrFormatAddress) + + field(:attributions, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAttribution, + type: :list + ) + + field(:id) + + field(:accessibilityOptions, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAccessibilityOptions + ) + + field(:photos, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo, type: :list) + field(:rating) + + field(:subDestinations, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceSubDestination, + type: :list + ) + + field(:goodForChildren) + field(:utcOffsetMinutes) + field(:outdoorSeating) + field(:editorialSummary, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText) + field(:paymentOptions, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePaymentOptions) + field(:servesBeer) + field(:currentOpeningHours, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours) + field(:viewport, as: GoogleApi.Places.V1.Model.GoogleGeoTypeViewport) + field(:plusCode, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePlusCode) + field(:iconBackgroundColor) + field(:servesDinner) + field(:servesLunch) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_accessibility_options.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_accessibility_options.ex new file mode 100644 index 0000000000..1cf9c255b8 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_accessibility_options.ex @@ -0,0 +1,55 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAccessibilityOptions do + @moduledoc """ + Information about the accessibility options a place offers. + + ## Attributes + + * `wheelchairAccessibleEntrance` (*type:* `boolean()`, *default:* `nil`) - Places has wheelchair accessible entrance. + * `wheelchairAccessibleParking` (*type:* `boolean()`, *default:* `nil`) - Place offers wheelchair accessible parking. + * `wheelchairAccessibleRestroom` (*type:* `boolean()`, *default:* `nil`) - Place has wheelchair accessible restroom. + * `wheelchairAccessibleSeating` (*type:* `boolean()`, *default:* `nil`) - Place has wheelchair accessible seating. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :wheelchairAccessibleEntrance => boolean() | nil, + :wheelchairAccessibleParking => boolean() | nil, + :wheelchairAccessibleRestroom => boolean() | nil, + :wheelchairAccessibleSeating => boolean() | nil + } + + field(:wheelchairAccessibleEntrance) + field(:wheelchairAccessibleParking) + field(:wheelchairAccessibleRestroom) + field(:wheelchairAccessibleSeating) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAccessibilityOptions do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAccessibilityOptions.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAccessibilityOptions do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_address_component.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_address_component.ex new file mode 100644 index 0000000000..7a8838fe72 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_address_component.ex @@ -0,0 +1,55 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAddressComponent do + @moduledoc """ + The structured components that form the formatted address, if this information is available. + + ## Attributes + + * `languageCode` (*type:* `String.t`, *default:* `nil`) - The language used to format this components, in CLDR notation. + * `longText` (*type:* `String.t`, *default:* `nil`) - The full text description or name of the address component. For example, an address component for the country Australia may have a long_name of "Australia". + * `shortText` (*type:* `String.t`, *default:* `nil`) - An abbreviated textual name for the address component, if available. For example, an address component for the country of Australia may have a short_name of "AU". + * `types` (*type:* `list(String.t)`, *default:* `nil`) - An array indicating the type(s) of the address component. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :languageCode => String.t() | nil, + :longText => String.t() | nil, + :shortText => String.t() | nil, + :types => list(String.t()) | nil + } + + field(:languageCode) + field(:longText) + field(:shortText) + field(:types, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAddressComponent do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAddressComponent.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAddressComponent do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_attribution.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_attribution.ex new file mode 100644 index 0000000000..8531450b3f --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_attribution.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAttribution do + @moduledoc """ + Information about data providers of this place. + + ## Attributes + + * `provider` (*type:* `String.t`, *default:* `nil`) - Name of the Place's data provider. + * `providerUri` (*type:* `String.t`, *default:* `nil`) - URI to the Place's data provider. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :provider => String.t() | nil, + :providerUri => String.t() | nil + } + + field(:provider) + field(:providerUri) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAttribution do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAttribution.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAttribution do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours.ex new file mode 100644 index 0000000000..be3e51e192 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours.ex @@ -0,0 +1,71 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours do + @moduledoc """ + Information about business hour of the place. + + ## Attributes + + * `openNow` (*type:* `boolean()`, *default:* `nil`) - Is this place open right now? Always present unless we lack time-of-day or timezone data for these opening hours. + * `periods` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriod.t)`, *default:* `nil`) - The periods that this place is open during the week. The periods are in chronological order, starting with Sunday in the place-local timezone. An empty (but not absent) value indicates a place that is never open, e.g. because it is closed temporarily for renovations. + * `secondaryHoursType` (*type:* `String.t`, *default:* `nil`) - A type string used to identify the type of secondary hours. + * `specialDays` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay.t)`, *default:* `nil`) - Structured information for special days that fall within the period that the returned opening hours cover. Special days are days that could impact the business hours of a place, e.g. Christmas day. Set for current_opening_hours and current_secondary_opening_hours if there are exceptional hours. + * `weekdayDescriptions` (*type:* `list(String.t)`, *default:* `nil`) - Localized strings describing the opening hours of this place, one string for each day of the week. Will be empty if the hours are unknown or could not be converted to localized text. Example: "Sun: 18:00–06:00" + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :openNow => boolean() | nil, + :periods => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriod.t()) | nil, + :secondaryHoursType => String.t() | nil, + :specialDays => + list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay.t()) + | nil, + :weekdayDescriptions => list(String.t()) | nil + } + + field(:openNow) + + field(:periods, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriod, + type: :list + ) + + field(:secondaryHoursType) + + field(:specialDays, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay, + type: :list + ) + + field(:weekdayDescriptions, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHours do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period.ex new file mode 100644 index 0000000000..bb345d177f --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period.ex @@ -0,0 +1,51 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriod do + @moduledoc """ + A period the place remains in open_now status. + + ## Attributes + + * `close` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint.t`, *default:* `nil`) - The time that the place starts to be closed. + * `open` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint.t`, *default:* `nil`) - The time that the place starts to be open. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :close => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint.t() | nil, + :open => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint.t() | nil + } + + field(:close, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint) + field(:open, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriod do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriod.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriod do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period_point.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period_point.ex new file mode 100644 index 0000000000..c2215e3537 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_period_point.ex @@ -0,0 +1,63 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint do + @moduledoc """ + Status changing points. + + ## Attributes + + * `date` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - Date in the local timezone for the place. + * `day` (*type:* `integer()`, *default:* `nil`) - A day of the week, as an integer in the range 0-6. 0 is Sunday, 1 is Monday, etc. + * `hour` (*type:* `integer()`, *default:* `nil`) - The hour in 2 digits. Ranges from 00 to 23. + * `minute` (*type:* `integer()`, *default:* `nil`) - The minute in 2 digits. Ranges from 00 to 59. + * `truncated` (*type:* `boolean()`, *default:* `nil`) - Whether or not this endpoint was truncated. Truncation occurs when the real hours are outside the times we are willing to return hours between, so we truncate the hours back to these boundaries. This ensures that at most 24 * 7 hours from midnight of the day of the request are returned. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :date => GoogleApi.Places.V1.Model.GoogleTypeDate.t() | nil, + :day => integer() | nil, + :hour => integer() | nil, + :minute => integer() | nil, + :truncated => boolean() | nil + } + + field(:date, as: GoogleApi.Places.V1.Model.GoogleTypeDate) + field(:day) + field(:hour) + field(:minute) + field(:truncated) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_special_day.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_special_day.ex new file mode 100644 index 0000000000..1fa224c7ff --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_opening_hours_special_day.ex @@ -0,0 +1,48 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay do + @moduledoc """ + Structured information for special days that fall within the period that the returned opening hours cover. Special days are days that could impact the business hours of a place, e.g. Christmas day. + + ## Attributes + + * `date` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - The date of this special day. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :date => GoogleApi.Places.V1.Model.GoogleTypeDate.t() | nil + } + + field(:date, as: GoogleApi.Places.V1.Model.GoogleTypeDate) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay.decode(value, options) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_parking_options.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_parking_options.ex new file mode 100644 index 0000000000..156db6c575 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_parking_options.ex @@ -0,0 +1,64 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions do + @moduledoc """ + Information about parking options for the place. A parking lot could support more than one option at the same time. + + ## Attributes + + * `freeGarageParking` (*type:* `boolean()`, *default:* `nil`) - Place offers free garage parking. + * `freeParkingLot` (*type:* `boolean()`, *default:* `nil`) - Place offers free parking lots. + * `freeStreetParking` (*type:* `boolean()`, *default:* `nil`) - Place offers free street parking. + * `paidGarageParking` (*type:* `boolean()`, *default:* `nil`) - Place offers paid garage parking. + * `paidParkingLot` (*type:* `boolean()`, *default:* `nil`) - Place offers paid parking lots. + * `paidStreetParking` (*type:* `boolean()`, *default:* `nil`) - Place offers paid street parking. + * `valetParking` (*type:* `boolean()`, *default:* `nil`) - Place offers valet parking. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :freeGarageParking => boolean() | nil, + :freeParkingLot => boolean() | nil, + :freeStreetParking => boolean() | nil, + :paidGarageParking => boolean() | nil, + :paidParkingLot => boolean() | nil, + :paidStreetParking => boolean() | nil, + :valetParking => boolean() | nil + } + + field(:freeGarageParking) + field(:freeParkingLot) + field(:freeStreetParking) + field(:paidGarageParking) + field(:paidParkingLot) + field(:paidStreetParking) + field(:valetParking) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_payment_options.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_payment_options.ex new file mode 100644 index 0000000000..e2dceb665d --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_payment_options.ex @@ -0,0 +1,55 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePaymentOptions do + @moduledoc """ + Payment options the place accepts. + + ## Attributes + + * `acceptsCashOnly` (*type:* `boolean()`, *default:* `nil`) - Place accepts cash only as payment. Places with this attribute may still accept other payment methods. + * `acceptsCreditCards` (*type:* `boolean()`, *default:* `nil`) - Place accepts credit cards as payment. + * `acceptsDebitCards` (*type:* `boolean()`, *default:* `nil`) - Place accepts debit cards as payment. + * `acceptsNfc` (*type:* `boolean()`, *default:* `nil`) - Place accepts NFC payments. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :acceptsCashOnly => boolean() | nil, + :acceptsCreditCards => boolean() | nil, + :acceptsDebitCards => boolean() | nil, + :acceptsNfc => boolean() | nil + } + + field(:acceptsCashOnly) + field(:acceptsCreditCards) + field(:acceptsDebitCards) + field(:acceptsNfc) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePaymentOptions do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePaymentOptions.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePaymentOptions do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_plus_code.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_plus_code.ex new file mode 100644 index 0000000000..cb0678f959 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_plus_code.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePlusCode do + @moduledoc """ + Plus code (http://plus.codes) is a location reference with two formats: global code defining a 14mx14m (1/8000th of a degree) or smaller rectangle, and compound code, replacing the prefix with a reference location. + + ## Attributes + + * `compoundCode` (*type:* `String.t`, *default:* `nil`) - Place's compound code, such as "33GV+HQ, Ramberg, Norway", containing the suffix of the global code and replacing the prefix with a formatted name of a reference entity. + * `globalCode` (*type:* `String.t`, *default:* `nil`) - Place's global (full) code, such as "9FWM33GV+HQ", representing an 1/8000 by 1/8000 degree area (~14 by 14 meters). + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :compoundCode => String.t() | nil, + :globalCode => String.t() | nil + } + + field(:compoundCode) + field(:globalCode) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePlusCode do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePlusCode.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlacePlusCode do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_sub_destination.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_sub_destination.ex new file mode 100644 index 0000000000..2a167b7cc3 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_place_sub_destination.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceSubDestination do + @moduledoc """ + Place resource name and id of sub destinations that relate to the place. For example, different terminals are different destinations of an airport. + + ## Attributes + + * `id` (*type:* `String.t`, *default:* `nil`) - The place id of the sub destination. + * `name` (*type:* `String.t`, *default:* `nil`) - The resource name of the sub destination. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :id => String.t() | nil, + :name => String.t() | nil + } + + field(:id) + field(:name) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceSubDestination do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceSubDestination.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceSubDestination do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_review.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_review.ex new file mode 100644 index 0000000000..91d5c5cbd9 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_review.ex @@ -0,0 +1,65 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review do + @moduledoc """ + Information about a review of a place. + + ## Attributes + + * `authorAttribution` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t`, *default:* `nil`) - This review's author. + * `name` (*type:* `String.t`, *default:* `nil`) - A reference representing this place review which may be used to look up this place review again (also called the API "resource" name: `places/{place_id}/reviews/{review}`). + * `originalText` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - The review text in its original language. + * `publishTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp for the review. + * `rating` (*type:* `float()`, *default:* `nil`) - A number between 1.0 and 5.0, also called the number of stars. + * `relativePublishTimeDescription` (*type:* `String.t`, *default:* `nil`) - A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. + * `text` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - The localized text of the review. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :authorAttribution => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t() | nil, + :name => String.t() | nil, + :originalText => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil, + :publishTime => DateTime.t() | nil, + :rating => float() | nil, + :relativePublishTimeDescription => String.t() | nil, + :text => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil + } + + field(:authorAttribution, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution) + field(:name) + field(:originalText, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText) + field(:publishTime, as: DateTime) + field(:rating) + field(:relativePublishTimeDescription) + field(:text, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request.ex new file mode 100644 index 0000000000..84814a0090 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request.ex @@ -0,0 +1,76 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest do + @moduledoc """ + Request proto for Search Nearby. + + ## Attributes + + * `excludedPrimaryTypes` (*type:* `list(String.t)`, *default:* `nil`) - Excluded primary Place type (e.g. "restaurant" or "gas_station") from https://developers.google.com/maps/documentation/places/web-service/place-types. Up to 50 types from [Table A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) may be specified. If there are any conflicting primary types, i.e. a type appears in both included_primary_types and excluded_primary_types, an INVALID_ARGUMENT error is returned. If a Place type is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. For example, if we have {included_types = ["restaurant"], excluded_primary_types = ["restaurant"]}, the returned places provide "restaurant" related services but do not operate primarily as "restaurants". + * `excludedTypes` (*type:* `list(String.t)`, *default:* `nil`) - Excluded Place type (eg, "restaurant" or "gas_station") from https://developers.google.com/maps/documentation/places/web-service/place-types. Up to 50 types from [Table A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) may be specified. If the client provides both included_types (e.g. restaurant) and excluded_types (e.g. cafe), then the response should include places that are restaurant but not cafe. The response includes places that match at least one of the included_types and none of the excluded_types. If there are any conflicting types, i.e. a type appears in both included_types and excluded_types, an INVALID_ARGUMENT error is returned. If a Place type is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. For example, if we have {included_types = ["restaurant"], excluded_primary_types = ["restaurant"]}, the returned places provide "restaurant" related services but do not operate primarily as "restaurants". + * `includedPrimaryTypes` (*type:* `list(String.t)`, *default:* `nil`) - Included primary Place type (e.g. "restaurant" or "gas_station") from https://developers.google.com/maps/documentation/places/web-service/place-types. A place can only have a single primary type from the supported types table associated with it. Up to 50 types from [Table A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) may be specified. If there are any conflicting primary types, i.e. a type appears in both included_primary_types and excluded_primary_types, an INVALID_ARGUMENT error is returned. If a Place type is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. For example, if we have {included_types = ["restaurant"], excluded_primary_types = ["restaurant"]}, the returned places provide "restaurant" related services but do not operate primarily as "restaurants". + * `includedTypes` (*type:* `list(String.t)`, *default:* `nil`) - Included Place type (eg, "restaurant" or "gas_station") from https://developers.google.com/maps/documentation/places/web-service/place-types. Up to 50 types from [Table A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) may be specified. If there are any conflicting types, i.e. a type appears in both included_types and excluded_types, an INVALID_ARGUMENT error is returned. If a Place type is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. For example, if we have {included_types = ["restaurant"], excluded_primary_types = ["restaurant"]}, the returned places provide "restaurant" related services but do not operate primarily as "restaurants". + * `languageCode` (*type:* `String.t`, *default:* `nil`) - Place details will be displayed with the preferred language if available. If the language code is unspecified or unrecognized, place details of any language may be returned, with a preference for English if such details exist. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. + * `locationRestriction` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction.t`, *default:* `nil`) - Required. The region to search. + * `maxResultCount` (*type:* `integer()`, *default:* `nil`) - Maximum number of results to return. It must be between 1 and 20 (default), inclusively. If the number is unset, it falls back to the upper limit. If the number is set to negative or exceeds the upper limit, an INVALID_ARGUMENT error is returned. + * `rankPreference` (*type:* `String.t`, *default:* `nil`) - How results will be ranked in the response. + * `regionCode` (*type:* `String.t`, *default:* `nil`) - The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :excludedPrimaryTypes => list(String.t()) | nil, + :excludedTypes => list(String.t()) | nil, + :includedPrimaryTypes => list(String.t()) | nil, + :includedTypes => list(String.t()) | nil, + :languageCode => String.t() | nil, + :locationRestriction => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction.t() + | nil, + :maxResultCount => integer() | nil, + :rankPreference => String.t() | nil, + :regionCode => String.t() | nil + } + + field(:excludedPrimaryTypes, type: :list) + field(:excludedTypes, type: :list) + field(:includedPrimaryTypes, type: :list) + field(:includedTypes, type: :list) + field(:languageCode) + + field(:locationRestriction, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction + ) + + field(:maxResultCount) + field(:rankPreference) + field(:regionCode) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request_location_restriction.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request_location_restriction.ex new file mode 100644 index 0000000000..7034ed2c85 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request_location_restriction.ex @@ -0,0 +1,51 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction do + @moduledoc """ + The region to search. + + ## Attributes + + * `circle` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t`, *default:* `nil`) - A circle defined by center point and radius. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :circle => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t() | nil + } + + field(:circle, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_response.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_response.ex new file mode 100644 index 0000000000..e5ea3769ed --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_response.ex @@ -0,0 +1,46 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse do + @moduledoc """ + Response proto for Search Nearby. + + ## Attributes + + * `places` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t)`, *default:* `nil`) - A list of places that meets user's requirements like places types, number of places and specific location restriction. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :places => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t()) | nil + } + + field(:places, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request.ex new file mode 100644 index 0000000000..b091d872e7 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request.ex @@ -0,0 +1,93 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest do + @moduledoc """ + Request proto for SearchText. + + ## Attributes + + * `evOptions` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestEVOptions.t`, *default:* `nil`) - Optional. Set the searchable EV options of a place search request. + * `includedType` (*type:* `String.t`, *default:* `nil`) - The requested place type. Full list of types supported: https://developers.google.com/maps/documentation/places/web-service/place-types. Only support one included type. + * `languageCode` (*type:* `String.t`, *default:* `nil`) - Place details will be displayed with the preferred language if available. If the language code is unspecified or unrecognized, place details of any language may be returned, with a preference for English if such details exist. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. + * `locationBias` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationBias.t`, *default:* `nil`) - The region to search. This location serves as a bias which means results around given location might be returned. Cannot be set along with location_restriction. + * `locationRestriction` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationRestriction.t`, *default:* `nil`) - The region to search. This location serves as a restriction which means results outside given location will not be returned. Cannot be set along with location_bias. + * `maxResultCount` (*type:* `integer()`, *default:* `nil`) - Maximum number of results to return. It must be between 1 and 20, inclusively. The default is 20. If the number is unset, it falls back to the upper limit. If the number is set to negative or exceeds the upper limit, an INVALID_ARGUMENT error is returned. + * `minRating` (*type:* `float()`, *default:* `nil`) - Filter out results whose average user rating is strictly less than this limit. A valid value must be a float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating will round up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all results with a less than 1.0 rating. + * `openNow` (*type:* `boolean()`, *default:* `nil`) - Used to restrict the search to places that are currently open. The default is false. + * `priceLevels` (*type:* `list(String.t)`, *default:* `nil`) - Used to restrict the search to places that are marked as certain price levels. Users can choose any combinations of price levels. Default to select all price levels. + * `rankPreference` (*type:* `String.t`, *default:* `nil`) - How results will be ranked in the response. + * `regionCode` (*type:* `String.t`, *default:* `nil`) - The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. + * `strictTypeFiltering` (*type:* `boolean()`, *default:* `nil`) - Used to set strict type filtering for included_type. If set to true, only results of the same type will be returned. Default to false. + * `textQuery` (*type:* `String.t`, *default:* `nil`) - Required. The text query for textual search. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :evOptions => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestEVOptions.t() | nil, + :includedType => String.t() | nil, + :languageCode => String.t() | nil, + :locationBias => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationBias.t() | nil, + :locationRestriction => + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationRestriction.t() + | nil, + :maxResultCount => integer() | nil, + :minRating => float() | nil, + :openNow => boolean() | nil, + :priceLevels => list(String.t()) | nil, + :rankPreference => String.t() | nil, + :regionCode => String.t() | nil, + :strictTypeFiltering => boolean() | nil, + :textQuery => String.t() | nil + } + + field(:evOptions, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestEVOptions) + field(:includedType) + field(:languageCode) + + field(:locationBias, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationBias + ) + + field(:locationRestriction, + as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationRestriction + ) + + field(:maxResultCount) + field(:minRating) + field(:openNow) + field(:priceLevels, type: :list) + field(:rankPreference) + field(:regionCode) + field(:strictTypeFiltering) + field(:textQuery) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_ev_options.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_ev_options.ex new file mode 100644 index 0000000000..08d7726c32 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_ev_options.ex @@ -0,0 +1,51 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestEVOptions do + @moduledoc """ + Searchable EV options of a place search request. + + ## Attributes + + * `connectorTypes` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The list of preferred EV connector types. A place that does not support any of the listed connector types are filter out. + * `minimumChargingRateKw` (*type:* `float()`, *default:* `nil`) - Optional. Filtering places by minimum charging rate. Any places with charging a rate less than the minimum charging rate are filtered out. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :connectorTypes => list(String.t()) | nil, + :minimumChargingRateKw => float() | nil + } + + field(:connectorTypes, type: :list) + field(:minimumChargingRateKw) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestEVOptions do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestEVOptions.decode(value, options) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestEVOptions do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_bias.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_bias.ex new file mode 100644 index 0000000000..c7417376d9 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_bias.ex @@ -0,0 +1,54 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationBias do + @moduledoc """ + The region to search. This location serves as a bias which means results around given location might be returned. + + ## Attributes + + * `circle` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t`, *default:* `nil`) - A circle defined by center point and radius. + * `rectangle` (*type:* `GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t`, *default:* `nil`) - A rectangle box defined by northeast and southwest corner. `rectangle.high()` must be the northeast point of the rectangle viewport. `rectangle.low()` must be the southwest point of the rectangle viewport. `rectangle.low().latitude()` cannot be greater than `rectangle.high().latitude()`. This will result in an empty latitude range. A rectangle viewport cannot be wider than 180 degrees. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :circle => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle.t() | nil, + :rectangle => GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t() | nil + } + + field(:circle, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Circle) + field(:rectangle, as: GoogleApi.Places.V1.Model.GoogleGeoTypeViewport) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationBias do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationBias.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationBias do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_restriction.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_restriction.ex new file mode 100644 index 0000000000..5ec72059d2 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request_location_restriction.ex @@ -0,0 +1,51 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationRestriction do + @moduledoc """ + The region to search. This location serves as a restriction which means results outside given location will not be returned. + + ## Attributes + + * `rectangle` (*type:* `GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t`, *default:* `nil`) - A rectangle box defined by northeast and southwest corner. `rectangle.high()` must be the northeast point of the rectangle viewport. `rectangle.low()` must be the southwest point of the rectangle viewport. `rectangle.low().latitude()` cannot be greater than `rectangle.high().latitude()`. This will result in an empty latitude range. A rectangle viewport cannot be wider than 180 degrees. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :rectangle => GoogleApi.Places.V1.Model.GoogleGeoTypeViewport.t() | nil + } + + field(:rectangle, as: GoogleApi.Places.V1.Model.GoogleGeoTypeViewport) +end + +defimpl Poison.Decoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationRestriction do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationRestriction.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestLocationRestriction do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_response.ex b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_response.ex new file mode 100644 index 0000000000..bc264e8031 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_response.ex @@ -0,0 +1,46 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do + @moduledoc """ + Response proto for SearchText. + + ## Attributes + + * `places` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t)`, *default:* `nil`) - A list of places that meet the user's text search criteria. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :places => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t()) | nil + } + + field(:places, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_type_date.ex b/clients/places/lib/google_api/places/v1/model/google_type_date.ex new file mode 100644 index 0000000000..e4c5903dab --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_type_date.ex @@ -0,0 +1,52 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleTypeDate do + @moduledoc """ + Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp + + ## Attributes + + * `day` (*type:* `integer()`, *default:* `nil`) - Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. + * `month` (*type:* `integer()`, *default:* `nil`) - Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. + * `year` (*type:* `integer()`, *default:* `nil`) - Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :day => integer() | nil, + :month => integer() | nil, + :year => integer() | nil + } + + field(:day) + field(:month) + field(:year) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleTypeDate do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleTypeDate.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleTypeDate do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_type_lat_lng.ex b/clients/places/lib/google_api/places/v1/model/google_type_lat_lng.ex new file mode 100644 index 0000000000..0c4706d129 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_type_lat_lng.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleTypeLatLng do + @moduledoc """ + An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. + + ## Attributes + + * `latitude` (*type:* `float()`, *default:* `nil`) - The latitude in degrees. It must be in the range [-90.0, +90.0]. + * `longitude` (*type:* `float()`, *default:* `nil`) - The longitude in degrees. It must be in the range [-180.0, +180.0]. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :latitude => float() | nil, + :longitude => float() | nil + } + + field(:latitude) + field(:longitude) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleTypeLatLng do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleTypeLatLng.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleTypeLatLng do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_type_localized_text.ex b/clients/places/lib/google_api/places/v1/model/google_type_localized_text.ex new file mode 100644 index 0000000000..33721a4cc0 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_type_localized_text.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleTypeLocalizedText do + @moduledoc """ + Localized variant of a text in a particular language. + + ## Attributes + + * `languageCode` (*type:* `String.t`, *default:* `nil`) - The text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * `text` (*type:* `String.t`, *default:* `nil`) - Localized string in the language corresponding to language_code below. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :languageCode => String.t() | nil, + :text => String.t() | nil + } + + field(:languageCode) + field(:text) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/lib/google_api/places/v1/model/google_type_money.ex b/clients/places/lib/google_api/places/v1/model/google_type_money.ex new file mode 100644 index 0000000000..97e63c5759 --- /dev/null +++ b/clients/places/lib/google_api/places/v1/model/google_type_money.ex @@ -0,0 +1,52 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.V1.Model.GoogleTypeMoney do + @moduledoc """ + Represents an amount of money with its currency type. + + ## Attributes + + * `currencyCode` (*type:* `String.t`, *default:* `nil`) - The three-letter currency code defined in ISO 4217. + * `nanos` (*type:* `integer()`, *default:* `nil`) - Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + * `units` (*type:* `String.t`, *default:* `nil`) - The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :currencyCode => String.t() | nil, + :nanos => integer() | nil, + :units => String.t() | nil + } + + field(:currencyCode) + field(:nanos) + field(:units) +end + +defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleTypeMoney do + def decode(value, options) do + GoogleApi.Places.V1.Model.GoogleTypeMoney.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleTypeMoney do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/places/mix.exs b/clients/places/mix.exs new file mode 100644 index 0000000000..96e858318c --- /dev/null +++ b/clients/places/mix.exs @@ -0,0 +1,66 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Places.Mixfile do + use Mix.Project + + @version "0.2.0" + + def project() do + [ + app: :google_api_places, + version: @version, + elixir: "~> 1.6", + build_embedded: Mix.env == :prod, + start_permanent: Mix.env == :prod, + description: description(), + package: package(), + deps: deps(), + source_url: "https://github.com/googleapis/elixir-google-api/tree/master/clients/places" + ] + end + + def application() do + [extra_applications: [:logger]] + end + + defp deps() do + [ + {:google_gax, "~> 0.4"}, + + {:ex_doc, "~> 0.16", only: :dev} + ] + end + + defp description() do + """ + Places API (New) client library. + """ + end + + defp package() do + [ + files: ["lib", "mix.exs", "README*", "LICENSE"], + maintainers: ["Jeff Ching", "Daniel Azuma"], + licenses: ["Apache 2.0"], + links: %{ + "GitHub" => "https://github.com/googleapis/elixir-google-api/tree/master/clients/places", + "Homepage" => "https://mapsplatform.google.com/maps-products/#places-section" + } + ] + end +end diff --git a/clients/places/test/test_helper.exs b/clients/places/test/test_helper.exs new file mode 100644 index 0000000000..10f90e6fa7 --- /dev/null +++ b/clients/places/test/test_helper.exs @@ -0,0 +1,35 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +ExUnit.start() + +defmodule GoogleApi.Places.TestHelper do + + defmacro __using__(opts) do + quote do + use ExUnit.Case, unquote(opts) + import GoogleApi.Places.TestHelper + end + end + + def for_scope(scopes) when is_list(scopes), do: for_scope(Enum.join(scopes, " ")) + def for_scope(scope) do + {:ok, token} = Goth.Token.for_scope(scope) + token.token + end + +end