Skip to content

Commit

Permalink
feat: Automated regeneration of Memcache client (#10903)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 01:36:08 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent 2ed8062 commit 356319e
Show file tree
Hide file tree
Showing 22 changed files with 303 additions and 20 deletions.
85 changes: 84 additions & 1 deletion clients/memcache/lib/google_api/memcache/v1/api/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,89 @@ defmodule GoogleApi.Memcache.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.Memcache.V1.Model.Operation{}])
end

@doc """
Upgrades the Memcache instance to a newer memcached engine version specified in the request.
## Parameters
* `connection` (*type:* `GoogleApi.Memcache.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. Memcache instance resource name using the form: `projects/{project}/locations/{location}/instances/{instance}` where `location_id` refers to a GCP region.
* `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`.
* `instances_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`.
* `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.Memcache.V1.Model.GoogleCloudMemcacheV1UpgradeInstanceRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Memcache.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec memcache_projects_locations_instances_upgrade(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Memcache.V1.Model.Operation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def memcache_projects_locations_instances_upgrade(
connection,
projects_id,
locations_id,
instances_id,
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/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:upgrade",
%{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"locationsId" => URI.encode(locations_id, &URI.char_unreserved?/1),
"instancesId" => URI.encode(instances_id, &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.Memcache.V1.Model.Operation{}])
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`.
Expand Down Expand Up @@ -1067,7 +1150,7 @@ defmodule GoogleApi.Memcache.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
2 changes: 1 addition & 1 deletion clients/memcache/lib/google_api/memcache/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Memcache.V1 do
API client metadata for GoogleApi.Memcache.V1.
"""

@discovery_revision "20220709"
@discovery_revision "20240222"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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.Memcache.V1.Model.GoogleCloudMemcacheV1UpgradeInstanceRequest do
@moduledoc """
Request for UpgradeInstance.
## Attributes
* `memcacheVersion` (*type:* `String.t`, *default:* `nil`) - Required. Specifies the target version of memcached engine to upgrade to.
"""

use GoogleApi.Gax.ModelBase

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

field(:memcacheVersion)
end

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

defimpl Poison.Encoder,
for: GoogleApi.Memcache.V1.Model.GoogleCloudMemcacheV1UpgradeInstanceRequest 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 @@ -17,15 +17,15 @@

defmodule GoogleApi.Memcache.V1.Model.GoogleCloudSaasacceleratorManagementProvidersV1Instance do
@moduledoc """
Instance represents the interface for SLM services to actuate the state of control plane resources. Example Instance in JSON, where consumer-project-number=123456, producer-project-id=cloud-sql: ```json Instance: { "name": "projects/123456/locations/us-east1/instances/prod-instance", "create_time": { "seconds": 1526406431, }, "labels": { "env": "prod", "foo": "bar" }, "state": READY, "software_versions": { "software_update": "cloud-sql-09-28-2018", }, "maintenance_policy_names": { "UpdatePolicy": "projects/123456/locations/us-east1/maintenancePolicies/prod-update-policy", } "tenant_project_id": "cloud-sql-test-tenant", "producer_metadata": { "cloud-sql-tier": "basic", "cloud-sql-instance-size": "1G", }, "provisioned_resources": [ { "resource-type": "compute-instance", "resource-url": "https://www.googleapis.com/compute/v1/projects/cloud-sql/zones/us-east1-b/instances/vm-1", } ], "maintenance_schedules": { "csa_rollout": { "start_time": { "seconds": 1526406431, }, "end_time": { "seconds": 1535406431, }, }, "ncsa_rollout": { "start_time": { "seconds": 1526406431, }, "end_time": { "seconds": 1535406431, }, } }, "consumer_defined_name": "my-sql-instance1", } ``` LINT.IfChange
## Attributes
* `consumerDefinedName` (*type:* `String.t`, *default:* `nil`) - consumer_defined_name is the name that is set by the consumer. On the other hand Name field represents system-assigned id of an instance so consumers are not necessarily aware of it. consumer_defined_name is used for notification/UI purposes for consumer to recognize their instances.
* `consumerDefinedName` (*type:* `String.t`, *default:* `nil`) - consumer_defined_name is the name of the instance set by the service consumers. Generally this is different from the `name` field which reperesents the system-assigned id of the instance which the service consumers do not recognize. This is a required field for tenants onboarding to Maintenance Window notifications (go/slm-rollout-maintenance-policies#prerequisites).
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the resource was created.
* `instanceType` (*type:* `String.t`, *default:* `nil`) - Optional. The instance_type of this instance of format: projects/{project_number}/locations/{location_id}/instanceTypes/{instance_type_id}. Instance Type represents a high-level tier or SKU of the service that this instance belong to. When enabled(eg: Maintenance Rollout), Rollout uses 'instance_type' along with 'software_versions' to determine whether instance needs an update or not.
* `labels` (*type:* `map()`, *default:* `nil`) - Optional. Resource labels to represent user provided metadata. Each label is a key-value pair, where both the key and the value are arbitrary strings provided by the user.
* `maintenancePolicyNames` (*type:* `map()`, *default:* `nil`) - Optional. Deprecated. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the referenced policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug.
* `maintenancePolicyNames` (*type:* `map()`, *default:* `nil`) - Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the referenced policy must define the same policy type. For details, please refer to go/mr-user-guide. Should not be set if maintenance_settings.maintenance_policies is set.
* `maintenanceSchedules` (*type:* `%{optional(String.t) => GoogleApi.Memcache.V1.Model.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule.t}`, *default:* `nil`) - The MaintenanceSchedule contains the scheduling information of published maintenance schedule with same key as software_versions.
* `maintenanceSettings` (*type:* `GoogleApi.Memcache.V1.Model.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings.t`, *default:* `nil`) - Optional. The MaintenanceSettings associated with instance.
* `name` (*type:* `String.t`, *default:* `nil`) - Unique name of the resource. It uses the form: `projects/{project_number}/locations/{location_id}/instances/{instance_id}` Note: This name is passed, stored and logged across the rollout system. So use of consumer project_id or any other consumer PII in the name is strongly discouraged for wipeout (go/wipeout) compliance. See go/elysium/project_ids#storage-guidance for more details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule GoogleApi.Memcache.V1.Model.GoogleCloudSaasacceleratorManagementProvid
* `exclude` (*type:* `boolean()`, *default:* `nil`) - Optional. Exclude instance from maintenance. When true, rollout service will not attempt maintenance on the instance. Rollout service will include the instance in reported rollout progress as not attempted.
* `isRollback` (*type:* `boolean()`, *default:* `nil`) - Optional. If the update call is triggered from rollback, set the value as true.
* `maintenancePolicies` (*type:* `%{optional(String.t) => GoogleApi.Memcache.V1.Model.MaintenancePolicy.t}`, *default:* `nil`) - Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the embedded policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug. If only the name is needed, then only populate MaintenancePolicy.name.
* `maintenancePolicies` (*type:* `%{optional(String.t) => GoogleApi.Memcache.V1.Model.MaintenancePolicy.t}`, *default:* `nil`) - Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the embedded policy must define the same policy type. For details, please refer to go/mr-user-guide. Should not be set if maintenance_policy_names is set. If only the name is needed, then only populate MaintenancePolicy.name.
"""

use GoogleApi.Gax.ModelBase
Expand Down
3 changes: 3 additions & 0 deletions clients/memcache/lib/google_api/memcache/v1/model/instance.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ defmodule GoogleApi.Memcache.V1.Model.Instance do
* `nodeConfig` (*type:* `GoogleApi.Memcache.V1.Model.NodeConfig.t`, *default:* `nil`) - Required. Configuration for Memcached nodes.
* `nodeCount` (*type:* `integer()`, *default:* `nil`) - Required. Number of nodes in the Memcached instance.
* `parameters` (*type:* `GoogleApi.Memcache.V1.Model.MemcacheParameters.t`, *default:* `nil`) - User defined parameters to apply to the memcached process on each node.
* `reservedIpRangeId` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Contains the id of allocated IP address ranges associated with the private service access connection for example, "test-default" associated with IP range 10.0.0.0/29.
* `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of this Memcached instance.
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the instance was updated.
* `zones` (*type:* `list(String.t)`, *default:* `nil`) - Zones in which Memcached nodes should be provisioned. Memcached nodes will be equally distributed across these zones. If not provided, the service will by default create nodes in all zones in the region for the instance.
Expand All @@ -60,6 +61,7 @@ defmodule GoogleApi.Memcache.V1.Model.Instance do
:nodeConfig => GoogleApi.Memcache.V1.Model.NodeConfig.t() | nil,
:nodeCount => integer() | nil,
:parameters => GoogleApi.Memcache.V1.Model.MemcacheParameters.t() | nil,
:reservedIpRangeId => list(String.t()) | nil,
:state => String.t() | nil,
:updateTime => DateTime.t() | nil,
:zones => list(String.t()) | nil
Expand All @@ -82,6 +84,7 @@ defmodule GoogleApi.Memcache.V1.Model.Instance do
field(:nodeConfig, as: GoogleApi.Memcache.V1.Model.NodeConfig)
field(:nodeCount)
field(:parameters, as: GoogleApi.Memcache.V1.Model.MemcacheParameters)
field(:reservedIpRangeId, type: :list)
field(:state)
field(:updateTime, as: DateTime)
field(:zones, type: :list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.Memcache.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 @@ -17,7 +17,7 @@

defmodule GoogleApi.Memcache.V1.Model.MaintenancePolicy do
@moduledoc """
Defines policies to service maintenance events.
LINT.IfChange Defines policies to service maintenance events.
## Attributes
Expand Down
6 changes: 6 additions & 0 deletions clients/memcache/lib/google_api/memcache/v1/model/node.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ defmodule GoogleApi.Memcache.V1.Model.Node do
## Attributes
* `host` (*type:* `String.t`, *default:* `nil`) - Output only. Hostname or IP address of the Memcached node used by the clients to connect to the Memcached server on this node.
* `memcacheFullVersion` (*type:* `String.t`, *default:* `nil`) - Output only. The full version of memcached server running on this node. e.g. - memcached-1.5.16
* `memcacheVersion` (*type:* `String.t`, *default:* `nil`) - Output only. Major version of memcached server running on this node, e.g. MEMCACHE_1_5
* `nodeId` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier of the Memcached node. The node id does not include project or location like the Memcached instance name.
* `parameters` (*type:* `GoogleApi.Memcache.V1.Model.MemcacheParameters.t`, *default:* `nil`) - User defined parameters currently applied to the node.
* `port` (*type:* `integer()`, *default:* `nil`) - Output only. The port number of the Memcached server on this node.
Expand All @@ -33,6 +35,8 @@ defmodule GoogleApi.Memcache.V1.Model.Node do

@type t :: %__MODULE__{
:host => String.t() | nil,
:memcacheFullVersion => String.t() | nil,
:memcacheVersion => String.t() | nil,
:nodeId => String.t() | nil,
:parameters => GoogleApi.Memcache.V1.Model.MemcacheParameters.t() | nil,
:port => integer() | nil,
Expand All @@ -41,6 +45,8 @@ defmodule GoogleApi.Memcache.V1.Model.Node do
}

field(:host)
field(:memcacheFullVersion)
field(:memcacheVersion)
field(:nodeId)
field(:parameters, as: GoogleApi.Memcache.V1.Model.MemcacheParameters)
field(:port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Memcache.V1.Model.Operation do
* `error` (*type:* `GoogleApi.Memcache.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
Loading

0 comments on commit 356319e

Please sign in to comment.