diff --git a/clients/vpc_access/.gitignore b/clients/vpc_access/.gitignore new file mode 100644 index 0000000000..6bf4496152 --- /dev/null +++ b/clients/vpc_access/.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/vpc_access/LICENSE b/clients/vpc_access/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/clients/vpc_access/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/vpc_access/README.md b/clients/vpc_access/README.md new file mode 100644 index 0000000000..7a0f7806ff --- /dev/null +++ b/clients/vpc_access/README.md @@ -0,0 +1,23 @@ +# GoogleApi.VPCAccess + +Serverless VPC Access API client library. + +API for managing VPC access connectors. + +## Installation + +Install this package from [Hex](https://hex.pm) by adding +`google_api_vpc_access` to your list of dependencies in `mix.exs`: + +```elixir +def deps do + [{:google_api_vpc_access, "~> 0.2"}] +end +``` + +## For more information + +Product documentation is available at [https://cloud.google.com/vpc/docs/configure-serverless-vpc-access](https://cloud.google.com/vpc/docs/configure-serverless-vpc-access). + +Library reference documentation is published on Hexdocs at +[https://hexdocs.pm/google_api_vpc_access](https://hexdocs.pm/google_api_vpc_access). diff --git a/clients/vpc_access/config/config.exs b/clients/vpc_access/config/config.exs new file mode 100644 index 0000000000..07afe5f311 --- /dev/null +++ b/clients/vpc_access/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/vpc_access/lib/google_api/vpc_access/v1/api/projects.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/api/projects.ex new file mode 100644 index 0000000000..94a8ba4e51 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/api/projects.ex @@ -0,0 +1,662 @@ +# 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.VPCAccess.V1.Api.Projects do + @moduledoc """ + API calls for all endpoints tagged `Projects`. + """ + + alias GoogleApi.VPCAccess.V1.Connection + alias GoogleApi.Gax.{Request, Response} + + @library_version Mix.Project.config() |> Keyword.get(:version, "") + + @doc """ + Lists information about the supported locations for this service. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `name`. The resource that owns the locations collection, if applicable. + * `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"). + * `:filter` (*type:* `String.t`) - A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160). + * `:pageSize` (*type:* `integer()`) - The maximum number of results to return. If not set, the service selects a default. + * `:pageToken` (*type:* `String.t`) - A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.ListLocationsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.VPCAccess.V1.Model.ListLocationsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_list( + connection, + projects_id, + 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, + :filter => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/projects/{projectsId}/locations", %{ + "projectsId" => URI.encode(projects_id, &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.VPCAccess.V1.Model.ListLocationsResponse{}]) + end + + @doc """ + Creates a Serverless VPC Access connector, returns an operation. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `parent`. Required. The project ID and location in which the configuration should be created, specified in the format `projects/*/locations/*`. + * `locations_id` (*type:* `String.t`) - Part of `parent`. See documentation of `projectsId`. + * `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"). + * `:connectorId` (*type:* `String.t`) - Required. The ID to use for this connector. + * `:body` (*type:* `GoogleApi.VPCAccess.V1.Model.Connector.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.Operation{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_connectors_create( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.VPCAccess.V1.Model.Operation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_connectors_create( + connection, + projects_id, + locations_id, + 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, + :connectorId => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/projects/{projectsId}/locations/{locationsId}/connectors", %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &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.VPCAccess.V1.Model.Operation{}]) + end + + @doc """ + Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `name`. Required. Name of a Serverless VPC Access connector to delete. + * `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `connectors_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `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"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.Operation{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_connectors_delete( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.VPCAccess.V1.Model.Operation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_connectors_delete( + connection, + projects_id, + locations_id, + connectors_id, + 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 + } + + request = + Request.new() + |> Request.method(:delete) + |> Request.url( + "/v1/projects/{projectsId}/locations/{locationsId}/connectors/{connectorsId}", + %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &URI.char_unreserved?/1), + "connectorsId" => URI.encode(connectors_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + } + ) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.VPCAccess.V1.Model.Operation{}]) + end + + @doc """ + Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `name`. Required. Name of a Serverless VPC Access connector to get. + * `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `connectors_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `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"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.Connector{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_connectors_get( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.VPCAccess.V1.Model.Connector.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_connectors_get( + connection, + projects_id, + locations_id, + connectors_id, + 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 + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url( + "/v1/projects/{projectsId}/locations/{locationsId}/connectors/{connectorsId}", + %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &URI.char_unreserved?/1), + "connectorsId" => URI.encode(connectors_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + } + ) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.VPCAccess.V1.Model.Connector{}]) + end + + @doc """ + Lists Serverless VPC Access connectors. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `parent`. Required. The project and location from which the routes should be listed. + * `locations_id` (*type:* `String.t`) - Part of `parent`. See documentation of `projectsId`. + * `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"). + * `:pageSize` (*type:* `integer()`) - Maximum number of functions to return per call. + * `:pageToken` (*type:* `String.t`) - Continuation token. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.ListConnectorsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_connectors_list( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.VPCAccess.V1.Model.ListConnectorsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_connectors_list( + connection, + projects_id, + locations_id, + 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, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/projects/{projectsId}/locations/{locationsId}/connectors", %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &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.VPCAccess.V1.Model.ListConnectorsResponse{}]) + end + + @doc """ + Updates a Serverless VPC Access connector, returns an operation. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `connector.name`. The resource name in the format `projects/*/locations/*/connectors/*`. + * `locations_id` (*type:* `String.t`) - Part of `connector.name`. See documentation of `projectsId`. + * `connectors_id` (*type:* `String.t`) - Part of `connector.name`. See documentation of `projectsId`. + * `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"). + * `:updateMask` (*type:* `String.t`) - The fields to update on the entry group. If absent or empty, all modifiable fields are updated. + * `:body` (*type:* `GoogleApi.VPCAccess.V1.Model.Connector.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.Operation{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_connectors_patch( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.VPCAccess.V1.Model.Operation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_connectors_patch( + connection, + projects_id, + locations_id, + connectors_id, + 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, + :updateMask => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:patch) + |> Request.url( + "/v1/projects/{projectsId}/locations/{locationsId}/connectors/{connectorsId}", + %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &URI.char_unreserved?/1), + "connectorsId" => URI.encode(connectors_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + } + ) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.VPCAccess.V1.Model.Operation{}]) + end + + @doc """ + Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `name`. The name of the operation resource. + * `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `operations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `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"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.Operation{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_operations_get( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.VPCAccess.V1.Model.Operation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_operations_get( + connection, + projects_id, + locations_id, + operations_id, + 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 + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url( + "/v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &URI.char_unreserved?/1), + "operationsId" => URI.encode(operations_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + } + ) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.VPCAccess.V1.Model.Operation{}]) + end + + @doc """ + Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. + + ## Parameters + + * `connection` (*type:* `GoogleApi.VPCAccess.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `name`. The name of the operation's parent resource. + * `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `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"). + * `:filter` (*type:* `String.t`) - The standard list filter. + * `:pageSize` (*type:* `integer()`) - The standard list page size. + * `:pageToken` (*type:* `String.t`) - The standard list page token. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.VPCAccess.V1.Model.ListOperationsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec vpcaccess_projects_locations_operations_list( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.VPCAccess.V1.Model.ListOperationsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def vpcaccess_projects_locations_operations_list( + connection, + projects_id, + locations_id, + 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, + :filter => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/projects/{projectsId}/locations/{locationsId}/operations", %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &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.VPCAccess.V1.Model.ListOperationsResponse{}]) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/connection.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/connection.ex new file mode 100644 index 0000000000..32d2660574 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/connection.ex @@ -0,0 +1,32 @@ +# 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.VPCAccess.V1.Connection do + @moduledoc """ + Handle Tesla connections for GoogleApi.VPCAccess.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" + ], + otp_app: :google_api_vpc_access, + base_url: "https://vpcaccess.googleapis.com/" +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/metadata.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/metadata.ex new file mode 100644 index 0000000000..55008e2349 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/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.VPCAccess.V1 do + @moduledoc """ + API client metadata for GoogleApi.VPCAccess.V1. + """ + + @discovery_revision "20240229" + + def discovery_revision(), do: @discovery_revision +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/connector.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/connector.ex new file mode 100644 index 0000000000..21947d9428 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/connector.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.VPCAccess.V1.Model.Connector do + @moduledoc """ + Definition of a Serverless VPC Access connector. + + ## Attributes + + * `connectedProjects` (*type:* `list(String.t)`, *default:* `nil`) - Output only. List of projects using the connector. + * `ipCidrRange` (*type:* `String.t`, *default:* `nil`) - The range of internal addresses that follows RFC 4632 notation. Example: `10.132.0.0/28`. + * `machineType` (*type:* `String.t`, *default:* `nil`) - Machine type of VM Instance underlying connector. Default is e2-micro + * `maxInstances` (*type:* `integer()`, *default:* `nil`) - Maximum value of instances in autoscaling group underlying the connector. + * `maxThroughput` (*type:* `integer()`, *default:* `nil`) - Maximum throughput of the connector in Mbps. Refers to the expected throughput when using an `e2-micro` machine type. Value must be a multiple of 100 from 300 through 1000. Must be higher than the value specified by --min-throughput. If both max-throughput and max-instances are provided, max-instances takes precedence over max-throughput. The use of `max-throughput` is discouraged in favor of `max-instances`. + * `minInstances` (*type:* `integer()`, *default:* `nil`) - Minimum value of instances in autoscaling group underlying the connector. + * `minThroughput` (*type:* `integer()`, *default:* `nil`) - Minimum throughput of the connector in Mbps. Refers to the expected throughput when using an `e2-micro` machine type. Value must be a multiple of 100 from 200 through 900. Must be lower than the value specified by --max-throughput. If both min-throughput and min-instances are provided, min-instances takes precedence over min-throughput. The use of `min-throughput` is discouraged in favor of `min-instances`. + * `name` (*type:* `String.t`, *default:* `nil`) - The resource name in the format `projects/*/locations/*/connectors/*`. + * `network` (*type:* `String.t`, *default:* `nil`) - Name of a VPC network. + * `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the VPC access connector. + * `subnet` (*type:* `GoogleApi.VPCAccess.V1.Model.Subnet.t`, *default:* `nil`) - The subnet in which to house the VPC Access Connector. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :connectedProjects => list(String.t()) | nil, + :ipCidrRange => String.t() | nil, + :machineType => String.t() | nil, + :maxInstances => integer() | nil, + :maxThroughput => integer() | nil, + :minInstances => integer() | nil, + :minThroughput => integer() | nil, + :name => String.t() | nil, + :network => String.t() | nil, + :state => String.t() | nil, + :subnet => GoogleApi.VPCAccess.V1.Model.Subnet.t() | nil + } + + field(:connectedProjects, type: :list) + field(:ipCidrRange) + field(:machineType) + field(:maxInstances) + field(:maxThroughput) + field(:minInstances) + field(:minThroughput) + field(:name) + field(:network) + field(:state) + field(:subnet, as: GoogleApi.VPCAccess.V1.Model.Subnet) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.Connector do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.Connector.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.Connector do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_connectors_response.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_connectors_response.ex new file mode 100644 index 0000000000..2eb0fe5409 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_connectors_response.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.VPCAccess.V1.Model.ListConnectorsResponse do + @moduledoc """ + Response for listing Serverless VPC Access connectors. + + ## Attributes + + * `connectors` (*type:* `list(GoogleApi.VPCAccess.V1.Model.Connector.t)`, *default:* `nil`) - List of Serverless VPC Access connectors. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - Continuation token. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :connectors => list(GoogleApi.VPCAccess.V1.Model.Connector.t()) | nil, + :nextPageToken => String.t() | nil + } + + field(:connectors, as: GoogleApi.VPCAccess.V1.Model.Connector, type: :list) + field(:nextPageToken) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.ListConnectorsResponse do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.ListConnectorsResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.ListConnectorsResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_locations_response.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_locations_response.ex new file mode 100644 index 0000000000..fe2153be97 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_locations_response.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.VPCAccess.V1.Model.ListLocationsResponse do + @moduledoc """ + The response message for Locations.ListLocations. + + ## Attributes + + * `locations` (*type:* `list(GoogleApi.VPCAccess.V1.Model.Location.t)`, *default:* `nil`) - A list of locations that matches the specified filter in the request. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The standard List next-page token. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :locations => list(GoogleApi.VPCAccess.V1.Model.Location.t()) | nil, + :nextPageToken => String.t() | nil + } + + field(:locations, as: GoogleApi.VPCAccess.V1.Model.Location, type: :list) + field(:nextPageToken) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.ListLocationsResponse do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.ListLocationsResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.ListLocationsResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_operations_response.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_operations_response.ex new file mode 100644 index 0000000000..ff58b9f58c --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/list_operations_response.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.VPCAccess.V1.Model.ListOperationsResponse do + @moduledoc """ + The response message for Operations.ListOperations. + + ## Attributes + + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The standard List next-page token. + * `operations` (*type:* `list(GoogleApi.VPCAccess.V1.Model.Operation.t)`, *default:* `nil`) - A list of operations that matches the specified filter in the request. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :nextPageToken => String.t() | nil, + :operations => list(GoogleApi.VPCAccess.V1.Model.Operation.t()) | nil + } + + field(:nextPageToken) + field(:operations, as: GoogleApi.VPCAccess.V1.Model.Operation, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.ListOperationsResponse do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.ListOperationsResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.ListOperationsResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/location.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/location.ex new file mode 100644 index 0000000000..a1bcefd06a --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/location.ex @@ -0,0 +1,58 @@ +# 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.VPCAccess.V1.Model.Location do + @moduledoc """ + A resource that represents a Google Cloud location. + + ## Attributes + + * `displayName` (*type:* `String.t`, *default:* `nil`) - The friendly name for this location, typically a nearby city name. For example, "Tokyo". + * `labels` (*type:* `map()`, *default:* `nil`) - Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} + * `locationId` (*type:* `String.t`, *default:* `nil`) - The canonical id for this location. For example: `"us-east1"`. + * `metadata` (*type:* `map()`, *default:* `nil`) - Service-specific metadata. For example the available capacity at the given location. + * `name` (*type:* `String.t`, *default:* `nil`) - Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :displayName => String.t() | nil, + :labels => map() | nil, + :locationId => String.t() | nil, + :metadata => map() | nil, + :name => String.t() | nil + } + + field(:displayName) + field(:labels, type: :map) + field(:locationId) + field(:metadata, type: :map) + field(:name) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.Location do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.Location.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.Location do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation.ex new file mode 100644 index 0000000000..d5e4e8dded --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation.ex @@ -0,0 +1,58 @@ +# 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.VPCAccess.V1.Model.Operation do + @moduledoc """ + This resource represents a long-running operation that is the result of a network API call. + + ## Attributes + + * `done` (*type:* `boolean()`, *default:* `nil`) - If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. + * `error` (*type:* `GoogleApi.VPCAccess.V1.Model.Status.t`, *default:* `nil`) - The error result of the operation in case of failure or cancellation. + * `metadata` (*type:* `map()`, *default:* `nil`) - Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + * `name` (*type:* `String.t`, *default:* `nil`) - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. + * `response` (*type:* `map()`, *default:* `nil`) - The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :done => boolean() | nil, + :error => GoogleApi.VPCAccess.V1.Model.Status.t() | nil, + :metadata => map() | nil, + :name => String.t() | nil, + :response => map() | nil + } + + field(:done) + field(:error, as: GoogleApi.VPCAccess.V1.Model.Status) + field(:metadata, type: :map) + field(:name) + field(:response, type: :map) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.Operation do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.Operation.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.Operation do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata.ex new file mode 100644 index 0000000000..91d61550af --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata.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.VPCAccess.V1.Model.OperationMetadata do + @moduledoc """ + Metadata for google.longrunning.Operation. + + ## Attributes + + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the operation was created. + * `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the operation completed. + * `method` (*type:* `String.t`, *default:* `nil`) - Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1.Connectors.CreateConnector. + * `target` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :createTime => DateTime.t() | nil, + :endTime => DateTime.t() | nil, + :method => String.t() | nil, + :target => String.t() | nil + } + + field(:createTime, as: DateTime) + field(:endTime, as: DateTime) + field(:method) + field(:target) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.OperationMetadata do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.OperationMetadata.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.OperationMetadata do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata_v1_alpha1.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata_v1_alpha1.ex new file mode 100644 index 0000000000..3a4488469a --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata_v1_alpha1.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.VPCAccess.V1.Model.OperationMetadataV1Alpha1 do + @moduledoc """ + Metadata for google.longrunning.Operation. + + ## Attributes + + * `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the operation completed. + * `insertTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the operation was created. + * `method` (*type:* `String.t`, *default:* `nil`) - Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1alpha1.Connectors.CreateConnector. + * `target` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :endTime => DateTime.t() | nil, + :insertTime => DateTime.t() | nil, + :method => String.t() | nil, + :target => String.t() | nil + } + + field(:endTime, as: DateTime) + field(:insertTime, as: DateTime) + field(:method) + field(:target) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.OperationMetadataV1Alpha1 do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.OperationMetadataV1Alpha1.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.OperationMetadataV1Alpha1 do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata_v1_beta1.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata_v1_beta1.ex new file mode 100644 index 0000000000..1a66350c24 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/operation_metadata_v1_beta1.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.VPCAccess.V1.Model.OperationMetadataV1Beta1 do + @moduledoc """ + Metadata for google.longrunning.Operation. + + ## Attributes + + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the operation was created. + * `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the operation completed. + * `method` (*type:* `String.t`, *default:* `nil`) - Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1beta1.Connectors.CreateConnector. + * `target` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :createTime => DateTime.t() | nil, + :endTime => DateTime.t() | nil, + :method => String.t() | nil, + :target => String.t() | nil + } + + field(:createTime, as: DateTime) + field(:endTime, as: DateTime) + field(:method) + field(:target) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.OperationMetadataV1Beta1 do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.OperationMetadataV1Beta1.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.OperationMetadataV1Beta1 do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/status.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/status.ex new file mode 100644 index 0000000000..31cecccd37 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/status.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.VPCAccess.V1.Model.Status do + @moduledoc """ + The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + + ## Attributes + + * `code` (*type:* `integer()`, *default:* `nil`) - The status code, which should be an enum value of google.rpc.Code. + * `details` (*type:* `list(map())`, *default:* `nil`) - A list of messages that carry the error details. There is a common set of message types for APIs to use. + * `message` (*type:* `String.t`, *default:* `nil`) - A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :code => integer() | nil, + :details => list(map()) | nil, + :message => String.t() | nil + } + + field(:code) + field(:details, type: :list) + field(:message) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.Status do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.Status.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.Status do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/lib/google_api/vpc_access/v1/model/subnet.ex b/clients/vpc_access/lib/google_api/vpc_access/v1/model/subnet.ex new file mode 100644 index 0000000000..79220ca162 --- /dev/null +++ b/clients/vpc_access/lib/google_api/vpc_access/v1/model/subnet.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.VPCAccess.V1.Model.Subnet do + @moduledoc """ + The subnet in which to house the connector + + ## Attributes + + * `name` (*type:* `String.t`, *default:* `nil`) - Subnet name (relative, not fully qualified). E.g. if the full subnet selfLink is https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetName} the correct input for this field would be {subnetName} + * `projectId` (*type:* `String.t`, *default:* `nil`) - Project in which the subnet exists. If not set, this project is assumed to be the project for which the connector create request was issued. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :name => String.t() | nil, + :projectId => String.t() | nil + } + + field(:name) + field(:projectId) +end + +defimpl Poison.Decoder, for: GoogleApi.VPCAccess.V1.Model.Subnet do + def decode(value, options) do + GoogleApi.VPCAccess.V1.Model.Subnet.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.VPCAccess.V1.Model.Subnet do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/vpc_access/mix.exs b/clients/vpc_access/mix.exs new file mode 100644 index 0000000000..e77d67d14a --- /dev/null +++ b/clients/vpc_access/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.VPCAccess.Mixfile do + use Mix.Project + + @version "0.2.0" + + def project() do + [ + app: :google_api_vpc_access, + 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/vpc_access" + ] + 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 + """ + Serverless VPC Access API client library. API for managing VPC access connectors. + """ + 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/vpc_access", + "Homepage" => "https://cloud.google.com/vpc/docs/configure-serverless-vpc-access" + } + ] + end +end diff --git a/clients/vpc_access/test/test_helper.exs b/clients/vpc_access/test/test_helper.exs new file mode 100644 index 0000000000..e7788382ec --- /dev/null +++ b/clients/vpc_access/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.VPCAccess.TestHelper do + + defmacro __using__(opts) do + quote do + use ExUnit.Case, unquote(opts) + import GoogleApi.VPCAccess.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