Skip to content

Commit

Permalink
feat: Automated regeneration of CloudBuild client
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Mar 12, 2024
1 parent 7ac1a0b commit 51a1386
Show file tree
Hide file tree
Showing 34 changed files with 382 additions and 466 deletions.
118 changes: 98 additions & 20 deletions clients/cloud_build/lib/google_api/cloud_build/v1/api/projects.ex

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.CloudBuild.V1 do
API client metadata for GoogleApi.CloudBuild.V1.
"""

@discovery_revision "20221103"
@discovery_revision "20240305"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.ArtifactResult do
## Attributes
* `fileHash` (*type:* `list(GoogleApi.CloudBuild.V1.Model.FileHashes.t)`, *default:* `nil`) - The file hash of the artifact.
* `location` (*type:* `String.t`, *default:* `nil`) - The path of an artifact in a Google Cloud Storage bucket, with the generation number. For example, `gs://mybucket/path/to/output.jar#generation`.
* `location` (*type:* `String.t`, *default:* `nil`) - The path of an artifact in a Cloud Storage bucket, with the generation number. For example, `gs://mybucket/path/to/output.jar#generation`.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.Artifacts do
* `images` (*type:* `list(String.t)`, *default:* `nil`) - A list of images to be pushed upon the successful completion of all build steps. The images will be pushed using the builder service account's credentials. The digests of the pushed images will be stored in the Build resource's results field. If any of the images fail to be pushed, the build is marked FAILURE.
* `mavenArtifacts` (*type:* `list(GoogleApi.CloudBuild.V1.Model.MavenArtifact.t)`, *default:* `nil`) - A list of Maven artifacts to be uploaded to Artifact Registry upon successful completion of all build steps. Artifacts in the workspace matching specified paths globs will be uploaded to the specified Artifact Registry repository using the builder service account's credentials. If any artifacts fail to be pushed, the build is marked FAILURE.
* `npmPackages` (*type:* `list(GoogleApi.CloudBuild.V1.Model.NpmPackage.t)`, *default:* `nil`) - A list of npm packages to be uploaded to Artifact Registry upon successful completion of all build steps. Npm packages in the specified paths will be uploaded to the specified Artifact Registry repository using the builder service account's credentials. If any packages fail to be pushed, the build is marked FAILURE.
* `objects` (*type:* `GoogleApi.CloudBuild.V1.Model.ArtifactObjects.t`, *default:* `nil`) - A list of objects to be uploaded to Cloud Storage upon successful completion of all build steps. Files in the workspace matching specified paths globs will be uploaded to the specified Cloud Storage location using the builder service account's credentials. The location and generation of the uploaded objects will be stored in the Build resource's results field. If any objects fail to be pushed, the build is marked FAILURE.
* `pythonPackages` (*type:* `list(GoogleApi.CloudBuild.V1.Model.PythonPackage.t)`, *default:* `nil`) - A list of Python packages to be uploaded to Artifact Registry upon successful completion of all build steps. The build service account credentials will be used to perform the upload. If any objects fail to be pushed, the build is marked FAILURE.
"""
Expand All @@ -32,12 +33,14 @@ defmodule GoogleApi.CloudBuild.V1.Model.Artifacts do
@type t :: %__MODULE__{
:images => list(String.t()) | nil,
:mavenArtifacts => list(GoogleApi.CloudBuild.V1.Model.MavenArtifact.t()) | nil,
:npmPackages => list(GoogleApi.CloudBuild.V1.Model.NpmPackage.t()) | nil,
:objects => GoogleApi.CloudBuild.V1.Model.ArtifactObjects.t() | nil,
:pythonPackages => list(GoogleApi.CloudBuild.V1.Model.PythonPackage.t()) | nil
}

field(:images, type: :list)
field(:mavenArtifacts, as: GoogleApi.CloudBuild.V1.Model.MavenArtifact, type: :list)
field(:npmPackages, as: GoogleApi.CloudBuild.V1.Model.NpmPackage, type: :list)
field(:objects, as: GoogleApi.CloudBuild.V1.Model.ArtifactObjects)
field(:pythonPackages, as: GoogleApi.CloudBuild.V1.Model.PythonPackage, type: :list)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.BitbucketServerConfig do
* `hostUri` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The URI of the Bitbucket Server host. Once this field has been set, it cannot be changed. If you need to change it, please create another BitbucketServerConfig.
* `name` (*type:* `String.t`, *default:* `nil`) - The resource name for the config.
* `peeredNetwork` (*type:* `String.t`, *default:* `nil`) - Optional. The network to be used when reaching out to the Bitbucket Server instance. The VPC network must be enabled for private service connection. This should be set if the Bitbucket Server instance is hosted on-premises and not reachable by public internet. If this field is left empty, no network peering will occur and calls to the Bitbucket Server instance will be made over the public internet. Must be in the format `projects/{project}/global/networks/{network}`, where {project} is a project number or id and {network} is the name of a VPC network in the project.
* `peeredNetworkIpRange` (*type:* `String.t`, *default:* `nil`) - Immutable. IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a 29 bit prefix size. `/16` would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of `/24` will be used. The field only has an effect if peered_network is set.
* `secrets` (*type:* `GoogleApi.CloudBuild.V1.Model.BitbucketServerSecrets.t`, *default:* `nil`) - Required. Secret Manager secrets needed by the config.
* `sslCa` (*type:* `String.t`, *default:* `nil`) - Optional. SSL certificate to use for requests to Bitbucket Server. The format should be PEM format but the extension can be one of .pem, .cer, or .crt.
* `username` (*type:* `String.t`, *default:* `nil`) - Username of the account Cloud Build will use on Bitbucket Server.
Expand All @@ -43,6 +44,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.BitbucketServerConfig do
:hostUri => String.t() | nil,
:name => String.t() | nil,
:peeredNetwork => String.t() | nil,
:peeredNetworkIpRange => String.t() | nil,
:secrets => GoogleApi.CloudBuild.V1.Model.BitbucketServerSecrets.t() | nil,
:sslCa => String.t() | nil,
:username => String.t() | nil,
Expand All @@ -60,6 +62,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.BitbucketServerConfig do
field(:hostUri)
field(:name)
field(:peeredNetwork)
field(:peeredNetworkIpRange)
field(:secrets, as: GoogleApi.CloudBuild.V1.Model.BitbucketServerSecrets)
field(:sslCa)
field(:username)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.Build do
* `id` (*type:* `String.t`, *default:* `nil`) - Output only. Unique identifier of the build.
* `images` (*type:* `list(String.t)`, *default:* `nil`) - A list of images to be pushed upon the successful completion of all build steps. The images are pushed using the builder service account's credentials. The digests of the pushed images will be stored in the `Build` resource's results field. If any of the images fail to be pushed, the build status is marked `FAILURE`.
* `logUrl` (*type:* `String.t`, *default:* `nil`) - Output only. URL to logs for this build in Google Cloud Console.
* `logsBucket` (*type:* `String.t`, *default:* `nil`) - Google Cloud Storage bucket where logs should be written (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`.
* `logsBucket` (*type:* `String.t`, *default:* `nil`) - Cloud Storage bucket where logs should be written (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`.
* `name` (*type:* `String.t`, *default:* `nil`) - Output only. The 'Build' name with format: `projects/{project}/locations/{location}/builds/{build}`, where {build} is a unique identifier generated by the service.
* `options` (*type:* `GoogleApi.CloudBuild.V1.Model.BuildOptions.t`, *default:* `nil`) - Special options for this build.
* `projectId` (*type:* `String.t`, *default:* `nil`) - Output only. ID of the project.
Expand All @@ -47,7 +47,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.Build do
* `steps` (*type:* `list(GoogleApi.CloudBuild.V1.Model.BuildStep.t)`, *default:* `nil`) - Required. The operations to be performed on the workspace.
* `substitutions` (*type:* `map()`, *default:* `nil`) - Substitutions data for `Build` resource.
* `tags` (*type:* `list(String.t)`, *default:* `nil`) - Tags for annotation of a `Build`. These are not docker tags.
* `timeout` (*type:* `String.t`, *default:* `nil`) - Amount of time that this build should be allowed to run, to second granularity. If this amount of time elapses, work on the build will cease and the build status will be `TIMEOUT`. `timeout` starts ticking from `startTime`. Default time is ten minutes.
* `timeout` (*type:* `String.t`, *default:* `nil`) - Amount of time that this build should be allowed to run, to second granularity. If this amount of time elapses, work on the build will cease and the build status will be `TIMEOUT`. `timeout` starts ticking from `startTime`. Default time is 60 minutes.
* `timing` (*type:* `%{optional(String.t) => GoogleApi.CloudBuild.V1.Model.TimeSpan.t}`, *default:* `nil`) - Output only. Stores timing information for phases of the build. Valid keys are: * BUILD: time to execute all build steps. * PUSH: time to push all artifacts including docker images and non docker artifacts. * FETCHSOURCE: time to fetch source. * SETUPBUILD: time to set up build. If the build does not specify source or images, these keys will not be included.
* `warnings` (*type:* `list(GoogleApi.CloudBuild.V1.Model.Warning.t)`, *default:* `nil`) - Output only. Non-fatal problems encountered during the execution of the build.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ defmodule GoogleApi.CloudBuild.V1.Model.BuildOptions do
## Attributes
* `diskSizeGb` (*type:* `String.t`, *default:* `nil`) - Requested disk size for the VM that runs the build. Note that this is *NOT* "disk free"; some of the space will be used by the operating system and build utilities. Also note that this is the minimum disk size that will be allocated for the build -- the build may run with a larger disk than requested. At present, the maximum disk size is 1000GB; builds that request more than the maximum are rejected with an error.
* `automapSubstitutions` (*type:* `boolean()`, *default:* `nil`) - Option to include built-in and custom substitutions as env variables for all build steps.
* `defaultLogsBucketBehavior` (*type:* `String.t`, *default:* `nil`) - Optional. Option to specify how default logs buckets are setup.
* `diskSizeGb` (*type:* `String.t`, *default:* `nil`) - Requested disk size for the VM that runs the build. Note that this is *NOT* "disk free"; some of the space will be used by the operating system and build utilities. Also note that this is the minimum disk size that will be allocated for the build -- the build may run with a larger disk than requested. At present, the maximum disk size is 2000GB; builds that request more than the maximum are rejected with an error.
* `dynamicSubstitutions` (*type:* `boolean()`, *default:* `nil`) - Option to specify whether or not to apply bash style string operations to the substitutions. NOTE: this is always enabled for triggered builds and cannot be overridden in the build configuration file.
* `env` (*type:* `list(String.t)`, *default:* `nil`) - A list of global environment variable definitions that will exist for all build steps in this build. If a variable is defined in both globally and in a build step, the variable will use the build step value. The elements are of the form "KEY=VALUE" for the environment variable "KEY" being given the value "VALUE".
* `logStreamingOption` (*type:* `String.t`, *default:* `nil`) - Option to define build log streaming behavior to Google Cloud Storage.
* `logStreamingOption` (*type:* `String.t`, *default:* `nil`) - Option to define build log streaming behavior to Cloud Storage.
* `logging` (*type:* `String.t`, *default:* `nil`) - Option to specify the logging mode, which determines if and where build logs are stored.
* `machineType` (*type:* `String.t`, *default:* `nil`) - Compute Engine machine type on which to run the build.
* `pool` (*type:* `GoogleApi.CloudBuild.V1.Model.PoolOption.t`, *default:* `nil`) - Optional. Specification for execution on a `WorkerPool`. See [running builds in a private pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) for more information.
Expand All @@ -39,6 +41,8 @@ defmodule GoogleApi.CloudBuild.V1.Model.BuildOptions do
use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:automapSubstitutions => boolean() | nil,
:defaultLogsBucketBehavior => String.t() | nil,
:diskSizeGb => String.t() | nil,
:dynamicSubstitutions => boolean() | nil,
:env => list(String.t()) | nil,
Expand All @@ -54,6 +58,8 @@ defmodule GoogleApi.CloudBuild.V1.Model.BuildOptions do
:workerPool => String.t() | nil
}

field(:automapSubstitutions)
field(:defaultLogsBucketBehavior)
field(:diskSizeGb)
field(:dynamicSubstitutions)
field(:env, type: :list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.BuildStep do
* `allowExitCodes` (*type:* `list(integer())`, *default:* `nil`) - Allow this build step to fail without failing the entire build if and only if the exit code is one of the specified codes. If allow_failure is also specified, this field will take precedence.
* `allowFailure` (*type:* `boolean()`, *default:* `nil`) - Allow this build step to fail without failing the entire build. If false, the entire build will fail if this step fails. Otherwise, the build will succeed, but this step will still have a failure status. Error information will be reported in the failure_detail field.
* `args` (*type:* `list(String.t)`, *default:* `nil`) - A list of arguments that will be presented to the step when it is started. If the image used to run the step's container has an entrypoint, the `args` are used as arguments to that entrypoint. If the image does not define an entrypoint, the first element in args is used as the entrypoint, and the remainder will be used as arguments.
* `automapSubstitutions` (*type:* `boolean()`, *default:* `nil`) - Option to include built-in and custom substitutions as env variables for this build step. This option will override the global option in BuildOption.
* `dir` (*type:* `String.t`, *default:* `nil`) - Working directory to use when running this step's container. If this value is a relative path, it is relative to the build's working directory. If this value is absolute, it may be outside the build's working directory, in which case the contents of the path may not be persisted across build step executions, unless a `volume` for that path is specified. If the build specifies a `RepoSource` with `dir` and a step with a `dir`, which specifies an absolute path, the `RepoSource` `dir` is ignored for the step's execution.
* `entrypoint` (*type:* `String.t`, *default:* `nil`) - Entrypoint to be used instead of the build step image's default entrypoint. If unset, the image's default entrypoint is used.
* `env` (*type:* `list(String.t)`, *default:* `nil`) - A list of environment variable definitions to be used when running a step. The elements are of the form "KEY=VALUE" for the environment variable "KEY" being given the value "VALUE".
Expand All @@ -46,6 +47,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.BuildStep do
:allowExitCodes => list(integer()) | nil,
:allowFailure => boolean() | nil,
:args => list(String.t()) | nil,
:automapSubstitutions => boolean() | nil,
:dir => String.t() | nil,
:entrypoint => String.t() | nil,
:env => list(String.t()) | nil,
Expand All @@ -65,6 +67,7 @@ defmodule GoogleApi.CloudBuild.V1.Model.BuildStep do
field(:allowExitCodes, type: :list)
field(:allowFailure)
field(:args, type: :list)
field(:automapSubstitutions)
field(:dir)
field(:entrypoint)
field(:env, type: :list)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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.CloudBuild.V1.Model.ConnectedRepository do
@moduledoc """
Location of the source in a 2nd-gen Google Cloud Build repository resource.
## Attributes
* `dir` (*type:* `String.t`, *default:* `nil`) - Directory, relative to the source root, in which to run the build.
* `repository` (*type:* `String.t`, *default:* `nil`) - Required. Name of the Google Cloud Build repository, formatted as `projects/*/locations/*/connections/*/repositories/*`.
* `revision` (*type:* `String.t`, *default:* `nil`) - The revision to fetch from the Git repository such as a branch, a tag, a commit SHA, or any Git ref.
"""

use GoogleApi.Gax.ModelBase

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

field(:dir)
field(:repository)
field(:revision)
end

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

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

0 comments on commit 51a1386

Please sign in to comment.