|
| 1 | +# Copyright 2019 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# NOTE: This file is auto generated by the elixir code generator program. |
| 16 | +# Do not edit this file manually. |
| 17 | + |
| 18 | +defmodule GoogleApi.AdSensePlatform.V1alpha.Api.Accounts do |
| 19 | + @moduledoc """ |
| 20 | + API calls for all endpoints tagged `Accounts`. |
| 21 | + """ |
| 22 | + |
| 23 | + alias GoogleApi.AdSensePlatform.V1alpha.Connection |
| 24 | + alias GoogleApi.Gax.{Request, Response} |
| 25 | + |
| 26 | + @library_version Mix.Project.config() |> Keyword.get(:version, "") |
| 27 | + |
| 28 | + @doc """ |
| 29 | + Gets a platform. |
| 30 | +
|
| 31 | + ## Parameters |
| 32 | +
|
| 33 | + * `connection` (*type:* `GoogleApi.AdSensePlatform.V1alpha.Connection.t`) - Connection to server |
| 34 | + * `name` (*type:* `String.t`) - Required. The name of the platform to retrieve. Format: accounts/{account}/platforms/{platform} |
| 35 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 36 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 37 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 38 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 39 | + * `:callback` (*type:* `String.t`) - JSONP |
| 40 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 41 | + * `: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. |
| 42 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 43 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 44 | + * `: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. |
| 45 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 46 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 47 | + * `opts` (*type:* `keyword()`) - Call options |
| 48 | +
|
| 49 | + ## Returns |
| 50 | +
|
| 51 | + * `{:ok, %GoogleApi.AdSensePlatform.V1alpha.Model.Platform{}}` on success |
| 52 | + * `{:error, info}` on failure |
| 53 | + """ |
| 54 | + @spec adsenseplatform_accounts_platforms_get( |
| 55 | + Tesla.Env.client(), |
| 56 | + String.t(), |
| 57 | + keyword(), |
| 58 | + keyword() |
| 59 | + ) :: |
| 60 | + {:ok, GoogleApi.AdSensePlatform.V1alpha.Model.Platform.t()} |
| 61 | + | {:ok, Tesla.Env.t()} |
| 62 | + | {:ok, list()} |
| 63 | + | {:error, any()} |
| 64 | + def adsenseplatform_accounts_platforms_get(connection, name, optional_params \\ [], opts \\ []) do |
| 65 | + optional_params_config = %{ |
| 66 | + :"$.xgafv" => :query, |
| 67 | + :access_token => :query, |
| 68 | + :alt => :query, |
| 69 | + :callback => :query, |
| 70 | + :fields => :query, |
| 71 | + :key => :query, |
| 72 | + :oauth_token => :query, |
| 73 | + :prettyPrint => :query, |
| 74 | + :quotaUser => :query, |
| 75 | + :uploadType => :query, |
| 76 | + :upload_protocol => :query |
| 77 | + } |
| 78 | + |
| 79 | + request = |
| 80 | + Request.new() |
| 81 | + |> Request.method(:get) |
| 82 | + |> Request.url("/v1alpha/{+name}", %{ |
| 83 | + "name" => URI.encode(name, &URI.char_unreserved?/1) |
| 84 | + }) |
| 85 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 86 | + |> Request.library_version(@library_version) |
| 87 | + |
| 88 | + connection |
| 89 | + |> Connection.execute(request) |
| 90 | + |> Response.decode(opts ++ [struct: %GoogleApi.AdSensePlatform.V1alpha.Model.Platform{}]) |
| 91 | + end |
| 92 | +end |
0 commit comments