Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automated regeneration of WebRisk client #10894

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/web_risk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_web_risk, "~> 0.2"}]
[{:google_api_web_risk, "~> 0.3"}]
end
```

Expand Down
64 changes: 1 addition & 63 deletions clients/web_risk/lib/google_api/web_risk/v1/api/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ defmodule GoogleApi.WebRisk.V1.Api.Projects do
end

@doc """
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.

## Parameters

Expand Down Expand Up @@ -338,66 +338,4 @@ defmodule GoogleApi.WebRisk.V1.Api.Projects do
opts ++ [struct: %GoogleApi.WebRisk.V1.Model.GoogleCloudWebriskV1Submission{}]
)
end

@doc """
Submits a URI suspected of containing malicious content to be reviewed. Returns a google.longrunning.Operation which, once the review is complete, is updated with its result. You can use the [Pub/Sub API] (https://cloud.google.com/pubsub) to receive notifications for the returned Operation. If the result verifies the existence of malicious content, the site will be added to the [Google's Social Engineering lists] (https://support.google.com/webmasters/answer/6350487/) in order to protect users that could get exposed to this threat in the future. Only allowlisted projects can use this method during Early Access. Please reach out to Sales or your customer engineer to obtain access.

## Parameters

* `connection` (*type:* `GoogleApi.WebRisk.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Required. The name of the project that is making the submission. This string is in the format "projects/{project_number}".
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.WebRisk.V1.Model.GoogleCloudWebriskV1SubmitUriRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.WebRisk.V1.Model.GoogleLongrunningOperation{}}` on success
* `{:error, info}` on failure
"""
@spec webrisk_projects_uris_submit(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.WebRisk.V1.Model.GoogleLongrunningOperation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def webrisk_projects_uris_submit(connection, parent, optional_params \\ [], opts \\ []) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/uris:submit", %{
"parent" => URI.encode(parent, &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.WebRisk.V1.Model.GoogleLongrunningOperation{}])
end
end
2 changes: 1 addition & 1 deletion clients/web_risk/lib/google_api/web_risk/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.WebRisk.V1 do
API client metadata for GoogleApi.WebRisk.V1.
"""

@discovery_revision "20221112"
@discovery_revision "20240310"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ defmodule GoogleApi.WebRisk.V1.Model.GoogleCloudWebriskV1Submission do

## Attributes

* `threatTypes` (*type:* `list(String.t)`, *default:* `nil`) - ThreatTypes found to be associated with the submitted URI after reviewing it. This might be empty if the URI was not added to any list.
* `uri` (*type:* `String.t`, *default:* `nil`) - Required. The URI that is being reported for malicious content to be analyzed.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:threatTypes => list(String.t()) | nil,
:uri => String.t() | nil
}

field(:threatTypes, type: :list)
field(:uri)
end

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.WebRisk.V1.Model.GoogleLongrunningOperation do
* `error` (*type:* `GoogleApi.WebRisk.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - The error result of the operation in case of failure or cancellation.
* `metadata` (*type:* `map()`, *default:* `nil`) - Contains a `SubmitUriMetadata` object.
* `name` (*type:* `String.t`, *default:* `nil`) - Matches the `/v1/{project-name}/operations/{operation-id}` pattern.
* `response` (*type:* `map()`, *default:* `nil`) - The normal response of the operation in case of success. 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`.
* `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
Expand Down
2 changes: 1 addition & 1 deletion clients/web_risk/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defmodule GoogleApi.WebRisk.Mixfile do
use Mix.Project

@version "0.2.1"
@version "0.3.0"

def project() do
[
Expand Down
Loading