Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

2237 rader
79 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package cloudbuild provides access to the Cloud Build API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/cloud-build/docs/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/cloudbuild/v1alpha1"
  14. // ...
  15. // ctx := context.Background()
  16. // cloudbuildService, err := cloudbuild.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // cloudbuildService, err := cloudbuild.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // cloudbuildService, err := cloudbuild.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package cloudbuild // import "google.golang.org/api/cloudbuild/v1alpha1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "cloudbuild:v1alpha1"
  67. const apiName = "cloudbuild"
  68. const apiVersion = "v1alpha1"
  69. const basePath = "https://cloudbuild.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Projects = NewProjectsService(s)
  106. return s, nil
  107. }
  108. type Service struct {
  109. client *http.Client
  110. BasePath string // API endpoint base URL
  111. UserAgent string // optional additional User-Agent fragment
  112. Projects *ProjectsService
  113. }
  114. func (s *Service) userAgent() string {
  115. if s.UserAgent == "" {
  116. return googleapi.UserAgent
  117. }
  118. return googleapi.UserAgent + " " + s.UserAgent
  119. }
  120. func NewProjectsService(s *Service) *ProjectsService {
  121. rs := &ProjectsService{s: s}
  122. rs.WorkerPools = NewProjectsWorkerPoolsService(s)
  123. return rs
  124. }
  125. type ProjectsService struct {
  126. s *Service
  127. WorkerPools *ProjectsWorkerPoolsService
  128. }
  129. func NewProjectsWorkerPoolsService(s *Service) *ProjectsWorkerPoolsService {
  130. rs := &ProjectsWorkerPoolsService{s: s}
  131. return rs
  132. }
  133. type ProjectsWorkerPoolsService struct {
  134. s *Service
  135. }
  136. // ArtifactObjects: Files in the workspace to upload to Cloud Storage
  137. // upon successful
  138. // completion of all build steps.
  139. type ArtifactObjects struct {
  140. // Location: Cloud Storage bucket and optional object path, in the
  141. // form
  142. // "gs://bucket/path/to/somewhere/". (see [Bucket
  143. // Name
  144. // Requirements](https://cloud.google.com/storage/docs/bucket-naming
  145. // #requirements)).
  146. //
  147. // Files in the workspace matching any path pattern will be uploaded
  148. // to
  149. // Cloud Storage with this location as a prefix.
  150. Location string `json:"location,omitempty"`
  151. // Paths: Path globs used to match files in the build's workspace.
  152. Paths []string `json:"paths,omitempty"`
  153. // Timing: Output only. Stores timing information for pushing all
  154. // artifact objects.
  155. Timing *TimeSpan `json:"timing,omitempty"`
  156. // ForceSendFields is a list of field names (e.g. "Location") to
  157. // unconditionally include in API requests. By default, fields with
  158. // empty values are omitted from API requests. However, any non-pointer,
  159. // non-interface field appearing in ForceSendFields will be sent to the
  160. // server regardless of whether the field is empty or not. This may be
  161. // used to include empty fields in Patch requests.
  162. ForceSendFields []string `json:"-"`
  163. // NullFields is a list of field names (e.g. "Location") to include in
  164. // API requests with the JSON null value. By default, fields with empty
  165. // values are omitted from API requests. However, any field with an
  166. // empty value appearing in NullFields will be sent to the server as
  167. // null. It is an error if a field in this list has a non-empty value.
  168. // This may be used to include null fields in Patch requests.
  169. NullFields []string `json:"-"`
  170. }
  171. func (s *ArtifactObjects) MarshalJSON() ([]byte, error) {
  172. type NoMethod ArtifactObjects
  173. raw := NoMethod(*s)
  174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  175. }
  176. // ArtifactResult: An artifact that was uploaded during a build. This
  177. // is a single record in the artifact manifest JSON file.
  178. type ArtifactResult struct {
  179. // FileHash: The file hash of the artifact.
  180. FileHash []*FileHashes `json:"fileHash,omitempty"`
  181. // Location: The path of an artifact in a Google Cloud Storage bucket,
  182. // with the
  183. // generation number. For
  184. // example,
  185. // `gs://mybucket/path/to/output.jar#generation`.
  186. Location string `json:"location,omitempty"`
  187. // ForceSendFields is a list of field names (e.g. "FileHash") to
  188. // unconditionally include in API requests. By default, fields with
  189. // empty values are omitted from API requests. However, any non-pointer,
  190. // non-interface field appearing in ForceSendFields will be sent to the
  191. // server regardless of whether the field is empty or not. This may be
  192. // used to include empty fields in Patch requests.
  193. ForceSendFields []string `json:"-"`
  194. // NullFields is a list of field names (e.g. "FileHash") to include in
  195. // API requests with the JSON null value. By default, fields with empty
  196. // values are omitted from API requests. However, any field with an
  197. // empty value appearing in NullFields will be sent to the server as
  198. // null. It is an error if a field in this list has a non-empty value.
  199. // This may be used to include null fields in Patch requests.
  200. NullFields []string `json:"-"`
  201. }
  202. func (s *ArtifactResult) MarshalJSON() ([]byte, error) {
  203. type NoMethod ArtifactResult
  204. raw := NoMethod(*s)
  205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  206. }
  207. // Artifacts: Artifacts produced by a build that should be uploaded
  208. // upon
  209. // successful completion of all build steps.
  210. type Artifacts struct {
  211. // Images: A list of images to be pushed upon the successful completion
  212. // of all build
  213. // steps.
  214. //
  215. // The images will be pushed using the builder service account's
  216. // credentials.
  217. //
  218. // The digests of the pushed images will be stored in the Build
  219. // resource's
  220. // results field.
  221. //
  222. // If any of the images fail to be pushed, the build is marked FAILURE.
  223. Images []string `json:"images,omitempty"`
  224. // Objects: A list of objects to be uploaded to Cloud Storage upon
  225. // successful
  226. // completion of all build steps.
  227. //
  228. // Files in the workspace matching specified paths globs will be
  229. // uploaded to
  230. // the specified Cloud Storage location using the builder service
  231. // account's
  232. // credentials.
  233. //
  234. // The location and generation of the uploaded objects will be stored in
  235. // the
  236. // Build resource's results field.
  237. //
  238. // If any objects fail to be pushed, the build is marked FAILURE.
  239. Objects *ArtifactObjects `json:"objects,omitempty"`
  240. // ForceSendFields is a list of field names (e.g. "Images") to
  241. // unconditionally include in API requests. By default, fields with
  242. // empty values are omitted from API requests. However, any non-pointer,
  243. // non-interface field appearing in ForceSendFields will be sent to the
  244. // server regardless of whether the field is empty or not. This may be
  245. // used to include empty fields in Patch requests.
  246. ForceSendFields []string `json:"-"`
  247. // NullFields is a list of field names (e.g. "Images") to include in API
  248. // requests with the JSON null value. By default, fields with empty
  249. // values are omitted from API requests. However, any field with an
  250. // empty value appearing in NullFields will be sent to the server as
  251. // null. It is an error if a field in this list has a non-empty value.
  252. // This may be used to include null fields in Patch requests.
  253. NullFields []string `json:"-"`
  254. }
  255. func (s *Artifacts) MarshalJSON() ([]byte, error) {
  256. type NoMethod Artifacts
  257. raw := NoMethod(*s)
  258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  259. }
  260. // Build: A build resource in the Cloud Build API.
  261. //
  262. // At a high level, a `Build` describes where to find source code, how
  263. // to build
  264. // it (for example, the builder image to run on the source), and where
  265. // to store
  266. // the built artifacts.
  267. //
  268. // Fields can include the following variables, which will be expanded
  269. // when the
  270. // build is created:
  271. //
  272. // - $PROJECT_ID: the project ID of the build.
  273. // - $BUILD_ID: the autogenerated ID of the build.
  274. // - $REPO_NAME: the source repository name specified by RepoSource.
  275. // - $BRANCH_NAME: the branch name specified by RepoSource.
  276. // - $TAG_NAME: the tag name specified by RepoSource.
  277. // - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource
  278. // or
  279. // resolved from the specified branch or tag.
  280. // - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
  281. type Build struct {
  282. // Artifacts: Artifacts produced by the build that should be uploaded
  283. // upon
  284. // successful completion of all build steps.
  285. Artifacts *Artifacts `json:"artifacts,omitempty"`
  286. // BuildTriggerId: Output only. The ID of the `BuildTrigger` that
  287. // triggered this build, if it
  288. // was triggered automatically.
  289. BuildTriggerId string `json:"buildTriggerId,omitempty"`
  290. // CreateTime: Output only. Time at which the request to create the
  291. // build was received.
  292. CreateTime string `json:"createTime,omitempty"`
  293. // FinishTime: Output only. Time at which execution of the build was
  294. // finished.
  295. //
  296. // The difference between finish_time and start_time is the duration of
  297. // the
  298. // build's execution.
  299. FinishTime string `json:"finishTime,omitempty"`
  300. // Id: Output only. Unique identifier of the build.
  301. Id string `json:"id,omitempty"`
  302. // Images: A list of images to be pushed upon the successful completion
  303. // of all build
  304. // steps.
  305. //
  306. // The images are pushed using the builder service account's
  307. // credentials.
  308. //
  309. // The digests of the pushed images will be stored in the `Build`
  310. // resource's
  311. // results field.
  312. //
  313. // If any of the images fail to be pushed, the build status is
  314. // marked
  315. // `FAILURE`.
  316. Images []string `json:"images,omitempty"`
  317. // LogUrl: Output only. URL to logs for this build in Google Cloud
  318. // Console.
  319. LogUrl string `json:"logUrl,omitempty"`
  320. // LogsBucket: Google Cloud Storage bucket where logs should be written
  321. // (see
  322. // [Bucket
  323. // Name
  324. // Requirements](https://cloud.google.com/storage/docs/bucket-naming
  325. // #requirements)).
  326. // Logs file names will be of the format
  327. // `${logs_bucket}/log-${build_id}.txt`.
  328. LogsBucket string `json:"logsBucket,omitempty"`
  329. // Options: Special options for this build.
  330. Options *BuildOptions `json:"options,omitempty"`
  331. // ProjectId: Output only. ID of the project.
  332. ProjectId string `json:"projectId,omitempty"`
  333. // Results: Output only. Results of the build.
  334. Results *Results `json:"results,omitempty"`
  335. // Secrets: Secrets to decrypt using Cloud Key Management Service.
  336. Secrets []*Secret `json:"secrets,omitempty"`
  337. // Source: The location of the source files to build.
  338. Source *Source `json:"source,omitempty"`
  339. // SourceProvenance: Output only. A permanent fixed identifier for
  340. // source.
  341. SourceProvenance *SourceProvenance `json:"sourceProvenance,omitempty"`
  342. // StartTime: Output only. Time at which execution of the build was
  343. // started.
  344. StartTime string `json:"startTime,omitempty"`
  345. // Status: Output only. Status of the build.
  346. //
  347. // Possible values:
  348. // "STATUS_UNKNOWN" - Status of the build is unknown.
  349. // "QUEUED" - Build or step is queued; work has not yet begun.
  350. // "WORKING" - Build or step is being executed.
  351. // "SUCCESS" - Build or step finished successfully.
  352. // "FAILURE" - Build or step failed to complete successfully.
  353. // "INTERNAL_ERROR" - Build or step failed due to an internal cause.
  354. // "TIMEOUT" - Build or step took longer than was allowed.
  355. // "CANCELLED" - Build or step was canceled by a user.
  356. Status string `json:"status,omitempty"`
  357. // StatusDetail: Output only. Customer-readable message about the
  358. // current status.
  359. StatusDetail string `json:"statusDetail,omitempty"`
  360. // Steps: Required. The operations to be performed on the workspace.
  361. Steps []*BuildStep `json:"steps,omitempty"`
  362. // Substitutions: Substitutions data for `Build` resource.
  363. Substitutions map[string]string `json:"substitutions,omitempty"`
  364. // Tags: Tags for annotation of a `Build`. These are not docker tags.
  365. Tags []string `json:"tags,omitempty"`
  366. // Timeout: Amount of time that this build should be allowed to run, to
  367. // second
  368. // granularity. If this amount of time elapses, work on the build will
  369. // cease
  370. // and the build status will be `TIMEOUT`.
  371. //
  372. // Default time is ten minutes.
  373. Timeout string `json:"timeout,omitempty"`
  374. // Timing: Output only. Stores timing information for phases of the
  375. // build. Valid keys
  376. // are:
  377. //
  378. // * BUILD: time to execute all build steps
  379. // * PUSH: time to push all specified images.
  380. // * FETCHSOURCE: time to fetch source.
  381. //
  382. // If the build does not specify source or images,
  383. // these keys will not be included.
  384. Timing map[string]TimeSpan `json:"timing,omitempty"`
  385. // ForceSendFields is a list of field names (e.g. "Artifacts") to
  386. // unconditionally include in API requests. By default, fields with
  387. // empty values are omitted from API requests. However, any non-pointer,
  388. // non-interface field appearing in ForceSendFields will be sent to the
  389. // server regardless of whether the field is empty or not. This may be
  390. // used to include empty fields in Patch requests.
  391. ForceSendFields []string `json:"-"`
  392. // NullFields is a list of field names (e.g. "Artifacts") to include in
  393. // API requests with the JSON null value. By default, fields with empty
  394. // values are omitted from API requests. However, any field with an
  395. // empty value appearing in NullFields will be sent to the server as
  396. // null. It is an error if a field in this list has a non-empty value.
  397. // This may be used to include null fields in Patch requests.
  398. NullFields []string `json:"-"`
  399. }
  400. func (s *Build) MarshalJSON() ([]byte, error) {
  401. type NoMethod Build
  402. raw := NoMethod(*s)
  403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  404. }
  405. // BuildOperationMetadata: Metadata for build operations.
  406. type BuildOperationMetadata struct {
  407. // Build: The build that the operation is tracking.
  408. Build *Build `json:"build,omitempty"`
  409. // ForceSendFields is a list of field names (e.g. "Build") to
  410. // unconditionally include in API requests. By default, fields with
  411. // empty values are omitted from API requests. However, any non-pointer,
  412. // non-interface field appearing in ForceSendFields will be sent to the
  413. // server regardless of whether the field is empty or not. This may be
  414. // used to include empty fields in Patch requests.
  415. ForceSendFields []string `json:"-"`
  416. // NullFields is a list of field names (e.g. "Build") to include in API
  417. // requests with the JSON null value. By default, fields with empty
  418. // values are omitted from API requests. However, any field with an
  419. // empty value appearing in NullFields will be sent to the server as
  420. // null. It is an error if a field in this list has a non-empty value.
  421. // This may be used to include null fields in Patch requests.
  422. NullFields []string `json:"-"`
  423. }
  424. func (s *BuildOperationMetadata) MarshalJSON() ([]byte, error) {
  425. type NoMethod BuildOperationMetadata
  426. raw := NoMethod(*s)
  427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  428. }
  429. // BuildOptions: Optional arguments to enable specific features of
  430. // builds.
  431. type BuildOptions struct {
  432. // DiskSizeGb: Requested disk size for the VM that runs the build. Note
  433. // that this is *NOT*
  434. // "disk free"; some of the space will be used by the operating system
  435. // and
  436. // build utilities. Also note that this is the minimum disk size that
  437. // will be
  438. // allocated for the build -- the build may run with a larger disk
  439. // than
  440. // requested. At present, the maximum disk size is 1000GB; builds that
  441. // request
  442. // more than the maximum are rejected with an error.
  443. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  444. // Env: A list of global environment variable definitions that will
  445. // exist for all
  446. // build steps in this build. If a variable is defined in both globally
  447. // and in
  448. // a build step, the variable will use the build step value.
  449. //
  450. // The elements are of the form "KEY=VALUE" for the environment variable
  451. // "KEY"
  452. // being given the value "VALUE".
  453. Env []string `json:"env,omitempty"`
  454. // LogStreamingOption: Option to define build log streaming behavior to
  455. // Google Cloud
  456. // Storage.
  457. //
  458. // Possible values:
  459. // "STREAM_DEFAULT" - Service may automatically determine build log
  460. // streaming behavior.
  461. // "STREAM_ON" - Build logs should be streamed to Google Cloud
  462. // Storage.
  463. // "STREAM_OFF" - Build logs should not be streamed to Google Cloud
  464. // Storage; they will be
  465. // written when the build is completed.
  466. LogStreamingOption string `json:"logStreamingOption,omitempty"`
  467. // Logging: Option to specify the logging mode, which determines where
  468. // the logs are
  469. // stored.
  470. //
  471. // Possible values:
  472. // "LOGGING_UNSPECIFIED" - The service determines the logging mode.
  473. // The default is `LEGACY`. Do not
  474. // rely on the default logging behavior as it may change in the future.
  475. // "LEGACY" - Stackdriver logging and Cloud Storage logging are
  476. // enabled.
  477. // "GCS_ONLY" - Only Cloud Storage logging is enabled.
  478. Logging string `json:"logging,omitempty"`
  479. // MachineType: Compute Engine machine type on which to run the build.
  480. //
  481. // Possible values:
  482. // "UNSPECIFIED" - Standard machine type.
  483. // "N1_HIGHCPU_8" - Highcpu machine with 8 CPUs.
  484. // "N1_HIGHCPU_32" - Highcpu machine with 32 CPUs.
  485. MachineType string `json:"machineType,omitempty"`
  486. // RequestedVerifyOption: Requested verifiability options.
  487. //
  488. // Possible values:
  489. // "NOT_VERIFIED" - Not a verifiable build. (default)
  490. // "VERIFIED" - Verified build.
  491. RequestedVerifyOption string `json:"requestedVerifyOption,omitempty"`
  492. // SecretEnv: A list of global environment variables, which are
  493. // encrypted using a Cloud
  494. // Key Management Service crypto key. These values must be specified in
  495. // the
  496. // build's `Secret`. These variables will be available to all build
  497. // steps
  498. // in this build.
  499. SecretEnv []string `json:"secretEnv,omitempty"`
  500. // SourceProvenanceHash: Requested hash for SourceProvenance.
  501. //
  502. // Possible values:
  503. // "NONE" - No hash requested.
  504. // "SHA256" - Use a sha256 hash.
  505. // "MD5" - Use a md5 hash.
  506. SourceProvenanceHash []string `json:"sourceProvenanceHash,omitempty"`
  507. // SubstitutionOption: Option to specify behavior when there is an error
  508. // in the substitution
  509. // checks.
  510. //
  511. // Possible values:
  512. // "MUST_MATCH" - Fails the build if error in substitutions checks,
  513. // like missing
  514. // a substitution in the template or in the map.
  515. // "ALLOW_LOOSE" - Do not fail the build if error in substitutions
  516. // checks.
  517. SubstitutionOption string `json:"substitutionOption,omitempty"`
  518. // Volumes: Global list of volumes to mount for ALL build steps
  519. //
  520. // Each volume is created as an empty volume prior to starting the
  521. // build
  522. // process. Upon completion of the build, volumes and their contents
  523. // are
  524. // discarded. Global volume names and paths cannot conflict with the
  525. // volumes
  526. // defined a build step.
  527. //
  528. // Using a global volume in a build with only one step is not valid
  529. // as
  530. // it is indicative of a build request with an incorrect configuration.
  531. Volumes []*Volume `json:"volumes,omitempty"`
  532. // WorkerPool: Option to specify a `WorkerPool` for the build. User
  533. // specifies the pool
  534. // with the format "[WORKERPOOL_PROJECT_ID]/[WORKERPOOL_NAME]".
  535. // This is an experimental field.
  536. WorkerPool string `json:"workerPool,omitempty"`
  537. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  538. // unconditionally include in API requests. By default, fields with
  539. // empty values are omitted from API requests. However, any non-pointer,
  540. // non-interface field appearing in ForceSendFields will be sent to the
  541. // server regardless of whether the field is empty or not. This may be
  542. // used to include empty fields in Patch requests.
  543. ForceSendFields []string `json:"-"`
  544. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  545. // API requests with the JSON null value. By default, fields with empty
  546. // values are omitted from API requests. However, any field with an
  547. // empty value appearing in NullFields will be sent to the server as
  548. // null. It is an error if a field in this list has a non-empty value.
  549. // This may be used to include null fields in Patch requests.
  550. NullFields []string `json:"-"`
  551. }
  552. func (s *BuildOptions) MarshalJSON() ([]byte, error) {
  553. type NoMethod BuildOptions
  554. raw := NoMethod(*s)
  555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  556. }
  557. // BuildStep: A step in the build pipeline.
  558. type BuildStep struct {
  559. // Args: A list of arguments that will be presented to the step when it
  560. // is started.
  561. //
  562. // If the image used to run the step's container has an entrypoint, the
  563. // `args`
  564. // are used as arguments to that entrypoint. If the image does not
  565. // define
  566. // an entrypoint, the first element in args is used as the
  567. // entrypoint,
  568. // and the remainder will be used as arguments.
  569. Args []string `json:"args,omitempty"`
  570. // Dir: Working directory to use when running this step's container.
  571. //
  572. // If this value is a relative path, it is relative to the build's
  573. // working
  574. // directory. If this value is absolute, it may be outside the build's
  575. // working
  576. // directory, in which case the contents of the path may not be
  577. // persisted
  578. // across build step executions, unless a `volume` for that path is
  579. // specified.
  580. //
  581. // If the build specifies a `RepoSource` with `dir` and a step with a
  582. // `dir`,
  583. // which specifies an absolute path, the `RepoSource` `dir` is ignored
  584. // for
  585. // the step's execution.
  586. Dir string `json:"dir,omitempty"`
  587. // Entrypoint: Entrypoint to be used instead of the build step image's
  588. // default entrypoint.
  589. // If unset, the image's default entrypoint is used.
  590. Entrypoint string `json:"entrypoint,omitempty"`
  591. // Env: A list of environment variable definitions to be used when
  592. // running a step.
  593. //
  594. // The elements are of the form "KEY=VALUE" for the environment variable
  595. // "KEY"
  596. // being given the value "VALUE".
  597. Env []string `json:"env,omitempty"`
  598. // Id: Unique identifier for this build step, used in `wait_for`
  599. // to
  600. // reference this build step as a dependency.
  601. Id string `json:"id,omitempty"`
  602. // Name: Required. The name of the container image that will run this
  603. // particular
  604. // build step.
  605. //
  606. // If the image is available in the host's Docker daemon's cache,
  607. // it
  608. // will be run directly. If not, the host will attempt to pull the
  609. // image
  610. // first, using the builder service account's credentials if
  611. // necessary.
  612. //
  613. // The Docker daemon's cache will already have the latest versions of
  614. // all of
  615. // the officially supported build
  616. // steps
  617. // ([https://github.com/GoogleCloudPlatform/cloud-builders](https:/
  618. // /github.com/GoogleCloudPlatform/cloud-builders)).
  619. // The Docker daemon will also have cached many of the layers for some
  620. // popular
  621. // images, like "ubuntu", "debian", but they will be refreshed at the
  622. // time you
  623. // attempt to use them.
  624. //
  625. // If you built an image in a previous build step, it will be stored in
  626. // the
  627. // host's Docker daemon's cache and is available to use as the name for
  628. // a
  629. // later build step.
  630. Name string `json:"name,omitempty"`
  631. // PullTiming: Output only. Stores timing information for pulling this
  632. // build step's
  633. // builder image only.
  634. PullTiming *TimeSpan `json:"pullTiming,omitempty"`
  635. // SecretEnv: A list of environment variables which are encrypted using
  636. // a Cloud Key
  637. // Management Service crypto key. These values must be specified in
  638. // the
  639. // build's `Secret`.
  640. SecretEnv []string `json:"secretEnv,omitempty"`
  641. // Status: Output only. Status of the build step. At this time, build
  642. // step status is
  643. // only updated on build completion; step status is not updated in
  644. // real-time
  645. // as the build progresses.
  646. //
  647. // Possible values:
  648. // "STATUS_UNKNOWN" - Status of the build is unknown.
  649. // "QUEUED" - Build or step is queued; work has not yet begun.
  650. // "WORKING" - Build or step is being executed.
  651. // "SUCCESS" - Build or step finished successfully.
  652. // "FAILURE" - Build or step failed to complete successfully.
  653. // "INTERNAL_ERROR" - Build or step failed due to an internal cause.
  654. // "TIMEOUT" - Build or step took longer than was allowed.
  655. // "CANCELLED" - Build or step was canceled by a user.
  656. Status string `json:"status,omitempty"`
  657. // Timeout: Time limit for executing this build step. If not defined,
  658. // the step has no
  659. // time limit and will be allowed to continue to run until either it
  660. // completes
  661. // or the build itself times out.
  662. Timeout string `json:"timeout,omitempty"`
  663. // Timing: Output only. Stores timing information for executing this
  664. // build step.
  665. Timing *TimeSpan `json:"timing,omitempty"`
  666. // Volumes: List of volumes to mount into the build step.
  667. //
  668. // Each volume is created as an empty volume prior to execution of
  669. // the
  670. // build step. Upon completion of the build, volumes and their contents
  671. // are
  672. // discarded.
  673. //
  674. // Using a named volume in only one step is not valid as it is
  675. // indicative
  676. // of a build request with an incorrect configuration.
  677. Volumes []*Volume `json:"volumes,omitempty"`
  678. // WaitFor: The ID(s) of the step(s) that this build step depends
  679. // on.
  680. // This build step will not start until all the build steps in
  681. // `wait_for`
  682. // have completed successfully. If `wait_for` is empty, this build step
  683. // will
  684. // start when all previous build steps in the `Build.Steps` list
  685. // have
  686. // completed successfully.
  687. WaitFor []string `json:"waitFor,omitempty"`
  688. // ForceSendFields is a list of field names (e.g. "Args") to
  689. // unconditionally include in API requests. By default, fields with
  690. // empty values are omitted from API requests. However, any non-pointer,
  691. // non-interface field appearing in ForceSendFields will be sent to the
  692. // server regardless of whether the field is empty or not. This may be
  693. // used to include empty fields in Patch requests.
  694. ForceSendFields []string `json:"-"`
  695. // NullFields is a list of field names (e.g. "Args") to include in API
  696. // requests with the JSON null value. By default, fields with empty
  697. // values are omitted from API requests. However, any field with an
  698. // empty value appearing in NullFields will be sent to the server as
  699. // null. It is an error if a field in this list has a non-empty value.
  700. // This may be used to include null fields in Patch requests.
  701. NullFields []string `json:"-"`
  702. }
  703. func (s *BuildStep) MarshalJSON() ([]byte, error) {
  704. type NoMethod BuildStep
  705. raw := NoMethod(*s)
  706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  707. }
  708. // BuiltImage: An image built by the pipeline.
  709. type BuiltImage struct {
  710. // Digest: Docker Registry 2.0 digest.
  711. Digest string `json:"digest,omitempty"`
  712. // Name: Name used to push the container image to Google Container
  713. // Registry, as
  714. // presented to `docker push`.
  715. Name string `json:"name,omitempty"`
  716. // PushTiming: Output only. Stores timing information for pushing the
  717. // specified image.
  718. PushTiming *TimeSpan `json:"pushTiming,omitempty"`
  719. // ForceSendFields is a list of field names (e.g. "Digest") to
  720. // unconditionally include in API requests. By default, fields with
  721. // empty values are omitted from API requests. However, any non-pointer,
  722. // non-interface field appearing in ForceSendFields will be sent to the
  723. // server regardless of whether the field is empty or not. This may be
  724. // used to include empty fields in Patch requests.
  725. ForceSendFields []string `json:"-"`
  726. // NullFields is a list of field names (e.g. "Digest") to include in API
  727. // requests with the JSON null value. By default, fields with empty
  728. // values are omitted from API requests. However, any field with an
  729. // empty value appearing in NullFields will be sent to the server as
  730. // null. It is an error if a field in this list has a non-empty value.
  731. // This may be used to include null fields in Patch requests.
  732. NullFields []string `json:"-"`
  733. }
  734. func (s *BuiltImage) MarshalJSON() ([]byte, error) {
  735. type NoMethod BuiltImage
  736. raw := NoMethod(*s)
  737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  738. }
  739. // Empty: A generic empty message that you can re-use to avoid defining
  740. // duplicated
  741. // empty messages in your APIs. A typical example is to use it as the
  742. // request
  743. // or the response type of an API method. For instance:
  744. //
  745. // service Foo {
  746. // rpc Bar(google.protobuf.Empty) returns
  747. // (google.protobuf.Empty);
  748. // }
  749. //
  750. // The JSON representation for `Empty` is empty JSON object `{}`.
  751. type Empty struct {
  752. // ServerResponse contains the HTTP response code and headers from the
  753. // server.
  754. googleapi.ServerResponse `json:"-"`
  755. }
  756. // FileHashes: Container message for hashes of byte content of files,
  757. // used in
  758. // SourceProvenance messages to verify integrity of source input to the
  759. // build.
  760. type FileHashes struct {
  761. // FileHash: Collection of file hashes.
  762. FileHash []*Hash `json:"fileHash,omitempty"`
  763. // ForceSendFields is a list of field names (e.g. "FileHash") to
  764. // unconditionally include in API requests. By default, fields with
  765. // empty values are omitted from API requests. However, any non-pointer,
  766. // non-interface field appearing in ForceSendFields will be sent to the
  767. // server regardless of whether the field is empty or not. This may be
  768. // used to include empty fields in Patch requests.
  769. ForceSendFields []string `json:"-"`
  770. // NullFields is a list of field names (e.g. "FileHash") to include in
  771. // API requests with the JSON null value. By default, fields with empty
  772. // values are omitted from API requests. However, any field with an
  773. // empty value appearing in NullFields will be sent to the server as
  774. // null. It is an error if a field in this list has a non-empty value.
  775. // This may be used to include null fields in Patch requests.
  776. NullFields []string `json:"-"`
  777. }
  778. func (s *FileHashes) MarshalJSON() ([]byte, error) {
  779. type NoMethod FileHashes
  780. raw := NoMethod(*s)
  781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  782. }
  783. // Hash: Container message for hash values.
  784. type Hash struct {
  785. // Type: The type of hash that was performed.
  786. //
  787. // Possible values:
  788. // "NONE" - No hash requested.
  789. // "SHA256" - Use a sha256 hash.
  790. // "MD5" - Use a md5 hash.
  791. Type string `json:"type,omitempty"`
  792. // Value: The hash value.
  793. Value string `json:"value,omitempty"`
  794. // ForceSendFields is a list of field names (e.g. "Type") to
  795. // unconditionally include in API requests. By default, fields with
  796. // empty values are omitted from API requests. However, any non-pointer,
  797. // non-interface field appearing in ForceSendFields will be sent to the
  798. // server regardless of whether the field is empty or not. This may be
  799. // used to include empty fields in Patch requests.
  800. ForceSendFields []string `json:"-"`
  801. // NullFields is a list of field names (e.g. "Type") to include in API
  802. // requests with the JSON null value. By default, fields with empty
  803. // values are omitted from API requests. However, any field with an
  804. // empty value appearing in NullFields will be sent to the server as
  805. // null. It is an error if a field in this list has a non-empty value.
  806. // This may be used to include null fields in Patch requests.
  807. NullFields []string `json:"-"`
  808. }
  809. func (s *Hash) MarshalJSON() ([]byte, error) {
  810. type NoMethod Hash
  811. raw := NoMethod(*s)
  812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  813. }
  814. // ListWorkerPoolsResponse: Response containing existing `WorkerPools`.
  815. type ListWorkerPoolsResponse struct {
  816. // WorkerPools: `WorkerPools` for the project.
  817. WorkerPools []*WorkerPool `json:"workerPools,omitempty"`
  818. // ServerResponse contains the HTTP response code and headers from the
  819. // server.
  820. googleapi.ServerResponse `json:"-"`
  821. // ForceSendFields is a list of field names (e.g. "WorkerPools") to
  822. // unconditionally include in API requests. By default, fields with
  823. // empty values are omitted from API requests. However, any non-pointer,
  824. // non-interface field appearing in ForceSendFields will be sent to the
  825. // server regardless of whether the field is empty or not. This may be
  826. // used to include empty fields in Patch requests.
  827. ForceSendFields []string `json:"-"`
  828. // NullFields is a list of field names (e.g. "WorkerPools") to include
  829. // in API requests with the JSON null value. By default, fields with
  830. // empty values are omitted from API requests. However, any field with
  831. // an empty value appearing in NullFields will be sent to the server as
  832. // null. It is an error if a field in this list has a non-empty value.
  833. // This may be used to include null fields in Patch requests.
  834. NullFields []string `json:"-"`
  835. }
  836. func (s *ListWorkerPoolsResponse) MarshalJSON() ([]byte, error) {
  837. type NoMethod ListWorkerPoolsResponse
  838. raw := NoMethod(*s)
  839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  840. }
  841. // Network: Network describes the GCP network used to create workers in.
  842. type Network struct {
  843. // Network: Network on which the workers are created.
  844. // "default" network is used if empty.
  845. Network string `json:"network,omitempty"`
  846. // ProjectId: Project id containing the defined network and subnetwork.
  847. // For a peered VPC,
  848. // this will be the same as the project_id in which the workers are
  849. // created.
  850. // For a shared VPC, this will be the project sharing the network with
  851. // the
  852. // project_id project in which workers will be created. For custom
  853. // workers
  854. // with no VPC, this will be the same as project_id.
  855. ProjectId string `json:"projectId,omitempty"`
  856. // Subnetwork: Subnetwork on which the workers are created.
  857. // "default" subnetwork is used if empty.
  858. Subnetwork string `json:"subnetwork,omitempty"`
  859. // ForceSendFields is a list of field names (e.g. "Network") to
  860. // unconditionally include in API requests. By default, fields with
  861. // empty values are omitted from API requests. However, any non-pointer,
  862. // non-interface field appearing in ForceSendFields will be sent to the
  863. // server regardless of whether the field is empty or not. This may be
  864. // used to include empty fields in Patch requests.
  865. ForceSendFields []string `json:"-"`
  866. // NullFields is a list of field names (e.g. "Network") to include in
  867. // API requests with the JSON null value. By default, fields with empty
  868. // values are omitted from API requests. However, any field with an
  869. // empty value appearing in NullFields will be sent to the server as
  870. // null. It is an error if a field in this list has a non-empty value.
  871. // This may be used to include null fields in Patch requests.
  872. NullFields []string `json:"-"`
  873. }
  874. func (s *Network) MarshalJSON() ([]byte, error) {
  875. type NoMethod Network
  876. raw := NoMethod(*s)
  877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  878. }
  879. // RepoSource: Location of the source in a Google Cloud Source
  880. // Repository.
  881. type RepoSource struct {
  882. // BranchName: Name of the branch to build.
  883. BranchName string `json:"branchName,omitempty"`
  884. // CommitSha: Explicit commit SHA to build.
  885. CommitSha string `json:"commitSha,omitempty"`
  886. // Dir: Directory, relative to the source root, in which to run the
  887. // build.
  888. //
  889. // This must be a relative path. If a step's `dir` is specified and is
  890. // an
  891. // absolute path, this value is ignored for that step's execution.
  892. Dir string `json:"dir,omitempty"`
  893. // ProjectId: ID of the project that owns the Cloud Source Repository.
  894. // If omitted, the
  895. // project ID requesting the build is assumed.
  896. ProjectId string `json:"projectId,omitempty"`
  897. // RepoName: Name of the Cloud Source Repository. If omitted, the name
  898. // "default" is
  899. // assumed.
  900. RepoName string `json:"repoName,omitempty"`
  901. // TagName: Name of the tag to build.
  902. TagName string `json:"tagName,omitempty"`
  903. // ForceSendFields is a list of field names (e.g. "BranchName") to
  904. // unconditionally include in API requests. By default, fields with
  905. // empty values are omitted from API requests. However, any non-pointer,
  906. // non-interface field appearing in ForceSendFields will be sent to the
  907. // server regardless of whether the field is empty or not. This may be
  908. // used to include empty fields in Patch requests.
  909. ForceSendFields []string `json:"-"`
  910. // NullFields is a list of field names (e.g. "BranchName") to include in
  911. // API requests with the JSON null value. By default, fields with empty
  912. // values are omitted from API requests. However, any field with an
  913. // empty value appearing in NullFields will be sent to the server as
  914. // null. It is an error if a field in this list has a non-empty value.
  915. // This may be used to include null fields in Patch requests.
  916. NullFields []string `json:"-"`
  917. }
  918. func (s *RepoSource) MarshalJSON() ([]byte, error) {
  919. type NoMethod RepoSource
  920. raw := NoMethod(*s)
  921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  922. }
  923. // Results: Artifacts created by the build pipeline.
  924. type Results struct {
  925. // ArtifactManifest: Path to the artifact manifest. Only populated when
  926. // artifacts are uploaded.
  927. ArtifactManifest string `json:"artifactManifest,omitempty"`
  928. // ArtifactTiming: Time to push all non-container artifacts.
  929. ArtifactTiming *TimeSpan `json:"artifactTiming,omitempty"`
  930. // BuildStepImages: List of build step digests, in the order
  931. // corresponding to build step
  932. // indices.
  933. BuildStepImages []string `json:"buildStepImages,omitempty"`
  934. // BuildStepOutputs: List of build step outputs, produced by builder
  935. // images, in the order
  936. // corresponding to build step indices.
  937. //
  938. // [Cloud
  939. // Builders](https://cloud.google.com/cloud-build/docs/cloud-builders)
  940. // ca
  941. // n produce this output by writing to `$BUILDER_OUTPUT/output`.
  942. // Only the first 4KB of data is stored.
  943. BuildStepOutputs []string `json:"buildStepOutputs,omitempty"`
  944. // Images: Container images that were built as a part of the build.
  945. Images []*BuiltImage `json:"images,omitempty"`
  946. // NumArtifacts: Number of artifacts uploaded. Only populated when
  947. // artifacts are uploaded.
  948. NumArtifacts int64 `json:"numArtifacts,omitempty,string"`
  949. // ForceSendFields is a list of field names (e.g. "ArtifactManifest") to
  950. // unconditionally include in API requests. By default, fields with
  951. // empty values are omitted from API requests. However, any non-pointer,
  952. // non-interface field appearing in ForceSendFields will be sent to the
  953. // server regardless of whether the field is empty or not. This may be
  954. // used to include empty fields in Patch requests.
  955. ForceSendFields []string `json:"-"`
  956. // NullFields is a list of field names (e.g. "ArtifactManifest") to
  957. // include in API requests with the JSON null value. By default, fields
  958. // with empty values are omitted from API requests. However, any field
  959. // with an empty value appearing in NullFields will be sent to the
  960. // server as null. It is an error if a field in this list has a
  961. // non-empty value. This may be used to include null fields in Patch
  962. // requests.
  963. NullFields []string `json:"-"`
  964. }
  965. func (s *Results) MarshalJSON() ([]byte, error) {
  966. type NoMethod Results
  967. raw := NoMethod(*s)
  968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  969. }
  970. // Secret: Pairs a set of secret environment variables containing
  971. // encrypted
  972. // values with the Cloud KMS key to use to decrypt the value.
  973. type Secret struct {
  974. // KmsKeyName: Cloud KMS key name to use to decrypt these envs.
  975. KmsKeyName string `json:"kmsKeyName,omitempty"`
  976. // SecretEnv: Map of environment variable name to its encrypted
  977. // value.
  978. //
  979. // Secret environment variables must be unique across all of a
  980. // build's
  981. // secrets, and must be used by at least one build step. Values can be
  982. // at most
  983. // 64 KB in size. There can be at most 100 secret values across all of
  984. // a
  985. // build's secrets.
  986. SecretEnv map[string]string `json:"secretEnv,omitempty"`
  987. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  988. // unconditionally include in API requests. By default, fields with
  989. // empty values are omitted from API requests. However, any non-pointer,
  990. // non-interface field appearing in ForceSendFields will be sent to the
  991. // server regardless of whether the field is empty or not. This may be
  992. // used to include empty fields in Patch requests.
  993. ForceSendFields []string `json:"-"`
  994. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  995. // API requests with the JSON null value. By default, fields with empty
  996. // values are omitted from API requests. However, any field with an
  997. // empty value appearing in NullFields will be sent to the server as
  998. // null. It is an error if a field in this list has a non-empty value.
  999. // This may be used to include null fields in Patch requests.
  1000. NullFields []string `json:"-"`
  1001. }
  1002. func (s *Secret) MarshalJSON() ([]byte, error) {
  1003. type NoMethod Secret
  1004. raw := NoMethod(*s)
  1005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1006. }
  1007. // Source: Location of the source in a supported storage service.
  1008. type Source struct {
  1009. // RepoSource: If provided, get the source from this location in a Cloud
  1010. // Source
  1011. // Repository.
  1012. RepoSource *RepoSource `json:"repoSource,omitempty"`
  1013. // StorageSource: If provided, get the source from this location in
  1014. // Google Cloud Storage.
  1015. StorageSource *StorageSource `json:"storageSource,omitempty"`
  1016. // ForceSendFields is a list of field names (e.g. "RepoSource") to
  1017. // unconditionally include in API requests. By default, fields with
  1018. // empty values are omitted from API requests. However, any non-pointer,
  1019. // non-interface field appearing in ForceSendFields will be sent to the
  1020. // server regardless of whether the field is empty or not. This may be
  1021. // used to include empty fields in Patch requests.
  1022. ForceSendFields []string `json:"-"`
  1023. // NullFields is a list of field names (e.g. "RepoSource") to include in
  1024. // API requests with the JSON null value. By default, fields with empty
  1025. // values are omitted from API requests. However, any field with an
  1026. // empty value appearing in NullFields will be sent to the server as
  1027. // null. It is an error if a field in this list has a non-empty value.
  1028. // This may be used to include null fields in Patch requests.
  1029. NullFields []string `json:"-"`
  1030. }
  1031. func (s *Source) MarshalJSON() ([]byte, error) {
  1032. type NoMethod Source
  1033. raw := NoMethod(*s)
  1034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1035. }
  1036. // SourceProvenance: Provenance of the source. Ways to find the original
  1037. // source, or verify that
  1038. // some source was used for this build.
  1039. type SourceProvenance struct {
  1040. // FileHashes: Output only. Hash(es) of the build source, which can be
  1041. // used to verify that
  1042. // the original source integrity was maintained in the build. Note
  1043. // that
  1044. // `FileHashes` will only be populated if `BuildOptions` has requested
  1045. // a
  1046. // `SourceProvenanceHash`.
  1047. //
  1048. // The keys to this map are file paths used as build source and the
  1049. // values
  1050. // contain the hash values for those files.
  1051. //
  1052. // If the build source came in a single package such as a gzipped
  1053. // tarfile
  1054. // (`.tar.gz`), the `FileHash` will be for the single path to that file.
  1055. FileHashes map[string]FileHashes `json:"fileHashes,omitempty"`
  1056. // ResolvedRepoSource: A copy of the build's `source.repo_source`, if
  1057. // exists, with any
  1058. // revisions resolved.
  1059. ResolvedRepoSource *RepoSource `json:"resolvedRepoSource,omitempty"`
  1060. // ResolvedStorageSource: A copy of the build's `source.storage_source`,
  1061. // if exists, with any
  1062. // generations resolved.
  1063. ResolvedStorageSource *StorageSource `json:"resolvedStorageSource,omitempty"`
  1064. // ForceSendFields is a list of field names (e.g. "FileHashes") to
  1065. // unconditionally include in API requests. By default, fields with
  1066. // empty values are omitted from API requests. However, any non-pointer,
  1067. // non-interface field appearing in ForceSendFields will be sent to the
  1068. // server regardless of whether the field is empty or not. This may be
  1069. // used to include empty fields in Patch requests.
  1070. ForceSendFields []string `json:"-"`
  1071. // NullFields is a list of field names (e.g. "FileHashes") to include in
  1072. // API requests with the JSON null value. By default, fields with empty
  1073. // values are omitted from API requests. However, any field with an
  1074. // empty value appearing in NullFields will be sent to the server as
  1075. // null. It is an error if a field in this list has a non-empty value.
  1076. // This may be used to include null fields in Patch requests.
  1077. NullFields []string `json:"-"`
  1078. }
  1079. func (s *SourceProvenance) MarshalJSON() ([]byte, error) {
  1080. type NoMethod SourceProvenance
  1081. raw := NoMethod(*s)
  1082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1083. }
  1084. // StorageSource: Location of the source in an archive file in Google
  1085. // Cloud Storage.
  1086. type StorageSource struct {
  1087. // Bucket: Google Cloud Storage bucket containing the source
  1088. // (see
  1089. // [Bucket
  1090. // Name
  1091. // Requirements](https://cloud.google.com/storage/docs/bucket-naming
  1092. // #requirements)).
  1093. Bucket string `json:"bucket,omitempty"`
  1094. // Generation: Google Cloud Storage generation for the object. If the
  1095. // generation is
  1096. // omitted, the latest generation will be used.
  1097. Generation int64 `json:"generation,omitempty,string"`
  1098. // Object: Google Cloud Storage object containing the source.
  1099. //
  1100. // This object must be a gzipped archive file (`.tar.gz`) containing
  1101. // source to
  1102. // build.
  1103. Object string `json:"object,omitempty"`
  1104. // ForceSendFields is a list of field names (e.g. "Bucket") to
  1105. // unconditionally include in API requests. By default, fields with
  1106. // empty values are omitted from API requests. However, any non-pointer,
  1107. // non-interface field appearing in ForceSendFields will be sent to the
  1108. // server regardless of whether the field is empty or not. This may be
  1109. // used to include empty fields in Patch requests.
  1110. ForceSendFields []string `json:"-"`
  1111. // NullFields is a list of field names (e.g. "Bucket") to include in API
  1112. // requests with the JSON null value. By default, fields with empty
  1113. // values are omitted from API requests. However, any field with an
  1114. // empty value appearing in NullFields will be sent to the server as
  1115. // null. It is an error if a field in this list has a non-empty value.
  1116. // This may be used to include null fields in Patch requests.
  1117. NullFields []string `json:"-"`
  1118. }
  1119. func (s *StorageSource) MarshalJSON() ([]byte, error) {
  1120. type NoMethod StorageSource
  1121. raw := NoMethod(*s)
  1122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1123. }
  1124. // TimeSpan: Start and end times for a build execution phase.
  1125. type TimeSpan struct {
  1126. // EndTime: End of time span.
  1127. EndTime string `json:"endTime,omitempty"`
  1128. // StartTime: Start of time span.
  1129. StartTime string `json:"startTime,omitempty"`
  1130. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1131. // unconditionally include in API requests. By default, fields with
  1132. // empty values are omitted from API requests. However, any non-pointer,
  1133. // non-interface field appearing in ForceSendFields will be sent to the
  1134. // server regardless of whether the field is empty or not. This may be
  1135. // used to include empty fields in Patch requests.
  1136. ForceSendFields []string `json:"-"`
  1137. // NullFields is a list of field names (e.g. "EndTime") to include in
  1138. // API requests with the JSON null value. By default, fields with empty
  1139. // values are omitted from API requests. However, any field with an
  1140. // empty value appearing in NullFields will be sent to the server as
  1141. // null. It is an error if a field in this list has a non-empty value.
  1142. // This may be used to include null fields in Patch requests.
  1143. NullFields []string `json:"-"`
  1144. }
  1145. func (s *TimeSpan) MarshalJSON() ([]byte, error) {
  1146. type NoMethod TimeSpan
  1147. raw := NoMethod(*s)
  1148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1149. }
  1150. // Volume: Volume describes a Docker container volume which is mounted
  1151. // into build steps
  1152. // in order to persist files across build step execution.
  1153. type Volume struct {
  1154. // Name: Name of the volume to mount.
  1155. //
  1156. // Volume names must be unique per build step and must be valid names
  1157. // for
  1158. // Docker volumes. Each named volume must be used by at least two build
  1159. // steps.
  1160. Name string `json:"name,omitempty"`
  1161. // Path: Path at which to mount the volume.
  1162. //
  1163. // Paths must be absolute and cannot conflict with other volume paths on
  1164. // the
  1165. // same build step or with certain reserved volume paths.
  1166. Path string `json:"path,omitempty"`
  1167. // ForceSendFields is a list of field names (e.g. "Name") to
  1168. // unconditionally include in API requests. By default, fields with
  1169. // empty values are omitted from API requests. However, any non-pointer,
  1170. // non-interface field appearing in ForceSendFields will be sent to the
  1171. // server regardless of whether the field is empty or not. This may be
  1172. // used to include empty fields in Patch requests.
  1173. ForceSendFields []string `json:"-"`
  1174. // NullFields is a list of field names (e.g. "Name") to include in API
  1175. // requests with the JSON null value. By default, fields with empty
  1176. // values are omitted from API requests. However, any field with an
  1177. // empty value appearing in NullFields will be sent to the server as
  1178. // null. It is an error if a field in this list has a non-empty value.
  1179. // This may be used to include null fields in Patch requests.
  1180. NullFields []string `json:"-"`
  1181. }
  1182. func (s *Volume) MarshalJSON() ([]byte, error) {
  1183. type NoMethod Volume
  1184. raw := NoMethod(*s)
  1185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1186. }
  1187. // WorkerConfig: WorkerConfig defines the configuration to be used for a
  1188. // creating workers in
  1189. // the pool.
  1190. type WorkerConfig struct {
  1191. // DiskSizeGb: Size of the disk attached to the worker, in GB.
  1192. // See https://cloud.google.com/compute/docs/disks/
  1193. // If `0` is specified, Cloud Build will use a standard disk
  1194. // size.
  1195. // `disk_size` is overridden if you specify a different disk size
  1196. // in
  1197. // `build_options`. In this case, a VM with a disk size specified in
  1198. // the
  1199. // `build_options` will be created on demand at build time. For
  1200. // more
  1201. // information
  1202. // see
  1203. // https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/pr
  1204. // ojects.builds#buildoptions
  1205. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1206. // MachineType: Machine Type of the worker, such as n1-standard-1.
  1207. // See https://cloud.google.com/compute/docs/machine-types.
  1208. // If left blank, Cloud Build will use a standard unspecified machine
  1209. // to
  1210. // create the worker pool.
  1211. // `machine_type` is overridden if you specify a different machine type
  1212. // in
  1213. // `build_options`. In this case, the VM specified in the
  1214. // `build_options`
  1215. // will be created on demand at build time. For more information
  1216. // see
  1217. // https://cloud.google.com/cloud-build/docs/speeding-up-builds#using
  1218. // _custom_virtual_machine_sizes
  1219. MachineType string `json:"machineType,omitempty"`
  1220. // Network: The network definition used to create the worker.
  1221. // If this section is left empty, the workers will be created
  1222. // in
  1223. // WorkerPool.project_id on the default network.
  1224. Network *Network `json:"network,omitempty"`
  1225. // Tag: The tag applied to the worker, and the same tag used by the
  1226. // firewall rule.
  1227. // It is used to identify the Cloud Build workers among other VMs.
  1228. // The default value for tag is `worker`.
  1229. Tag string `json:"tag,omitempty"`
  1230. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  1231. // unconditionally include in API requests. By default, fields with
  1232. // empty values are omitted from API requests. However, any non-pointer,
  1233. // non-interface field appearing in ForceSendFields will be sent to the
  1234. // server regardless of whether the field is empty or not. This may be
  1235. // used to include empty fields in Patch requests.
  1236. ForceSendFields []string `json:"-"`
  1237. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  1238. // API requests with the JSON null value. By default, fields with empty
  1239. // values are omitted from API requests. However, any field with an
  1240. // empty value appearing in NullFields will be sent to the server as
  1241. // null. It is an error if a field in this list has a non-empty value.
  1242. // This may be used to include null fields in Patch requests.
  1243. NullFields []string `json:"-"`
  1244. }
  1245. func (s *WorkerConfig) MarshalJSON() ([]byte, error) {
  1246. type NoMethod WorkerConfig
  1247. raw := NoMethod(*s)
  1248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1249. }
  1250. // WorkerPool: Configuration for a WorkerPool to run the
  1251. // builds.
  1252. //
  1253. // Workers are machines that Cloud Build uses to run your builds. By
  1254. // default,
  1255. // all workers run in a project owned by Cloud Build. To have full
  1256. // control over
  1257. // the workers that execute your builds -- such as enabling them to
  1258. // access
  1259. // private resources on your private network -- you can request Cloud
  1260. // Build to
  1261. // run the workers in your own project by creating a custom workers
  1262. // pool.
  1263. type WorkerPool struct {
  1264. // CreateTime: Output only. Time at which the request to create the
  1265. // `WorkerPool` was
  1266. // received.
  1267. CreateTime string `json:"createTime,omitempty"`
  1268. // DeleteTime: Output only. Time at which the request to delete the
  1269. // `WorkerPool` was
  1270. // received.
  1271. DeleteTime string `json:"deleteTime,omitempty"`
  1272. // Name: User-defined name of the `WorkerPool`.
  1273. Name string `json:"name,omitempty"`
  1274. // ProjectId: The project ID of the GCP project in which the
  1275. // `WorkerPool` is created.
  1276. ProjectId string `json:"projectId,omitempty"`
  1277. // Regions: List of regions to create the `WorkerPool`. Regions can't be
  1278. // empty.
  1279. // If Cloud Build adds a new GCP region in the future, the
  1280. // existing
  1281. // `WorkerPool` will not be enabled in the new region automatically;
  1282. // you must add the new region to the `regions` field to enable
  1283. // the
  1284. // `WorkerPool` in that region.
  1285. //
  1286. // Possible values:
  1287. // "REGION_UNSPECIFIED" - no region
  1288. // "us-central1" - us-central1 region
  1289. // "us-west1" - us-west1 region
  1290. // "us-east1" - us-east1 region
  1291. // "us-east4" - us-east4 region
  1292. Regions []string `json:"regions,omitempty"`
  1293. // ServiceAccountEmail: Output only. The service account used to manage
  1294. // the `WorkerPool`. The
  1295. // service account must have the Compute Instance Admin (Beta)
  1296. // permission at
  1297. // the project level.
  1298. ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
  1299. // Status: Output only. WorkerPool Status.
  1300. //
  1301. // Possible values:
  1302. // "STATUS_UNSPECIFIED" - Status of the `WorkerPool` is unknown.
  1303. // "CREATING" - `WorkerPool` is being created.
  1304. // "RUNNING" - `WorkerPool` is running.
  1305. // "DELETING" - `WorkerPool` is being deleting: cancelling builds and
  1306. // draining workers.
  1307. // "DELETED" - `WorkerPool` is deleted.
  1308. Status string `json:"status,omitempty"`
  1309. // UpdateTime: Output only. Time at which the request to update the
  1310. // `WorkerPool` was
  1311. // received.
  1312. UpdateTime string `json:"updateTime,omitempty"`
  1313. // WorkerConfig: Configuration to be used for a creating workers in the
  1314. // `WorkerPool`.
  1315. WorkerConfig *WorkerConfig `json:"workerConfig,omitempty"`
  1316. // WorkerCount: Total number of workers to be created across all
  1317. // requested regions.
  1318. WorkerCount int64 `json:"workerCount,omitempty,string"`
  1319. // ServerResponse contains the HTTP response code and headers from the
  1320. // server.
  1321. googleapi.ServerResponse `json:"-"`
  1322. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  1323. // unconditionally include in API requests. By default, fields with
  1324. // empty values are omitted from API requests. However, any non-pointer,
  1325. // non-interface field appearing in ForceSendFields will be sent to the
  1326. // server regardless of whether the field is empty or not. This may be
  1327. // used to include empty fields in Patch requests.
  1328. ForceSendFields []string `json:"-"`
  1329. // NullFields is a list of field names (e.g. "CreateTime") to include in
  1330. // API requests with the JSON null value. By default, fields with empty
  1331. // values are omitted from API requests. However, any field with an
  1332. // empty value appearing in NullFields will be sent to the server as
  1333. // null. It is an error if a field in this list has a non-empty value.
  1334. // This may be used to include null fields in Patch requests.
  1335. NullFields []string `json:"-"`
  1336. }
  1337. func (s *WorkerPool) MarshalJSON() ([]byte, error) {
  1338. type NoMethod WorkerPool
  1339. raw := NoMethod(*s)
  1340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1341. }
  1342. // method id "cloudbuild.projects.workerPools.create":
  1343. type ProjectsWorkerPoolsCreateCall struct {
  1344. s *Service
  1345. parent string
  1346. workerpool *WorkerPool
  1347. urlParams_ gensupport.URLParams
  1348. ctx_ context.Context
  1349. header_ http.Header
  1350. }
  1351. // Create: Creates a `WorkerPool` to run the builds, and returns the new
  1352. // worker pool.
  1353. //
  1354. // This API is experimental.
  1355. func (r *ProjectsWorkerPoolsService) Create(parent string, workerpool *WorkerPool) *ProjectsWorkerPoolsCreateCall {
  1356. c := &ProjectsWorkerPoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1357. c.parent = parent
  1358. c.workerpool = workerpool
  1359. return c
  1360. }
  1361. // Fields allows partial responses to be retrieved. See
  1362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1363. // for more information.
  1364. func (c *ProjectsWorkerPoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsCreateCall {
  1365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1366. return c
  1367. }
  1368. // Context sets the context to be used in this call's Do method. Any
  1369. // pending HTTP request will be aborted if the provided context is
  1370. // canceled.
  1371. func (c *ProjectsWorkerPoolsCreateCall) Context(ctx context.Context) *ProjectsWorkerPoolsCreateCall {
  1372. c.ctx_ = ctx
  1373. return c
  1374. }
  1375. // Header returns an http.Header that can be modified by the caller to
  1376. // add HTTP headers to the request.
  1377. func (c *ProjectsWorkerPoolsCreateCall) Header() http.Header {
  1378. if c.header_ == nil {
  1379. c.header_ = make(http.Header)
  1380. }
  1381. return c.header_
  1382. }
  1383. func (c *ProjectsWorkerPoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  1384. reqHeaders := make(http.Header)
  1385. for k, v := range c.header_ {
  1386. reqHeaders[k] = v
  1387. }
  1388. reqHeaders.Set("User-Agent", c.s.userAgent())
  1389. var body io.Reader = nil
  1390. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool)
  1391. if err != nil {
  1392. return nil, err
  1393. }
  1394. reqHeaders.Set("Content-Type", "application/json")
  1395. c.urlParams_.Set("alt", alt)
  1396. c.urlParams_.Set("prettyPrint", "false")
  1397. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/workerPools")
  1398. urls += "?" + c.urlParams_.Encode()
  1399. req, err := http.NewRequest("POST", urls, body)
  1400. if err != nil {
  1401. return nil, err
  1402. }
  1403. req.Header = reqHeaders
  1404. googleapi.Expand(req.URL, map[string]string{
  1405. "parent": c.parent,
  1406. })
  1407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1408. }
  1409. // Do executes the "cloudbuild.projects.workerPools.create" call.
  1410. // Exactly one of *WorkerPool or error will be non-nil. Any non-2xx
  1411. // status code is an error. Response headers are in either
  1412. // *WorkerPool.ServerResponse.Header or (if a response was returned at
  1413. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1414. // to check whether the returned error was because
  1415. // http.StatusNotModified was returned.
  1416. func (c *ProjectsWorkerPoolsCreateCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) {
  1417. gensupport.SetOptions(c.urlParams_, opts...)
  1418. res, err := c.doRequest("json")
  1419. if res != nil && res.StatusCode == http.StatusNotModified {
  1420. if res.Body != nil {
  1421. res.Body.Close()
  1422. }
  1423. return nil, &googleapi.Error{
  1424. Code: res.StatusCode,
  1425. Header: res.Header,
  1426. }
  1427. }
  1428. if err != nil {
  1429. return nil, err
  1430. }
  1431. defer googleapi.CloseBody(res)
  1432. if err := googleapi.CheckResponse(res); err != nil {
  1433. return nil, err
  1434. }
  1435. ret := &WorkerPool{
  1436. ServerResponse: googleapi.ServerResponse{
  1437. Header: res.Header,
  1438. HTTPStatusCode: res.StatusCode,
  1439. },
  1440. }
  1441. target := &ret
  1442. if err := gensupport.DecodeResponse(target, res); err != nil {
  1443. return nil, err
  1444. }
  1445. return ret, nil
  1446. // {
  1447. // "description": "Creates a `WorkerPool` to run the builds, and returns the new worker pool.\n\nThis API is experimental.",
  1448. // "flatPath": "v1alpha1/projects/{projectsId}/workerPools",
  1449. // "httpMethod": "POST",
  1450. // "id": "cloudbuild.projects.workerPools.create",
  1451. // "parameterOrder": [
  1452. // "parent"
  1453. // ],
  1454. // "parameters": {
  1455. // "parent": {
  1456. // "description": "ID of the parent project.",
  1457. // "location": "path",
  1458. // "pattern": "^projects/[^/]+$",
  1459. // "required": true,
  1460. // "type": "string"
  1461. // }
  1462. // },
  1463. // "path": "v1alpha1/{+parent}/workerPools",
  1464. // "request": {
  1465. // "$ref": "WorkerPool"
  1466. // },
  1467. // "response": {
  1468. // "$ref": "WorkerPool"
  1469. // },
  1470. // "scopes": [
  1471. // "https://www.googleapis.com/auth/cloud-platform"
  1472. // ]
  1473. // }
  1474. }
  1475. // method id "cloudbuild.projects.workerPools.delete":
  1476. type ProjectsWorkerPoolsDeleteCall struct {
  1477. s *Service
  1478. name string
  1479. urlParams_ gensupport.URLParams
  1480. ctx_ context.Context
  1481. header_ http.Header
  1482. }
  1483. // Delete: Deletes a `WorkerPool` by its project ID and WorkerPool
  1484. // name.
  1485. //
  1486. // This API is experimental.
  1487. func (r *ProjectsWorkerPoolsService) Delete(name string) *ProjectsWorkerPoolsDeleteCall {
  1488. c := &ProjectsWorkerPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1489. c.name = name
  1490. return c
  1491. }
  1492. // Fields allows partial responses to be retrieved. See
  1493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1494. // for more information.
  1495. func (c *ProjectsWorkerPoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsDeleteCall {
  1496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1497. return c
  1498. }
  1499. // Context sets the context to be used in this call's Do method. Any
  1500. // pending HTTP request will be aborted if the provided context is
  1501. // canceled.
  1502. func (c *ProjectsWorkerPoolsDeleteCall) Context(ctx context.Context) *ProjectsWorkerPoolsDeleteCall {
  1503. c.ctx_ = ctx
  1504. return c
  1505. }
  1506. // Header returns an http.Header that can be modified by the caller to
  1507. // add HTTP headers to the request.
  1508. func (c *ProjectsWorkerPoolsDeleteCall) Header() http.Header {
  1509. if c.header_ == nil {
  1510. c.header_ = make(http.Header)
  1511. }
  1512. return c.header_
  1513. }
  1514. func (c *ProjectsWorkerPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1515. reqHeaders := make(http.Header)
  1516. for k, v := range c.header_ {
  1517. reqHeaders[k] = v
  1518. }
  1519. reqHeaders.Set("User-Agent", c.s.userAgent())
  1520. var body io.Reader = nil
  1521. c.urlParams_.Set("alt", alt)
  1522. c.urlParams_.Set("prettyPrint", "false")
  1523. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1524. urls += "?" + c.urlParams_.Encode()
  1525. req, err := http.NewRequest("DELETE", urls, body)
  1526. if err != nil {
  1527. return nil, err
  1528. }
  1529. req.Header = reqHeaders
  1530. googleapi.Expand(req.URL, map[string]string{
  1531. "name": c.name,
  1532. })
  1533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1534. }
  1535. // Do executes the "cloudbuild.projects.workerPools.delete" call.
  1536. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1537. // code is an error. Response headers are in either
  1538. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1539. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1540. // check whether the returned error was because http.StatusNotModified
  1541. // was returned.
  1542. func (c *ProjectsWorkerPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1543. gensupport.SetOptions(c.urlParams_, opts...)
  1544. res, err := c.doRequest("json")
  1545. if res != nil && res.StatusCode == http.StatusNotModified {
  1546. if res.Body != nil {
  1547. res.Body.Close()
  1548. }
  1549. return nil, &googleapi.Error{
  1550. Code: res.StatusCode,
  1551. Header: res.Header,
  1552. }
  1553. }
  1554. if err != nil {
  1555. return nil, err
  1556. }
  1557. defer googleapi.CloseBody(res)
  1558. if err := googleapi.CheckResponse(res); err != nil {
  1559. return nil, err
  1560. }
  1561. ret := &Empty{
  1562. ServerResponse: googleapi.ServerResponse{
  1563. Header: res.Header,
  1564. HTTPStatusCode: res.StatusCode,
  1565. },
  1566. }
  1567. target := &ret
  1568. if err := gensupport.DecodeResponse(target, res); err != nil {
  1569. return nil, err
  1570. }
  1571. return ret, nil
  1572. // {
  1573. // "description": "Deletes a `WorkerPool` by its project ID and WorkerPool name.\n\nThis API is experimental.",
  1574. // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}",
  1575. // "httpMethod": "DELETE",
  1576. // "id": "cloudbuild.projects.workerPools.delete",
  1577. // "parameterOrder": [
  1578. // "name"
  1579. // ],
  1580. // "parameters": {
  1581. // "name": {
  1582. // "description": "The field will contain name of the resource requested, for example:\n\"projects/project-1/workerPools/workerpool-name\"",
  1583. // "location": "path",
  1584. // "pattern": "^projects/[^/]+/workerPools/[^/]+$",
  1585. // "required": true,
  1586. // "type": "string"
  1587. // }
  1588. // },
  1589. // "path": "v1alpha1/{+name}",
  1590. // "response": {
  1591. // "$ref": "Empty"
  1592. // },
  1593. // "scopes": [
  1594. // "https://www.googleapis.com/auth/cloud-platform"
  1595. // ]
  1596. // }
  1597. }
  1598. // method id "cloudbuild.projects.workerPools.get":
  1599. type ProjectsWorkerPoolsGetCall struct {
  1600. s *Service
  1601. name string
  1602. urlParams_ gensupport.URLParams
  1603. ifNoneMatch_ string
  1604. ctx_ context.Context
  1605. header_ http.Header
  1606. }
  1607. // Get: Returns information about a `WorkerPool`.
  1608. //
  1609. // This API is experimental.
  1610. func (r *ProjectsWorkerPoolsService) Get(name string) *ProjectsWorkerPoolsGetCall {
  1611. c := &ProjectsWorkerPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1612. c.name = name
  1613. return c
  1614. }
  1615. // Fields allows partial responses to be retrieved. See
  1616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1617. // for more information.
  1618. func (c *ProjectsWorkerPoolsGetCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsGetCall {
  1619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1620. return c
  1621. }
  1622. // IfNoneMatch sets the optional parameter which makes the operation
  1623. // fail if the object's ETag matches the given value. This is useful for
  1624. // getting updates only after the object has changed since the last
  1625. // request. Use googleapi.IsNotModified to check whether the response
  1626. // error from Do is the result of In-None-Match.
  1627. func (c *ProjectsWorkerPoolsGetCall) IfNoneMatch(entityTag string) *ProjectsWorkerPoolsGetCall {
  1628. c.ifNoneMatch_ = entityTag
  1629. return c
  1630. }
  1631. // Context sets the context to be used in this call's Do method. Any
  1632. // pending HTTP request will be aborted if the provided context is
  1633. // canceled.
  1634. func (c *ProjectsWorkerPoolsGetCall) Context(ctx context.Context) *ProjectsWorkerPoolsGetCall {
  1635. c.ctx_ = ctx
  1636. return c
  1637. }
  1638. // Header returns an http.Header that can be modified by the caller to
  1639. // add HTTP headers to the request.
  1640. func (c *ProjectsWorkerPoolsGetCall) Header() http.Header {
  1641. if c.header_ == nil {
  1642. c.header_ = make(http.Header)
  1643. }
  1644. return c.header_
  1645. }
  1646. func (c *ProjectsWorkerPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  1647. reqHeaders := make(http.Header)
  1648. for k, v := range c.header_ {
  1649. reqHeaders[k] = v
  1650. }
  1651. reqHeaders.Set("User-Agent", c.s.userAgent())
  1652. if c.ifNoneMatch_ != "" {
  1653. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1654. }
  1655. var body io.Reader = nil
  1656. c.urlParams_.Set("alt", alt)
  1657. c.urlParams_.Set("prettyPrint", "false")
  1658. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1659. urls += "?" + c.urlParams_.Encode()
  1660. req, err := http.NewRequest("GET", urls, body)
  1661. if err != nil {
  1662. return nil, err
  1663. }
  1664. req.Header = reqHeaders
  1665. googleapi.Expand(req.URL, map[string]string{
  1666. "name": c.name,
  1667. })
  1668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1669. }
  1670. // Do executes the "cloudbuild.projects.workerPools.get" call.
  1671. // Exactly one of *WorkerPool or error will be non-nil. Any non-2xx
  1672. // status code is an error. Response headers are in either
  1673. // *WorkerPool.ServerResponse.Header or (if a response was returned at
  1674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1675. // to check whether the returned error was because
  1676. // http.StatusNotModified was returned.
  1677. func (c *ProjectsWorkerPoolsGetCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) {
  1678. gensupport.SetOptions(c.urlParams_, opts...)
  1679. res, err := c.doRequest("json")
  1680. if res != nil && res.StatusCode == http.StatusNotModified {
  1681. if res.Body != nil {
  1682. res.Body.Close()
  1683. }
  1684. return nil, &googleapi.Error{
  1685. Code: res.StatusCode,
  1686. Header: res.Header,
  1687. }
  1688. }
  1689. if err != nil {
  1690. return nil, err
  1691. }
  1692. defer googleapi.CloseBody(res)
  1693. if err := googleapi.CheckResponse(res); err != nil {
  1694. return nil, err
  1695. }
  1696. ret := &WorkerPool{
  1697. ServerResponse: googleapi.ServerResponse{
  1698. Header: res.Header,
  1699. HTTPStatusCode: res.StatusCode,
  1700. },
  1701. }
  1702. target := &ret
  1703. if err := gensupport.DecodeResponse(target, res); err != nil {
  1704. return nil, err
  1705. }
  1706. return ret, nil
  1707. // {
  1708. // "description": "Returns information about a `WorkerPool`.\n\nThis API is experimental.",
  1709. // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}",
  1710. // "httpMethod": "GET",
  1711. // "id": "cloudbuild.projects.workerPools.get",
  1712. // "parameterOrder": [
  1713. // "name"
  1714. // ],
  1715. // "parameters": {
  1716. // "name": {
  1717. // "description": "The field will contain name of the resource requested, for example:\n\"projects/project-1/workerPools/workerpool-name\"",
  1718. // "location": "path",
  1719. // "pattern": "^projects/[^/]+/workerPools/[^/]+$",
  1720. // "required": true,
  1721. // "type": "string"
  1722. // }
  1723. // },
  1724. // "path": "v1alpha1/{+name}",
  1725. // "response": {
  1726. // "$ref": "WorkerPool"
  1727. // },
  1728. // "scopes": [
  1729. // "https://www.googleapis.com/auth/cloud-platform"
  1730. // ]
  1731. // }
  1732. }
  1733. // method id "cloudbuild.projects.workerPools.list":
  1734. type ProjectsWorkerPoolsListCall struct {
  1735. s *Service
  1736. parent string
  1737. urlParams_ gensupport.URLParams
  1738. ifNoneMatch_ string
  1739. ctx_ context.Context
  1740. header_ http.Header
  1741. }
  1742. // List: List project's `WorkerPool`s.
  1743. //
  1744. // This API is experimental.
  1745. func (r *ProjectsWorkerPoolsService) List(parent string) *ProjectsWorkerPoolsListCall {
  1746. c := &ProjectsWorkerPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1747. c.parent = parent
  1748. return c
  1749. }
  1750. // Fields allows partial responses to be retrieved. See
  1751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1752. // for more information.
  1753. func (c *ProjectsWorkerPoolsListCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsListCall {
  1754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1755. return c
  1756. }
  1757. // IfNoneMatch sets the optional parameter which makes the operation
  1758. // fail if the object's ETag matches the given value. This is useful for
  1759. // getting updates only after the object has changed since the last
  1760. // request. Use googleapi.IsNotModified to check whether the response
  1761. // error from Do is the result of In-None-Match.
  1762. func (c *ProjectsWorkerPoolsListCall) IfNoneMatch(entityTag string) *ProjectsWorkerPoolsListCall {
  1763. c.ifNoneMatch_ = entityTag
  1764. return c
  1765. }
  1766. // Context sets the context to be used in this call's Do method. Any
  1767. // pending HTTP request will be aborted if the provided context is
  1768. // canceled.
  1769. func (c *ProjectsWorkerPoolsListCall) Context(ctx context.Context) *ProjectsWorkerPoolsListCall {
  1770. c.ctx_ = ctx
  1771. return c
  1772. }
  1773. // Header returns an http.Header that can be modified by the caller to
  1774. // add HTTP headers to the request.
  1775. func (c *ProjectsWorkerPoolsListCall) Header() http.Header {
  1776. if c.header_ == nil {
  1777. c.header_ = make(http.Header)
  1778. }
  1779. return c.header_
  1780. }
  1781. func (c *ProjectsWorkerPoolsListCall) doRequest(alt string) (*http.Response, error) {
  1782. reqHeaders := make(http.Header)
  1783. for k, v := range c.header_ {
  1784. reqHeaders[k] = v
  1785. }
  1786. reqHeaders.Set("User-Agent", c.s.userAgent())
  1787. if c.ifNoneMatch_ != "" {
  1788. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1789. }
  1790. var body io.Reader = nil
  1791. c.urlParams_.Set("alt", alt)
  1792. c.urlParams_.Set("prettyPrint", "false")
  1793. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/workerPools")
  1794. urls += "?" + c.urlParams_.Encode()
  1795. req, err := http.NewRequest("GET", urls, body)
  1796. if err != nil {
  1797. return nil, err
  1798. }
  1799. req.Header = reqHeaders
  1800. googleapi.Expand(req.URL, map[string]string{
  1801. "parent": c.parent,
  1802. })
  1803. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1804. }
  1805. // Do executes the "cloudbuild.projects.workerPools.list" call.
  1806. // Exactly one of *ListWorkerPoolsResponse or error will be non-nil. Any
  1807. // non-2xx status code is an error. Response headers are in either
  1808. // *ListWorkerPoolsResponse.ServerResponse.Header or (if a response was
  1809. // returned at all) in error.(*googleapi.Error).Header. Use
  1810. // googleapi.IsNotModified to check whether the returned error was
  1811. // because http.StatusNotModified was returned.
  1812. func (c *ProjectsWorkerPoolsListCall) Do(opts ...googleapi.CallOption) (*ListWorkerPoolsResponse, error) {
  1813. gensupport.SetOptions(c.urlParams_, opts...)
  1814. res, err := c.doRequest("json")
  1815. if res != nil && res.StatusCode == http.StatusNotModified {
  1816. if res.Body != nil {
  1817. res.Body.Close()
  1818. }
  1819. return nil, &googleapi.Error{
  1820. Code: res.StatusCode,
  1821. Header: res.Header,
  1822. }
  1823. }
  1824. if err != nil {
  1825. return nil, err
  1826. }
  1827. defer googleapi.CloseBody(res)
  1828. if err := googleapi.CheckResponse(res); err != nil {
  1829. return nil, err
  1830. }
  1831. ret := &ListWorkerPoolsResponse{
  1832. ServerResponse: googleapi.ServerResponse{
  1833. Header: res.Header,
  1834. HTTPStatusCode: res.StatusCode,
  1835. },
  1836. }
  1837. target := &ret
  1838. if err := gensupport.DecodeResponse(target, res); err != nil {
  1839. return nil, err
  1840. }
  1841. return ret, nil
  1842. // {
  1843. // "description": "List project's `WorkerPool`s.\n\nThis API is experimental.",
  1844. // "flatPath": "v1alpha1/projects/{projectsId}/workerPools",
  1845. // "httpMethod": "GET",
  1846. // "id": "cloudbuild.projects.workerPools.list",
  1847. // "parameterOrder": [
  1848. // "parent"
  1849. // ],
  1850. // "parameters": {
  1851. // "parent": {
  1852. // "description": "ID of the parent project.",
  1853. // "location": "path",
  1854. // "pattern": "^projects/[^/]+$",
  1855. // "required": true,
  1856. // "type": "string"
  1857. // }
  1858. // },
  1859. // "path": "v1alpha1/{+parent}/workerPools",
  1860. // "response": {
  1861. // "$ref": "ListWorkerPoolsResponse"
  1862. // },
  1863. // "scopes": [
  1864. // "https://www.googleapis.com/auth/cloud-platform"
  1865. // ]
  1866. // }
  1867. }
  1868. // method id "cloudbuild.projects.workerPools.patch":
  1869. type ProjectsWorkerPoolsPatchCall struct {
  1870. s *Service
  1871. name string
  1872. workerpool *WorkerPool
  1873. urlParams_ gensupport.URLParams
  1874. ctx_ context.Context
  1875. header_ http.Header
  1876. }
  1877. // Patch: Update a `WorkerPool`.
  1878. //
  1879. // This API is experimental.
  1880. func (r *ProjectsWorkerPoolsService) Patch(name string, workerpool *WorkerPool) *ProjectsWorkerPoolsPatchCall {
  1881. c := &ProjectsWorkerPoolsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1882. c.name = name
  1883. c.workerpool = workerpool
  1884. return c
  1885. }
  1886. // Fields allows partial responses to be retrieved. See
  1887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1888. // for more information.
  1889. func (c *ProjectsWorkerPoolsPatchCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsPatchCall {
  1890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1891. return c
  1892. }
  1893. // Context sets the context to be used in this call's Do method. Any
  1894. // pending HTTP request will be aborted if the provided context is
  1895. // canceled.
  1896. func (c *ProjectsWorkerPoolsPatchCall) Context(ctx context.Context) *ProjectsWorkerPoolsPatchCall {
  1897. c.ctx_ = ctx
  1898. return c
  1899. }
  1900. // Header returns an http.Header that can be modified by the caller to
  1901. // add HTTP headers to the request.
  1902. func (c *ProjectsWorkerPoolsPatchCall) Header() http.Header {
  1903. if c.header_ == nil {
  1904. c.header_ = make(http.Header)
  1905. }
  1906. return c.header_
  1907. }
  1908. func (c *ProjectsWorkerPoolsPatchCall) doRequest(alt string) (*http.Response, error) {
  1909. reqHeaders := make(http.Header)
  1910. for k, v := range c.header_ {
  1911. reqHeaders[k] = v
  1912. }
  1913. reqHeaders.Set("User-Agent", c.s.userAgent())
  1914. var body io.Reader = nil
  1915. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool)
  1916. if err != nil {
  1917. return nil, err
  1918. }
  1919. reqHeaders.Set("Content-Type", "application/json")
  1920. c.urlParams_.Set("alt", alt)
  1921. c.urlParams_.Set("prettyPrint", "false")
  1922. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1923. urls += "?" + c.urlParams_.Encode()
  1924. req, err := http.NewRequest("PATCH", urls, body)
  1925. if err != nil {
  1926. return nil, err
  1927. }
  1928. req.Header = reqHeaders
  1929. googleapi.Expand(req.URL, map[string]string{
  1930. "name": c.name,
  1931. })
  1932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1933. }
  1934. // Do executes the "cloudbuild.projects.workerPools.patch" call.
  1935. // Exactly one of *WorkerPool or error will be non-nil. Any non-2xx
  1936. // status code is an error. Response headers are in either
  1937. // *WorkerPool.ServerResponse.Header or (if a response was returned at
  1938. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1939. // to check whether the returned error was because
  1940. // http.StatusNotModified was returned.
  1941. func (c *ProjectsWorkerPoolsPatchCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) {
  1942. gensupport.SetOptions(c.urlParams_, opts...)
  1943. res, err := c.doRequest("json")
  1944. if res != nil && res.StatusCode == http.StatusNotModified {
  1945. if res.Body != nil {
  1946. res.Body.Close()
  1947. }
  1948. return nil, &googleapi.Error{
  1949. Code: res.StatusCode,
  1950. Header: res.Header,
  1951. }
  1952. }
  1953. if err != nil {
  1954. return nil, err
  1955. }
  1956. defer googleapi.CloseBody(res)
  1957. if err := googleapi.CheckResponse(res); err != nil {
  1958. return nil, err
  1959. }
  1960. ret := &WorkerPool{
  1961. ServerResponse: googleapi.ServerResponse{
  1962. Header: res.Header,
  1963. HTTPStatusCode: res.StatusCode,
  1964. },
  1965. }
  1966. target := &ret
  1967. if err := gensupport.DecodeResponse(target, res); err != nil {
  1968. return nil, err
  1969. }
  1970. return ret, nil
  1971. // {
  1972. // "description": "Update a `WorkerPool`.\n\nThis API is experimental.",
  1973. // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}",
  1974. // "httpMethod": "PATCH",
  1975. // "id": "cloudbuild.projects.workerPools.patch",
  1976. // "parameterOrder": [
  1977. // "name"
  1978. // ],
  1979. // "parameters": {
  1980. // "name": {
  1981. // "description": "The field will contain name of the resource requested, for example:\n\"projects/project-1/workerPools/workerpool-name\"",
  1982. // "location": "path",
  1983. // "pattern": "^projects/[^/]+/workerPools/[^/]+$",
  1984. // "required": true,
  1985. // "type": "string"
  1986. // }
  1987. // },
  1988. // "path": "v1alpha1/{+name}",
  1989. // "request": {
  1990. // "$ref": "WorkerPool"
  1991. // },
  1992. // "response": {
  1993. // "$ref": "WorkerPool"
  1994. // },
  1995. // "scopes": [
  1996. // "https://www.googleapis.com/auth/cloud-platform"
  1997. // ]
  1998. // }
  1999. }