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 Workflows client #10838

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/workflows/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_workflows, "~> 0.4"}]
[{:google_api_workflows, "~> 0.5"}]
end
```

Expand Down
100 changes: 89 additions & 11 deletions clients/workflows/lib/google_api/workflows/v1/api/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ defmodule GoogleApi.Workflows.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 @@ -368,7 +368,7 @@ defmodule GoogleApi.Workflows.V1.Api.Projects do
end

@doc """
Creates a new workflow. If a workflow with the specified name already exists in the specified project and location, the long running operation will return ALREADY_EXISTS error.
Creates a new workflow. If a workflow with the specified name already exists in the specified project and location, the long running operation returns a ALREADY_EXISTS error.

## Parameters

Expand Down Expand Up @@ -512,12 +512,12 @@ defmodule GoogleApi.Workflows.V1.Api.Projects do
end

@doc """
Gets details of a single Workflow.
Gets details of a single workflow.

## Parameters

* `connection` (*type:* `GoogleApi.Workflows.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. Name of the workflow which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}
* `name` (*type:* `String.t`) - Required. Name of the workflow for which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
Expand All @@ -530,6 +530,7 @@ defmodule GoogleApi.Workflows.V1.Api.Projects do
* `: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").
* `:revisionId` (*type:* `String.t`) - Optional. The revision of the workflow to retrieve. If the revision_id is empty, the latest revision is retrieved. The format is "000001-a4d", where the first six characters define the zero-padded decimal revision number. They are followed by a hyphen and three hexadecimal characters.
* `opts` (*type:* `keyword()`) - Call options

## Returns
Expand Down Expand Up @@ -564,7 +565,8 @@ defmodule GoogleApi.Workflows.V1.Api.Projects do
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
:upload_protocol => :query,
:revisionId => :query
}

request =
Expand All @@ -582,7 +584,7 @@ defmodule GoogleApi.Workflows.V1.Api.Projects do
end

@doc """
Lists Workflows in a given project and location. The default order is not specified.
Lists workflows in a given project and location. The default order is not specified.

## Parameters

Expand All @@ -600,9 +602,9 @@ defmodule GoogleApi.Workflows.V1.Api.Projects do
* `: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`) - Filter to restrict results to specific workflows.
* `:orderBy` (*type:* `String.t`) - Comma-separated list of fields that that specify the order of the results. Default sorting order for a field is ascending. To specify descending order for a field, append a " desc" suffix. If not specified, the results will be returned in an unspecified order.
* `:pageSize` (*type:* `integer()`) - Maximum number of workflows to return per call. The service may return fewer than this value. If the value is not specified, a default value of 500 will be used. The maximum permitted value is 1000 and values greater than 1000 will be coerced down to 1000.
* `:filter` (*type:* `String.t`) - Filter to restrict results to specific workflows. For details, see AIP-160. For example, if you are using the Google APIs Explorer: `state="SUCCEEDED"` or `createTime>"2023-08-01" AND state="FAILED"`
* `:orderBy` (*type:* `String.t`) - Comma-separated list of fields that specify the order of the results. Default sorting order for a field is ascending. To specify descending order for a field, append a "desc" suffix. If not specified, the results are returned in an unspecified order.
* `:pageSize` (*type:* `integer()`) - Maximum number of workflows to return per call. The service might return fewer than this value even if not at the end of the collection. If a value is not specified, a default value of 500 is used. The maximum permitted value is 1000 and values greater than 1000 are coerced down to 1000.
* `:pageToken` (*type:* `String.t`) - A page token, received from a previous `ListWorkflows` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListWorkflows` must match the call that provided the page token.
* `opts` (*type:* `keyword()`) - Call options

Expand Down Expand Up @@ -660,12 +662,88 @@ defmodule GoogleApi.Workflows.V1.Api.Projects do
end

@doc """
Updates an existing workflow. Running this method has no impact on already running executions of the workflow. A new revision of the workflow may be created as a result of a successful update operation. In that case, such revision will be used in new workflow executions.
Lists revisions for a given workflow.

## Parameters

* `connection` (*type:* `GoogleApi.Workflows.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. Workflow for which the revisions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow}
* `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()`) - The maximum number of revisions to return per page. If a value is not specified, a default value of 20 is used. The maximum permitted value is 100. Values greater than 100 are coerced down to 100.
* `:pageToken` (*type:* `String.t`) - The page token, received from a previous ListWorkflowRevisions call. Provide this to retrieve the subsequent page.
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.Workflows.V1.Model.ListWorkflowRevisionsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec workflows_projects_locations_workflows_list_revisions(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Workflows.V1.Model.ListWorkflowRevisionsResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def workflows_projects_locations_workflows_list_revisions(
connection,
name,
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/{+name}:listRevisions", %{
"name" => URI.encode(name, &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.Workflows.V1.Model.ListWorkflowRevisionsResponse{}]
)
end

@doc """
Updates an existing workflow. Running this method has no impact on already running executions of the workflow. A new revision of the workflow might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.

## Parameters

* `connection` (*type:* `GoogleApi.Workflows.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The resource name of the workflow. Format: projects/{project}/locations/{location}/workflows/{workflow}
* `name` (*type:* `String.t`) - The resource name of the workflow. Format: projects/{project}/locations/{location}/workflows/{workflow}. This is a workflow-wide field and is not tied to a specific revision.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Workflows.V1 do
API client metadata for GoogleApi.Workflows.V1.
"""

@discovery_revision "20220406"
@discovery_revision "20240221"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
@@ -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.Workflows.V1.Model.ListWorkflowRevisionsResponse do
@moduledoc """
Response for the ListWorkflowRevisions method.

## Attributes

* `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
* `workflows` (*type:* `list(GoogleApi.Workflows.V1.Model.Workflow.t)`, *default:* `nil`) - The revisions of the workflow, ordered in reverse chronological order.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:nextPageToken => String.t() | nil,
:workflows => list(GoogleApi.Workflows.V1.Model.Workflow.t()) | nil
}

field(:nextPageToken)
field(:workflows, as: GoogleApi.Workflows.V1.Model.Workflow, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Workflows.V1.Model.ListWorkflowRevisionsResponse do
def decode(value, options) do
GoogleApi.Workflows.V1.Model.ListWorkflowRevisionsResponse.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Workflows.V1.Model.ListWorkflowRevisionsResponse do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule GoogleApi.Workflows.V1.Model.ListWorkflowsResponse do

* `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
* `unreachable` (*type:* `list(String.t)`, *default:* `nil`) - Unreachable resources.
* `workflows` (*type:* `list(GoogleApi.Workflows.V1.Model.Workflow.t)`, *default:* `nil`) - The workflows which match the request.
* `workflows` (*type:* `list(GoogleApi.Workflows.V1.Model.Workflow.t)`, *default:* `nil`) - The workflows that match the request.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.Workflows.V1.Model.Location do
@moduledoc """
A resource that represents Google Cloud Platform location.
A resource that represents a Google Cloud location.

## Attributes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Workflows.V1.Model.Operation do
* `error` (*type:* `GoogleApi.Workflows.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 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
Original file line number Diff line number Diff line change
@@ -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.Workflows.V1.Model.StateError do
@moduledoc """
Describes an error related to the current state of the workflow.

## Attributes

* `details` (*type:* `String.t`, *default:* `nil`) - Provides specifics about the error.
* `type` (*type:* `String.t`, *default:* `nil`) - The type of this state error.
"""

use GoogleApi.Gax.ModelBase

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

field(:details)
field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Workflows.V1.Model.StateError do
def decode(value, options) do
GoogleApi.Workflows.V1.Model.StateError.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Workflows.V1.Model.StateError do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading
Loading