|
| 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.Drive.V3.Api.Accessproposals do |
| 19 | + @moduledoc """ |
| 20 | + API calls for all endpoints tagged `Accessproposals`. |
| 21 | + """ |
| 22 | + |
| 23 | + alias GoogleApi.Drive.V3.Connection |
| 24 | + alias GoogleApi.Gax.{Request, Response} |
| 25 | + |
| 26 | + @library_version Mix.Project.config() |> Keyword.get(:version, "") |
| 27 | + |
| 28 | + @doc """ |
| 29 | + Retrieves an AccessProposal by ID. |
| 30 | +
|
| 31 | + ## Parameters |
| 32 | +
|
| 33 | + * `connection` (*type:* `GoogleApi.Drive.V3.Connection.t`) - Connection to server |
| 34 | + * `file_id` (*type:* `String.t`) - Required. The id of the item the request is on. |
| 35 | + * `proposal_id` (*type:* `String.t`) - Required. The id of the access proposal to resolve. |
| 36 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 37 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 38 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 39 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 40 | + * `:callback` (*type:* `String.t`) - JSONP |
| 41 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 42 | + * `: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. |
| 43 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 44 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 45 | + * `: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. |
| 46 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 47 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 48 | + * `opts` (*type:* `keyword()`) - Call options |
| 49 | +
|
| 50 | + ## Returns |
| 51 | +
|
| 52 | + * `{:ok, %GoogleApi.Drive.V3.Model.AccessProposal{}}` on success |
| 53 | + * `{:error, info}` on failure |
| 54 | + """ |
| 55 | + @spec drive_accessproposals_get( |
| 56 | + Tesla.Env.client(), |
| 57 | + String.t(), |
| 58 | + String.t(), |
| 59 | + keyword(), |
| 60 | + keyword() |
| 61 | + ) :: |
| 62 | + {:ok, GoogleApi.Drive.V3.Model.AccessProposal.t()} |
| 63 | + | {:ok, Tesla.Env.t()} |
| 64 | + | {:ok, list()} |
| 65 | + | {:error, any()} |
| 66 | + def drive_accessproposals_get( |
| 67 | + connection, |
| 68 | + file_id, |
| 69 | + proposal_id, |
| 70 | + optional_params \\ [], |
| 71 | + opts \\ [] |
| 72 | + ) do |
| 73 | + optional_params_config = %{ |
| 74 | + :"$.xgafv" => :query, |
| 75 | + :access_token => :query, |
| 76 | + :alt => :query, |
| 77 | + :callback => :query, |
| 78 | + :fields => :query, |
| 79 | + :key => :query, |
| 80 | + :oauth_token => :query, |
| 81 | + :prettyPrint => :query, |
| 82 | + :quotaUser => :query, |
| 83 | + :uploadType => :query, |
| 84 | + :upload_protocol => :query |
| 85 | + } |
| 86 | + |
| 87 | + request = |
| 88 | + Request.new() |
| 89 | + |> Request.method(:get) |
| 90 | + |> Request.url("/drive/v3/files/{fileId}/accessproposals/{proposalId}", %{ |
| 91 | + "fileId" => URI.encode(file_id, &URI.char_unreserved?/1), |
| 92 | + "proposalId" => URI.encode(proposal_id, &(URI.char_unreserved?(&1) || &1 == ?/)) |
| 93 | + }) |
| 94 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 95 | + |> Request.library_version(@library_version) |
| 96 | + |
| 97 | + connection |
| 98 | + |> Connection.execute(request) |
| 99 | + |> Response.decode(opts ++ [struct: %GoogleApi.Drive.V3.Model.AccessProposal{}]) |
| 100 | + end |
| 101 | + |
| 102 | + @doc """ |
| 103 | + List the AccessProposals on a file. Note: Only approvers are able to list AccessProposals on a file. If the user is not an approver, returns a 403. |
| 104 | +
|
| 105 | + ## Parameters |
| 106 | +
|
| 107 | + * `connection` (*type:* `GoogleApi.Drive.V3.Connection.t`) - Connection to server |
| 108 | + * `file_id` (*type:* `String.t`) - Required. The id of the item the request is on. |
| 109 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 110 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 111 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 112 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 113 | + * `:callback` (*type:* `String.t`) - JSONP |
| 114 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 115 | + * `: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. |
| 116 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 117 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 118 | + * `: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. |
| 119 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 120 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 121 | + * `:pageSize` (*type:* `integer()`) - Optional. The number of results per page |
| 122 | + * `:pageToken` (*type:* `String.t`) - Optional. The continuation token on the list of access requests. |
| 123 | + * `opts` (*type:* `keyword()`) - Call options |
| 124 | +
|
| 125 | + ## Returns |
| 126 | +
|
| 127 | + * `{:ok, %GoogleApi.Drive.V3.Model.ListAccessProposalsResponse{}}` on success |
| 128 | + * `{:error, info}` on failure |
| 129 | + """ |
| 130 | + @spec drive_accessproposals_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: |
| 131 | + {:ok, GoogleApi.Drive.V3.Model.ListAccessProposalsResponse.t()} |
| 132 | + | {:ok, Tesla.Env.t()} |
| 133 | + | {:ok, list()} |
| 134 | + | {:error, any()} |
| 135 | + def drive_accessproposals_list(connection, file_id, optional_params \\ [], opts \\ []) do |
| 136 | + optional_params_config = %{ |
| 137 | + :"$.xgafv" => :query, |
| 138 | + :access_token => :query, |
| 139 | + :alt => :query, |
| 140 | + :callback => :query, |
| 141 | + :fields => :query, |
| 142 | + :key => :query, |
| 143 | + :oauth_token => :query, |
| 144 | + :prettyPrint => :query, |
| 145 | + :quotaUser => :query, |
| 146 | + :uploadType => :query, |
| 147 | + :upload_protocol => :query, |
| 148 | + :pageSize => :query, |
| 149 | + :pageToken => :query |
| 150 | + } |
| 151 | + |
| 152 | + request = |
| 153 | + Request.new() |
| 154 | + |> Request.method(:get) |
| 155 | + |> Request.url("/drive/v3/files/{fileId}/accessproposals", %{ |
| 156 | + "fileId" => URI.encode(file_id, &URI.char_unreserved?/1) |
| 157 | + }) |
| 158 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 159 | + |> Request.library_version(@library_version) |
| 160 | + |
| 161 | + connection |
| 162 | + |> Connection.execute(request) |
| 163 | + |> Response.decode(opts ++ [struct: %GoogleApi.Drive.V3.Model.ListAccessProposalsResponse{}]) |
| 164 | + end |
| 165 | + |
| 166 | + @doc """ |
| 167 | + Used to approve or deny an Access Proposal. |
| 168 | +
|
| 169 | + ## Parameters |
| 170 | +
|
| 171 | + * `connection` (*type:* `GoogleApi.Drive.V3.Connection.t`) - Connection to server |
| 172 | + * `file_id` (*type:* `String.t`) - Required. The id of the item the request is on. |
| 173 | + * `proposal_id` (*type:* `String.t`) - Required. The id of the access proposal to resolve. |
| 174 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 175 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 176 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 177 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 178 | + * `:callback` (*type:* `String.t`) - JSONP |
| 179 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 180 | + * `: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. |
| 181 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 182 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 183 | + * `: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. |
| 184 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 185 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 186 | + * `:body` (*type:* `GoogleApi.Drive.V3.Model.ResolveAccessProposalRequest.t`) - |
| 187 | + * `opts` (*type:* `keyword()`) - Call options |
| 188 | +
|
| 189 | + ## Returns |
| 190 | +
|
| 191 | + * `{:ok, %{}}` on success |
| 192 | + * `{:error, info}` on failure |
| 193 | + """ |
| 194 | + @spec drive_accessproposals_resolve( |
| 195 | + Tesla.Env.client(), |
| 196 | + String.t(), |
| 197 | + String.t(), |
| 198 | + keyword(), |
| 199 | + keyword() |
| 200 | + ) :: {:ok, nil} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} |
| 201 | + def drive_accessproposals_resolve( |
| 202 | + connection, |
| 203 | + file_id, |
| 204 | + proposal_id, |
| 205 | + optional_params \\ [], |
| 206 | + opts \\ [] |
| 207 | + ) do |
| 208 | + optional_params_config = %{ |
| 209 | + :"$.xgafv" => :query, |
| 210 | + :access_token => :query, |
| 211 | + :alt => :query, |
| 212 | + :callback => :query, |
| 213 | + :fields => :query, |
| 214 | + :key => :query, |
| 215 | + :oauth_token => :query, |
| 216 | + :prettyPrint => :query, |
| 217 | + :quotaUser => :query, |
| 218 | + :uploadType => :query, |
| 219 | + :upload_protocol => :query, |
| 220 | + :body => :body |
| 221 | + } |
| 222 | + |
| 223 | + request = |
| 224 | + Request.new() |
| 225 | + |> Request.method(:post) |
| 226 | + |> Request.url("/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve", %{ |
| 227 | + "fileId" => URI.encode(file_id, &URI.char_unreserved?/1), |
| 228 | + "proposalId" => URI.encode(proposal_id, &URI.char_unreserved?/1) |
| 229 | + }) |
| 230 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 231 | + |> Request.library_version(@library_version) |
| 232 | + |
| 233 | + connection |
| 234 | + |> Connection.execute(request) |
| 235 | + |> Response.decode(opts ++ [decode: false]) |
| 236 | + end |
| 237 | +end |
0 commit comments