google-cloud-build-v1 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06cef793a91b08695313564873d2b96737d6c44c228c8cb03496c07d113f2cf9
4
- data.tar.gz: f62d695108da2e93927c59dbde99567e62f1fb1d0f6a83121f8f28315c16cba2
3
+ metadata.gz: 8cd5bcabb5f8a6f69cbf6c06611f1a267f80d07eb13ea2ba8792e3580c4829ee
4
+ data.tar.gz: ce642880f7e6a974c5571cd6d9d14bd3b42b720dab01388b3f52a04c1a503aaf
5
5
  SHA512:
6
- metadata.gz: 1ff3f0ee25fc69dad4e875f1f882df357b2e7c9d447375d761a3deb8a4042a1095d416ff467c0f53a76ab72c13a251db803d027a2199dbaaa70f1f0497b7c011
7
- data.tar.gz: b564660edcef7252f2faedfcbc34c099168097b08b0924275b7774967d4edaf21d35c685f14bb0f1c9a55c4218e8f5ca381694666cc1c7b8f9cd48af1bf79f40
6
+ metadata.gz: add5feb686114a8e97dbdf6393e9e4c11d75caf301dd294994edf9832555227698248bf3b4a4909af92ab804489008d0b516f779fd8f5a2422eacb03977c353c
7
+ data.tar.gz: d5d5d9d4a211bd5f9d472f26d3264c6603b850be82d021c04ebae5db560eabb2940c04456bf7de570c396918b2b42d170772aa49af7ce1972ee222f610e8f0d6
@@ -635,6 +635,83 @@ module Google
635
635
  raise ::Google::Cloud::Error.from_error(e)
636
636
  end
637
637
 
638
+ ##
639
+ # Approves or rejects a pending build.
640
+ #
641
+ # If approved, the returned LRO will be analogous to the LRO returned from
642
+ # a CreateBuild call.
643
+ #
644
+ # If rejected, the returned LRO will be immediately done.
645
+ #
646
+ # @overload approve_build(request, options = nil)
647
+ # Pass arguments to `approve_build` via a request object, either of type
648
+ # {::Google::Cloud::Build::V1::ApproveBuildRequest} or an equivalent Hash.
649
+ #
650
+ # @param request [::Google::Cloud::Build::V1::ApproveBuildRequest, ::Hash]
651
+ # A request object representing the call parameters. Required. To specify no
652
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
653
+ # @param options [::Gapic::CallOptions, ::Hash]
654
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
655
+ #
656
+ # @overload approve_build(name: nil, approval_result: nil)
657
+ # Pass arguments to `approve_build` via keyword arguments. Note that at
658
+ # least one keyword argument is required. To specify no parameters, or to keep all
659
+ # the default parameter values, pass an empty Hash as a request object (see above).
660
+ #
661
+ # @param name [::String]
662
+ # Required. Name of the target build.
663
+ # For example: "projects/\\{$project_id}/builds/\\{$build_id}"
664
+ # @param approval_result [::Google::Cloud::Build::V1::ApprovalResult, ::Hash]
665
+ # Approval decision and metadata.
666
+ #
667
+ # @yield [response, operation] Access the result along with the RPC operation
668
+ # @yieldparam response [::Gapic::Operation]
669
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
670
+ #
671
+ # @return [::Gapic::Operation]
672
+ #
673
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
674
+ #
675
+ def approve_build request, options = nil
676
+ raise ::ArgumentError, "request must be provided" if request.nil?
677
+
678
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Build::V1::ApproveBuildRequest
679
+
680
+ # Converts hash and nil to an options object
681
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
682
+
683
+ # Customize the options with defaults
684
+ metadata = @config.rpcs.approve_build.metadata.to_h
685
+
686
+ # Set x-goog-api-client and x-goog-user-project headers
687
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
688
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
689
+ gapic_version: ::Google::Cloud::Build::V1::VERSION
690
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
+
692
+ header_params = {
693
+ "name" => request.name
694
+ }
695
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
696
+ metadata[:"x-goog-request-params"] ||= request_params_header
697
+
698
+ options.apply_defaults timeout: @config.rpcs.approve_build.timeout,
699
+ metadata: metadata,
700
+ retry_policy: @config.rpcs.approve_build.retry_policy
701
+
702
+ options.apply_defaults timeout: @config.timeout,
703
+ metadata: @config.metadata,
704
+ retry_policy: @config.retry_policy
705
+
706
+ @cloud_build_stub.call_rpc :approve_build, request, options: options do |response, operation|
707
+ response = ::Gapic::Operation.new response, @operations_client, options: options
708
+ yield response, operation if block_given?
709
+ return response
710
+ end
711
+ rescue ::GRPC::BadStatus => e
712
+ raise ::Google::Cloud::Error.from_error(e)
713
+ end
714
+
638
715
  ##
639
716
  # Creates a new `BuildTrigger`.
640
717
  #
@@ -1715,6 +1792,11 @@ module Google
1715
1792
  #
1716
1793
  attr_reader :retry_build
1717
1794
  ##
1795
+ # RPC-specific configuration for `approve_build`
1796
+ # @return [::Gapic::Config::Method]
1797
+ #
1798
+ attr_reader :approve_build
1799
+ ##
1718
1800
  # RPC-specific configuration for `create_build_trigger`
1719
1801
  # @return [::Gapic::Config::Method]
1720
1802
  #
@@ -1787,6 +1869,8 @@ module Google
1787
1869
  @cancel_build = ::Gapic::Config::Method.new cancel_build_config
1788
1870
  retry_build_config = parent_rpcs.retry_build if parent_rpcs.respond_to? :retry_build
1789
1871
  @retry_build = ::Gapic::Config::Method.new retry_build_config
1872
+ approve_build_config = parent_rpcs.approve_build if parent_rpcs.respond_to? :approve_build
1873
+ @approve_build = ::Gapic::Config::Method.new approve_build_config
1790
1874
  create_build_trigger_config = parent_rpcs.create_build_trigger if parent_rpcs.respond_to? :create_build_trigger
1791
1875
  @create_build_trigger = ::Gapic::Config::Method.new create_build_trigger_config
1792
1876
  get_build_trigger_config = parent_rpcs.get_build_trigger if parent_rpcs.respond_to? :get_build_trigger
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Build
23
23
  module V1
24
- VERSION = "0.9.2"
24
+ VERSION = "0.10.0"
25
25
  end
26
26
  end
27
27
  end
@@ -116,6 +116,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
116
116
  repeated :tags, :string, 31
117
117
  repeated :secrets, :message, 32, "google.devtools.cloudbuild.v1.Secret"
118
118
  map :timing, :string, :message, 33, "google.devtools.cloudbuild.v1.TimeSpan"
119
+ optional :approval, :message, 44, "google.devtools.cloudbuild.v1.BuildApproval"
119
120
  optional :service_account, :string, 42
120
121
  optional :available_secrets, :message, 47, "google.devtools.cloudbuild.v1.Secrets"
121
122
  repeated :warnings, :message, 49, "google.devtools.cloudbuild.v1.Build.Warning"
@@ -146,6 +147,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
146
147
  end
147
148
  add_enum "google.devtools.cloudbuild.v1.Build.Status" do
148
149
  value :STATUS_UNKNOWN, 0
150
+ value :PENDING, 10
149
151
  value :QUEUED, 1
150
152
  value :WORKING, 2
151
153
  value :SUCCESS, 3
@@ -231,6 +233,37 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
231
233
  optional :project_id, :string, 1
232
234
  optional :id, :string, 2
233
235
  end
236
+ add_message "google.devtools.cloudbuild.v1.ApproveBuildRequest" do
237
+ optional :name, :string, 1
238
+ optional :approval_result, :message, 2, "google.devtools.cloudbuild.v1.ApprovalResult"
239
+ end
240
+ add_message "google.devtools.cloudbuild.v1.BuildApproval" do
241
+ optional :state, :enum, 1, "google.devtools.cloudbuild.v1.BuildApproval.State"
242
+ optional :config, :message, 2, "google.devtools.cloudbuild.v1.ApprovalConfig"
243
+ optional :result, :message, 3, "google.devtools.cloudbuild.v1.ApprovalResult"
244
+ end
245
+ add_enum "google.devtools.cloudbuild.v1.BuildApproval.State" do
246
+ value :STATE_UNSPECIFIED, 0
247
+ value :PENDING, 1
248
+ value :APPROVED, 2
249
+ value :REJECTED, 3
250
+ value :CANCELLED, 5
251
+ end
252
+ add_message "google.devtools.cloudbuild.v1.ApprovalConfig" do
253
+ optional :approval_required, :bool, 1
254
+ end
255
+ add_message "google.devtools.cloudbuild.v1.ApprovalResult" do
256
+ optional :approver_account, :string, 2
257
+ optional :approval_time, :message, 3, "google.protobuf.Timestamp"
258
+ optional :decision, :enum, 4, "google.devtools.cloudbuild.v1.ApprovalResult.Decision"
259
+ optional :comment, :string, 5
260
+ optional :url, :string, 6
261
+ end
262
+ add_enum "google.devtools.cloudbuild.v1.ApprovalResult.Decision" do
263
+ value :DECISION_UNSPECIFIED, 0
264
+ value :APPROVED, 1
265
+ value :REJECTED, 2
266
+ end
234
267
  add_message "google.devtools.cloudbuild.v1.BuildTrigger" do
235
268
  optional :resource_name, :string, 34
236
269
  optional :id, :string, 1
@@ -513,6 +546,12 @@ module Google
513
546
  ListBuildsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ListBuildsRequest").msgclass
514
547
  ListBuildsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ListBuildsResponse").msgclass
515
548
  CancelBuildRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.CancelBuildRequest").msgclass
549
+ ApproveBuildRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApproveBuildRequest").msgclass
550
+ BuildApproval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildApproval").msgclass
551
+ BuildApproval::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildApproval.State").enummodule
552
+ ApprovalConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApprovalConfig").msgclass
553
+ ApprovalResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApprovalResult").msgclass
554
+ ApprovalResult::Decision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApprovalResult.Decision").enummodule
516
555
  BuildTrigger = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildTrigger").msgclass
517
556
  GitHubEventsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.GitHubEventsConfig").msgclass
518
557
  PubsubConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.PubsubConfig").msgclass
@@ -86,6 +86,13 @@ module Google
86
86
  # object, which may or may not be available depending on the bucket's
87
87
  # lifecycle management settings.
88
88
  rpc :RetryBuild, ::Google::Cloud::Build::V1::RetryBuildRequest, ::Google::Longrunning::Operation
89
+ # Approves or rejects a pending build.
90
+ #
91
+ # If approved, the returned LRO will be analogous to the LRO returned from
92
+ # a CreateBuild call.
93
+ #
94
+ # If rejected, the returned LRO will be immediately done.
95
+ rpc :ApproveBuild, ::Google::Cloud::Build::V1::ApproveBuildRequest, ::Google::Longrunning::Operation
89
96
  # Creates a new `BuildTrigger`.
90
97
  #
91
98
  # This API is experimental.
@@ -478,6 +478,10 @@ module Google
478
478
  #
479
479
  # If the build does not specify source or images,
480
480
  # these keys will not be included.
481
+ # @!attribute [r] approval
482
+ # @return [::Google::Cloud::Build::V1::BuildApproval]
483
+ # Output only. Describes this build's approval configuration, status,
484
+ # and result.
481
485
  # @!attribute [rw] service_account
482
486
  # @return [::String]
483
487
  # IAM service account whose credentials will be used at build runtime.
@@ -584,6 +588,10 @@ module Google
584
588
  # Status of the build is unknown.
585
589
  STATUS_UNKNOWN = 0
586
590
 
591
+ # Build has been created and is pending execution and queuing. It has not
592
+ # been queued.
593
+ PENDING = 10
594
+
587
595
  # Build or step is queued; work has not yet begun.
588
596
  QUEUED = 1
589
597
 
@@ -935,6 +943,103 @@ module Google
935
943
  extend ::Google::Protobuf::MessageExts::ClassMethods
936
944
  end
937
945
 
946
+ # Request to approve or reject a pending build.
947
+ # @!attribute [rw] name
948
+ # @return [::String]
949
+ # Required. Name of the target build.
950
+ # For example: "projects/\\{$project_id}/builds/\\{$build_id}"
951
+ # @!attribute [rw] approval_result
952
+ # @return [::Google::Cloud::Build::V1::ApprovalResult]
953
+ # Approval decision and metadata.
954
+ class ApproveBuildRequest
955
+ include ::Google::Protobuf::MessageExts
956
+ extend ::Google::Protobuf::MessageExts::ClassMethods
957
+ end
958
+
959
+ # BuildApproval describes a build's approval configuration, state, and
960
+ # result.
961
+ # @!attribute [r] state
962
+ # @return [::Google::Cloud::Build::V1::BuildApproval::State]
963
+ # Output only. The state of this build's approval.
964
+ # @!attribute [r] config
965
+ # @return [::Google::Cloud::Build::V1::ApprovalConfig]
966
+ # Output only. Configuration for manual approval of this build.
967
+ # @!attribute [r] result
968
+ # @return [::Google::Cloud::Build::V1::ApprovalResult]
969
+ # Output only. Result of manual approval for this Build.
970
+ class BuildApproval
971
+ include ::Google::Protobuf::MessageExts
972
+ extend ::Google::Protobuf::MessageExts::ClassMethods
973
+
974
+ # Specifies the current state of a build's approval.
975
+ module State
976
+ # Default enum type. This should not be used.
977
+ STATE_UNSPECIFIED = 0
978
+
979
+ # Build approval is pending.
980
+ PENDING = 1
981
+
982
+ # Build approval has been approved.
983
+ APPROVED = 2
984
+
985
+ # Build approval has been rejected.
986
+ REJECTED = 3
987
+
988
+ # Build was cancelled while it was still pending approval.
989
+ CANCELLED = 5
990
+ end
991
+ end
992
+
993
+ # ApprovalConfig describes configuration for manual approval of a build.
994
+ # @!attribute [rw] approval_required
995
+ # @return [::Boolean]
996
+ # Whether or not approval is needed. If this is set on a build, it will
997
+ # become pending when created, and will need to be explicitly approved
998
+ # to start.
999
+ class ApprovalConfig
1000
+ include ::Google::Protobuf::MessageExts
1001
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1002
+ end
1003
+
1004
+ # ApprovalResult describes the decision and associated metadata of a manual
1005
+ # approval of a build.
1006
+ # @!attribute [r] approver_account
1007
+ # @return [::String]
1008
+ # Output only. Email of the user that called the ApproveBuild API to
1009
+ # approve or reject a build at the time that the API was called.
1010
+ # @!attribute [r] approval_time
1011
+ # @return [::Google::Protobuf::Timestamp]
1012
+ # Output only. The time when the approval decision was made.
1013
+ # @!attribute [rw] decision
1014
+ # @return [::Google::Cloud::Build::V1::ApprovalResult::Decision]
1015
+ # Required. The decision of this manual approval.
1016
+ # @!attribute [rw] comment
1017
+ # @return [::String]
1018
+ # Optional. An optional comment for this manual approval result.
1019
+ # @!attribute [rw] url
1020
+ # @return [::String]
1021
+ # Optional. An optional URL tied to this manual approval result. This field
1022
+ # is essentially the same as comment, except that it will be rendered by the
1023
+ # UI differently. An example use case is a link to an external job that
1024
+ # approved this Build.
1025
+ class ApprovalResult
1026
+ include ::Google::Protobuf::MessageExts
1027
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1028
+
1029
+ # Specifies whether or not this manual approval result is to approve
1030
+ # or reject a build.
1031
+ module Decision
1032
+ # Default enum type. This should not be used.
1033
+ DECISION_UNSPECIFIED = 0
1034
+
1035
+ # Build is approved.
1036
+ APPROVED = 1
1037
+
1038
+ # Build is rejected.
1039
+ REJECTED = 2
1040
+ end
1041
+ end
1042
+
938
1043
  # Configuration for an automated build in response to source repository
939
1044
  # changes.
940
1045
  # @!attribute [rw] resource_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-build-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2021-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common