|
| 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.CloudScheduler.V1.Api.Operations do |
| 19 | + @moduledoc """ |
| 20 | + API calls for all endpoints tagged `Operations`. |
| 21 | + """ |
| 22 | + |
| 23 | + alias GoogleApi.CloudScheduler.V1.Connection |
| 24 | + alias GoogleApi.Gax.{Request, Response} |
| 25 | + |
| 26 | + @library_version Mix.Project.config() |> Keyword.get(:version, "") |
| 27 | + |
| 28 | + @doc """ |
| 29 | + Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. |
| 30 | +
|
| 31 | + ## Parameters |
| 32 | +
|
| 33 | + * `connection` (*type:* `GoogleApi.CloudScheduler.V1.Connection.t`) - Connection to server |
| 34 | + * `name` (*type:* `String.t`) - The name of the operation resource to be cancelled. |
| 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 | + * `:body` (*type:* `GoogleApi.CloudScheduler.V1.Model.CancelOperationRequest.t`) - |
| 48 | + * `opts` (*type:* `keyword()`) - Call options |
| 49 | +
|
| 50 | + ## Returns |
| 51 | +
|
| 52 | + * `{:ok, %GoogleApi.CloudScheduler.V1.Model.Empty{}}` on success |
| 53 | + * `{:error, info}` on failure |
| 54 | + """ |
| 55 | + @spec cloudscheduler_operations_cancel(Tesla.Env.client(), String.t(), keyword(), keyword()) :: |
| 56 | + {:ok, GoogleApi.CloudScheduler.V1.Model.Empty.t()} |
| 57 | + | {:ok, Tesla.Env.t()} |
| 58 | + | {:ok, list()} |
| 59 | + | {:error, any()} |
| 60 | + def cloudscheduler_operations_cancel(connection, name, optional_params \\ [], opts \\ []) do |
| 61 | + optional_params_config = %{ |
| 62 | + :"$.xgafv" => :query, |
| 63 | + :access_token => :query, |
| 64 | + :alt => :query, |
| 65 | + :callback => :query, |
| 66 | + :fields => :query, |
| 67 | + :key => :query, |
| 68 | + :oauth_token => :query, |
| 69 | + :prettyPrint => :query, |
| 70 | + :quotaUser => :query, |
| 71 | + :uploadType => :query, |
| 72 | + :upload_protocol => :query, |
| 73 | + :body => :body |
| 74 | + } |
| 75 | + |
| 76 | + request = |
| 77 | + Request.new() |
| 78 | + |> Request.method(:post) |
| 79 | + |> Request.url("/v1/{+name}:cancel", %{ |
| 80 | + "name" => URI.encode(name, &URI.char_unreserved?/1) |
| 81 | + }) |
| 82 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 83 | + |> Request.library_version(@library_version) |
| 84 | + |
| 85 | + connection |
| 86 | + |> Connection.execute(request) |
| 87 | + |> Response.decode(opts ++ [struct: %GoogleApi.CloudScheduler.V1.Model.Empty{}]) |
| 88 | + end |
| 89 | + |
| 90 | + @doc """ |
| 91 | + Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. |
| 92 | +
|
| 93 | + ## Parameters |
| 94 | +
|
| 95 | + * `connection` (*type:* `GoogleApi.CloudScheduler.V1.Connection.t`) - Connection to server |
| 96 | + * `name` (*type:* `String.t`) - The name of the operation resource to be deleted. |
| 97 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 98 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 99 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 100 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 101 | + * `:callback` (*type:* `String.t`) - JSONP |
| 102 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 103 | + * `: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. |
| 104 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 105 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 106 | + * `: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. |
| 107 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 108 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 109 | + * `opts` (*type:* `keyword()`) - Call options |
| 110 | +
|
| 111 | + ## Returns |
| 112 | +
|
| 113 | + * `{:ok, %GoogleApi.CloudScheduler.V1.Model.Empty{}}` on success |
| 114 | + * `{:error, info}` on failure |
| 115 | + """ |
| 116 | + @spec cloudscheduler_operations_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) :: |
| 117 | + {:ok, GoogleApi.CloudScheduler.V1.Model.Empty.t()} |
| 118 | + | {:ok, Tesla.Env.t()} |
| 119 | + | {:ok, list()} |
| 120 | + | {:error, any()} |
| 121 | + def cloudscheduler_operations_delete(connection, name, optional_params \\ [], opts \\ []) do |
| 122 | + optional_params_config = %{ |
| 123 | + :"$.xgafv" => :query, |
| 124 | + :access_token => :query, |
| 125 | + :alt => :query, |
| 126 | + :callback => :query, |
| 127 | + :fields => :query, |
| 128 | + :key => :query, |
| 129 | + :oauth_token => :query, |
| 130 | + :prettyPrint => :query, |
| 131 | + :quotaUser => :query, |
| 132 | + :uploadType => :query, |
| 133 | + :upload_protocol => :query |
| 134 | + } |
| 135 | + |
| 136 | + request = |
| 137 | + Request.new() |
| 138 | + |> Request.method(:delete) |
| 139 | + |> Request.url("/v1/{+name}", %{ |
| 140 | + "name" => URI.encode(name, &URI.char_unreserved?/1) |
| 141 | + }) |
| 142 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 143 | + |> Request.library_version(@library_version) |
| 144 | + |
| 145 | + connection |
| 146 | + |> Connection.execute(request) |
| 147 | + |> Response.decode(opts ++ [struct: %GoogleApi.CloudScheduler.V1.Model.Empty{}]) |
| 148 | + end |
| 149 | + |
| 150 | + @doc """ |
| 151 | + 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. |
| 152 | +
|
| 153 | + ## Parameters |
| 154 | +
|
| 155 | + * `connection` (*type:* `GoogleApi.CloudScheduler.V1.Connection.t`) - Connection to server |
| 156 | + * `name` (*type:* `String.t`) - The name of the operation resource. |
| 157 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 158 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 159 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 160 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 161 | + * `:callback` (*type:* `String.t`) - JSONP |
| 162 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 163 | + * `: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. |
| 164 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 165 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 166 | + * `: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. |
| 167 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 168 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 169 | + * `opts` (*type:* `keyword()`) - Call options |
| 170 | +
|
| 171 | + ## Returns |
| 172 | +
|
| 173 | + * `{:ok, %GoogleApi.CloudScheduler.V1.Model.Operation{}}` on success |
| 174 | + * `{:error, info}` on failure |
| 175 | + """ |
| 176 | + @spec cloudscheduler_operations_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: |
| 177 | + {:ok, GoogleApi.CloudScheduler.V1.Model.Operation.t()} |
| 178 | + | {:ok, Tesla.Env.t()} |
| 179 | + | {:ok, list()} |
| 180 | + | {:error, any()} |
| 181 | + def cloudscheduler_operations_get(connection, name, optional_params \\ [], opts \\ []) do |
| 182 | + optional_params_config = %{ |
| 183 | + :"$.xgafv" => :query, |
| 184 | + :access_token => :query, |
| 185 | + :alt => :query, |
| 186 | + :callback => :query, |
| 187 | + :fields => :query, |
| 188 | + :key => :query, |
| 189 | + :oauth_token => :query, |
| 190 | + :prettyPrint => :query, |
| 191 | + :quotaUser => :query, |
| 192 | + :uploadType => :query, |
| 193 | + :upload_protocol => :query |
| 194 | + } |
| 195 | + |
| 196 | + request = |
| 197 | + Request.new() |
| 198 | + |> Request.method(:get) |
| 199 | + |> Request.url("/v1/{+name}", %{ |
| 200 | + "name" => URI.encode(name, &URI.char_unreserved?/1) |
| 201 | + }) |
| 202 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 203 | + |> Request.library_version(@library_version) |
| 204 | + |
| 205 | + connection |
| 206 | + |> Connection.execute(request) |
| 207 | + |> Response.decode(opts ++ [struct: %GoogleApi.CloudScheduler.V1.Model.Operation{}]) |
| 208 | + end |
| 209 | + |
| 210 | + @doc """ |
| 211 | + Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. |
| 212 | +
|
| 213 | + ## Parameters |
| 214 | +
|
| 215 | + * `connection` (*type:* `GoogleApi.CloudScheduler.V1.Connection.t`) - Connection to server |
| 216 | + * `name` (*type:* `String.t`) - The name of the operation's parent resource. |
| 217 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 218 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 219 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 220 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 221 | + * `:callback` (*type:* `String.t`) - JSONP |
| 222 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 223 | + * `: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. |
| 224 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 225 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 226 | + * `: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. |
| 227 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 228 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 229 | + * `:filter` (*type:* `String.t`) - The standard list filter. |
| 230 | + * `:pageSize` (*type:* `integer()`) - The standard list page size. |
| 231 | + * `:pageToken` (*type:* `String.t`) - The standard list page token. |
| 232 | + * `opts` (*type:* `keyword()`) - Call options |
| 233 | +
|
| 234 | + ## Returns |
| 235 | +
|
| 236 | + * `{:ok, %GoogleApi.CloudScheduler.V1.Model.ListOperationsResponse{}}` on success |
| 237 | + * `{:error, info}` on failure |
| 238 | + """ |
| 239 | + @spec cloudscheduler_operations_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: |
| 240 | + {:ok, GoogleApi.CloudScheduler.V1.Model.ListOperationsResponse.t()} |
| 241 | + | {:ok, Tesla.Env.t()} |
| 242 | + | {:ok, list()} |
| 243 | + | {:error, any()} |
| 244 | + def cloudscheduler_operations_list(connection, name, optional_params \\ [], opts \\ []) do |
| 245 | + optional_params_config = %{ |
| 246 | + :"$.xgafv" => :query, |
| 247 | + :access_token => :query, |
| 248 | + :alt => :query, |
| 249 | + :callback => :query, |
| 250 | + :fields => :query, |
| 251 | + :key => :query, |
| 252 | + :oauth_token => :query, |
| 253 | + :prettyPrint => :query, |
| 254 | + :quotaUser => :query, |
| 255 | + :uploadType => :query, |
| 256 | + :upload_protocol => :query, |
| 257 | + :filter => :query, |
| 258 | + :pageSize => :query, |
| 259 | + :pageToken => :query |
| 260 | + } |
| 261 | + |
| 262 | + request = |
| 263 | + Request.new() |
| 264 | + |> Request.method(:get) |
| 265 | + |> Request.url("/v1/{+name}", %{ |
| 266 | + "name" => URI.encode(name, &URI.char_unreserved?/1) |
| 267 | + }) |
| 268 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 269 | + |> Request.library_version(@library_version) |
| 270 | + |
| 271 | + connection |
| 272 | + |> Connection.execute(request) |
| 273 | + |> Response.decode( |
| 274 | + opts ++ [struct: %GoogleApi.CloudScheduler.V1.Model.ListOperationsResponse{}] |
| 275 | + ) |
| 276 | + end |
| 277 | +end |
0 commit comments