Skip to content

Commit

Permalink
feat: Automated regeneration of Connectors client
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Dec 6, 2024
1 parent b16a7ac commit fd03cf2
Show file tree
Hide file tree
Showing 20 changed files with 391 additions and 48 deletions.
2 changes: 1 addition & 1 deletion clients/connectors/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_connectors, "~> 0.16"}]
[{:google_api_connectors, "~> 0.17"}]
end
```

Expand Down
146 changes: 145 additions & 1 deletion clients/connectors/lib/google_api/connectors/v1/api/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,150 @@ defmodule GoogleApi.Connectors.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.Connectors.V1.Model.Operation{}])
end

@doc """
Publish request for the CustomConnectorVersion. Once approved, the CustomConnectorVersion will be published as PartnerConnector.
## Parameters
* `connection` (*type:* `GoogleApi.Connectors.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. Resource name of the form: `projects/{project}/locations/{location}/customConnectors/{custom_connector}/customConnectorVersions/{custom_connector_version}`
* `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.Connectors.V1.Model.PublishCustomConnectorVersionRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Connectors.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec connectors_projects_locations_custom_connectors_custom_connector_versions_publish(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Connectors.V1.Model.Operation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def connectors_projects_locations_custom_connectors_custom_connector_versions_publish(
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,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+name}:publish", %{
"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.Connectors.V1.Model.Operation{}])
end

@doc """
Withdraw the publish request for the CustomConnectorVersion. This can only be used before the CustomConnectorVersion is published.
## Parameters
* `connection` (*type:* `GoogleApi.Connectors.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. Resource name of the form: `projects/{project}/locations/{location}/customConnectors/{custom_connector}/customConnectorVersions/{custom_connector_version}`
* `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.Connectors.V1.Model.WithdrawCustomConnectorVersionRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Connectors.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec connectors_projects_locations_custom_connectors_custom_connector_versions_withdraw(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Connectors.V1.Model.Operation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def connectors_projects_locations_custom_connectors_custom_connector_versions_withdraw(
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,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+name}:withdraw", %{
"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.Connectors.V1.Model.Operation{}])
end

@doc """
Creates a new EndpointAttachment in a given project and location.
Expand Down Expand Up @@ -3906,7 +4050,7 @@ defmodule GoogleApi.Connectors.V1.Api.Projects do
end

@doc """
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`.
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`.
## Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Connectors.V1 do
API client metadata for GoogleApi.Connectors.V1.
"""

@discovery_revision "20241105"
@discovery_revision "20241203"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ defmodule GoogleApi.Connectors.V1.Model.AuthorizationCodeLink do
## Attributes
* `clientId` (*type:* `String.t`, *default:* `nil`) - The client ID assigned to the Google Cloud Connectors OAuth app for the connector data source.
* `clientId` (*type:* `String.t`, *default:* `nil`) - Optional. The client ID assigned to the Google Cloud Connectors OAuth app for the connector data source.
* `clientSecret` (*type:* `GoogleApi.Connectors.V1.Model.Secret.t`, *default:* `nil`) - Optional. The client secret assigned to the Google Cloud Connectors OAuth app for the connector data source.
* `enablePkce` (*type:* `boolean()`, *default:* `nil`) - Whether to enable PKCE for the auth code flow.
* `enablePkce` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether to enable PKCE for the auth code flow.
* `omitQueryParams` (*type:* `boolean()`, *default:* `nil`) - Optional. Omit query params from the redirect URI.
* `scopes` (*type:* `list(String.t)`, *default:* `nil`) - The scopes for which the user will authorize Google Cloud Connectors on the connector data source.
* `uri` (*type:* `String.t`, *default:* `nil`) - The base URI the user must click to trigger the authorization code login flow.
* `scopes` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The scopes for which the user will authorize Google Cloud Connectors on the connector data source.
* `uri` (*type:* `String.t`, *default:* `nil`) - Optional. The base URI the user must click to trigger the authorization code login flow.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ defmodule GoogleApi.Connectors.V1.Model.ConfigVariableTemplate do
## Attributes
* `authorizationCodeLink` (*type:* `GoogleApi.Connectors.V1.Model.AuthorizationCodeLink.t`, *default:* `nil`) - Authorization code link options. To be populated if `ValueType` is `AUTHORIZATION_CODE`
* `description` (*type:* `String.t`, *default:* `nil`) - Description.
* `displayName` (*type:* `String.t`, *default:* `nil`) - Display name of the parameter.
* `enumOptions` (*type:* `list(GoogleApi.Connectors.V1.Model.EnumOption.t)`, *default:* `nil`) - Enum options. To be populated if `ValueType` is `ENUM`
* `authorizationCodeLink` (*type:* `GoogleApi.Connectors.V1.Model.AuthorizationCodeLink.t`, *default:* `nil`) - Optional. Authorization code link options. To be populated if `ValueType` is `AUTHORIZATION_CODE`
* `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description.
* `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Display name of the parameter.
* `enumOptions` (*type:* `list(GoogleApi.Connectors.V1.Model.EnumOption.t)`, *default:* `nil`) - Optional. Enum options. To be populated if `ValueType` is `ENUM`
* `enumSource` (*type:* `String.t`, *default:* `nil`) - Optional. enum source denotes the source of api to fill the enum options
* `isAdvanced` (*type:* `boolean()`, *default:* `nil`) - Indicates if current template is part of advanced settings
* `key` (*type:* `String.t`, *default:* `nil`) - Key of the config variable.
* `isAdvanced` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates if current template is part of advanced settings
* `key` (*type:* `String.t`, *default:* `nil`) - Optional. Key of the config variable.
* `locationType` (*type:* `String.t`, *default:* `nil`) - Optional. Location Tyep denotes where this value should be sent in BYOC connections.
* `multipleSelectConfig` (*type:* `GoogleApi.Connectors.V1.Model.MultipleSelectConfig.t`, *default:* `nil`) - Optional. MultipleSelectConfig represents the multiple options for a config variable.
* `required` (*type:* `boolean()`, *default:* `nil`) - Flag represents that this `ConfigVariable` must be provided for a connection.
* `requiredCondition` (*type:* `GoogleApi.Connectors.V1.Model.LogicalExpression.t`, *default:* `nil`) - Condition under which a field would be required. The condition can be represented in the form of a logical expression.
* `roleGrant` (*type:* `GoogleApi.Connectors.V1.Model.RoleGrant.t`, *default:* `nil`) - Role grant configuration for the config variable.
* `state` (*type:* `String.t`, *default:* `nil`) - State of the config variable.
* `validationRegex` (*type:* `String.t`, *default:* `nil`) - Regular expression in RE2 syntax used for validating the `value` of a `ConfigVariable`.
* `valueType` (*type:* `String.t`, *default:* `nil`) - Type of the parameter: string, int, bool etc. consider custom type for the benefit for the validation.
* `required` (*type:* `boolean()`, *default:* `nil`) - Optional. Flag represents that this `ConfigVariable` must be provided for a connection.
* `requiredCondition` (*type:* `GoogleApi.Connectors.V1.Model.LogicalExpression.t`, *default:* `nil`) - Optional. Condition under which a field would be required. The condition can be represented in the form of a logical expression.
* `roleGrant` (*type:* `GoogleApi.Connectors.V1.Model.RoleGrant.t`, *default:* `nil`) - Optional. Role grant configuration for the config variable.
* `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the config variable.
* `validationRegex` (*type:* `String.t`, *default:* `nil`) - Optional. Regular expression in RE2 syntax used for validating the `value` of a `ConfigVariable`.
* `valueType` (*type:* `String.t`, *default:* `nil`) - Optional. Type of the parameter: string, int, bool etc. consider custom type for the benefit for the validation.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ defmodule GoogleApi.Connectors.V1.Model.Connector do
* `externalUri` (*type:* `String.t`, *default:* `nil`) - Output only. Link to external page.
* `labels` (*type:* `map()`, *default:* `nil`) - Output only. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
* `launchStage` (*type:* `String.t`, *default:* `nil`) - Output only. Flag to mark the version indicating the launch stage.
* `marketplaceConnectorDetails` (*type:* `GoogleApi.Connectors.V1.Model.MarketplaceConnectorDetails.t`, *default:* `nil`) - Output only. Marketplace connector details. Will be null if the connector is not marketplace connector.
* `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the Connector. Format: projects/{project}/locations/{location}/providers/{provider}/connectors/{connector} Only global location is supported for Connector resource.
* `tags` (*type:* `list(String.t)`, *default:* `nil`) - Output only. Tags of the connector.
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Updated time.
Expand All @@ -50,6 +51,8 @@ defmodule GoogleApi.Connectors.V1.Model.Connector do
:externalUri => String.t() | nil,
:labels => map() | nil,
:launchStage => String.t() | nil,
:marketplaceConnectorDetails =>
GoogleApi.Connectors.V1.Model.MarketplaceConnectorDetails.t() | nil,
:name => String.t() | nil,
:tags => list(String.t()) | nil,
:updateTime => DateTime.t() | nil,
Expand All @@ -66,6 +69,11 @@ defmodule GoogleApi.Connectors.V1.Model.Connector do
field(:externalUri)
field(:labels, type: :map)
field(:launchStage)

field(:marketplaceConnectorDetails,
as: GoogleApi.Connectors.V1.Model.MarketplaceConnectorDetails
)

field(:name)
field(:tags, type: :list)
field(:updateTime, as: DateTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule GoogleApi.Connectors.V1.Model.ConnectorVersionInfraConfig do
## Attributes
* `connectionRatelimitWindowSeconds` (*type:* `String.t`, *default:* `nil`) - Output only. The window used for ratelimiting runtime requests to connections.
* `deploymentModel` (*type:* `String.t`, *default:* `nil`) - Optional. Indicates whether connector is deployed on GKE/CloudRun
* `deploymentModel` (*type:* `String.t`, *default:* `nil`) - Output only. Indicates whether connector is deployed on GKE/CloudRun
* `deploymentModelMigrationState` (*type:* `String.t`, *default:* `nil`) - Output only. Status of the deployment model migration.
* `hpaConfig` (*type:* `GoogleApi.Connectors.V1.Model.HPAConfig.t`, *default:* `nil`) - Output only. HPA autoscaling config.
* `internalclientRatelimitThreshold` (*type:* `String.t`, *default:* `nil`) - Output only. Max QPS supported for internal requests originating from Connd.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ defmodule GoogleApi.Connectors.V1.Model.EnumOption do
## Attributes
* `displayName` (*type:* `String.t`, *default:* `nil`) - Display name of the option.
* `id` (*type:* `String.t`, *default:* `nil`) - Id of the option.
* `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Display name of the option.
* `id` (*type:* `String.t`, *default:* `nil`) - Optional. Id of the option.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule GoogleApi.Connectors.V1.Model.EventSubscriptionDestination do
## Attributes
* `endpoint` (*type:* `GoogleApi.Connectors.V1.Model.EndPoint.t`, *default:* `nil`) - OPTION 1: Hit an endpoint when we receive an event.
* `gsutil` (*type:* `GoogleApi.Connectors.V1.Model.GSUtil.t`, *default:* `nil`) - OPTION 2: Write the event to Cloud Storage bucket.
* `serviceAccount` (*type:* `String.t`, *default:* `nil`) - Service account needed for runtime plane to trigger IP workflow.
* `type` (*type:* `String.t`, *default:* `nil`) - type of the destination
"""
Expand All @@ -30,11 +31,13 @@ defmodule GoogleApi.Connectors.V1.Model.EventSubscriptionDestination do

@type t :: %__MODULE__{
:endpoint => GoogleApi.Connectors.V1.Model.EndPoint.t() | nil,
:gsutil => GoogleApi.Connectors.V1.Model.GSUtil.t() | nil,
:serviceAccount => String.t() | nil,
:type => String.t() | nil
}

field(:endpoint, as: GoogleApi.Connectors.V1.Model.EndPoint)
field(:gsutil, as: GoogleApi.Connectors.V1.Model.GSUtil)
field(:serviceAccount)
field(:type)
end
Expand Down
Loading

0 comments on commit fd03cf2

Please sign in to comment.