google-cloud-kms-v1 0.16.0 → 0.18.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: 88ccb6ea1616c6e3d3e167aaf3d0e81795d897a8f07922ceb7fccfe0be5c1baa
4
- data.tar.gz: 2d635e795aef36e90ff5fa04ab772fc982e6ec30d3855a8741d358edbee26809
3
+ metadata.gz: 5dd007295b6f2ec2dbd524910385762136fa4c92827ae2bf146dea3cd986395b
4
+ data.tar.gz: dad1b2dd3104df2b1169aaf28b420409be257c25430fb53a94b032f30c1b932e
5
5
  SHA512:
6
- metadata.gz: ffcdda5aafc0cc3bef3e4b1dba6fea52819d282bf6af6a3d085802e2c447f5116c053d80fbc8978ee2540ed178ae5d9efbbf5316adf06f79ccfa641a30044e05
7
- data.tar.gz: c16e58ed43dae8dbdafed46b687864cf1241dbc50ddec764406928cb9e702a30362d2862a63c6419f955f869bc28a8362fa1a1f51770acb79a6a075270927034
6
+ metadata.gz: 3fcf9e9fedafc0005219bece87a5167fa96968560a659cc2d0ea68b272500933caf80435c665ee54e48c8c5b0551149ba60d98ff4869176067d85b7fc02bc04c
7
+ data.tar.gz: 6fb8eeb103261677363b217ba3e36e49a9815c64ac9afa0ff82d0b450fa9aeef89f91b24d35bef13333f702786fcdbbf2fb3b89ed338bec9ed5ebf80a909a73e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Key Management Service (KMS) V1 API
2
2
 
3
- API Client library for the Cloud Key Management Service (KMS) V1 API
3
+ Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications.
4
4
 
5
5
  Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications.
6
6
 
@@ -0,0 +1,231 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Kms
24
+ ##
25
+ # @example Loading just the REST part of this package, including all its services, and instantiating a REST client
26
+ #
27
+ # require "google/cloud/kms/v1/rest"
28
+ # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new
29
+ #
30
+ module V1
31
+ ##
32
+ # @private
33
+ # Initialize the mixin bindings configuration
34
+ #
35
+ def self.configure
36
+ @configure ||= begin
37
+ namespace = ["Google", "Cloud", "Kms"]
38
+ parent_config = while namespace.any?
39
+ parent_name = namespace.join "::"
40
+ parent_const = const_get parent_name
41
+ break parent_const.configure if parent_const.respond_to? :configure
42
+ namespace.pop
43
+ end
44
+
45
+ default_config = Configuration.new parent_config
46
+ default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
47
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
48
+ uri_method: :get,
49
+ uri_template: "/v1/{name}",
50
+ matches: [
51
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
52
+ ],
53
+ body: nil
54
+ )
55
+ ]
56
+ default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
57
+
58
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
59
+ uri_method: :get,
60
+ uri_template: "/v1/{name}/locations",
61
+ matches: [
62
+ ["name", %r{^projects/[^/]+/?$}, false]
63
+ ],
64
+ body: nil
65
+ )
66
+ ]
67
+ default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [
68
+
69
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
70
+ uri_method: :get,
71
+ uri_template: "/v1/{resource}:getIamPolicy",
72
+ matches: [
73
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false]
74
+ ],
75
+ body: nil
76
+ ),
77
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
78
+ uri_method: :get,
79
+ uri_template: "/v1/{resource}:getIamPolicy",
80
+ matches: [
81
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false]
82
+ ],
83
+ body: nil
84
+ ),
85
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
86
+ uri_method: :get,
87
+ uri_template: "/v1/{resource}:getIamPolicy",
88
+ matches: [
89
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false]
90
+ ],
91
+ body: nil
92
+ ),
93
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
94
+ uri_method: :get,
95
+ uri_template: "/v1/{resource}:getIamPolicy",
96
+ matches: [
97
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false]
98
+ ],
99
+ body: nil
100
+ ),
101
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
102
+ uri_method: :get,
103
+ uri_template: "/v1/{resource}:getIamPolicy",
104
+ matches: [
105
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false]
106
+ ],
107
+ body: nil
108
+ )
109
+ ]
110
+ default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [
111
+
112
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
113
+ uri_method: :post,
114
+ uri_template: "/v1/{resource}:setIamPolicy",
115
+ matches: [
116
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false]
117
+ ],
118
+ body: "*"
119
+ ),
120
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
121
+ uri_method: :post,
122
+ uri_template: "/v1/{resource}:setIamPolicy",
123
+ matches: [
124
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false]
125
+ ],
126
+ body: "*"
127
+ ),
128
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
129
+ uri_method: :post,
130
+ uri_template: "/v1/{resource}:setIamPolicy",
131
+ matches: [
132
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false]
133
+ ],
134
+ body: "*"
135
+ ),
136
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
137
+ uri_method: :post,
138
+ uri_template: "/v1/{resource}:setIamPolicy",
139
+ matches: [
140
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false]
141
+ ],
142
+ body: "*"
143
+ ),
144
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
145
+ uri_method: :post,
146
+ uri_template: "/v1/{resource}:setIamPolicy",
147
+ matches: [
148
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false]
149
+ ],
150
+ body: "*"
151
+ )
152
+ ]
153
+ default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [
154
+
155
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
156
+ uri_method: :post,
157
+ uri_template: "/v1/{resource}:testIamPermissions",
158
+ matches: [
159
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false]
160
+ ],
161
+ body: "*"
162
+ ),
163
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
164
+ uri_method: :post,
165
+ uri_template: "/v1/{resource}:testIamPermissions",
166
+ matches: [
167
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false]
168
+ ],
169
+ body: "*"
170
+ ),
171
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
172
+ uri_method: :post,
173
+ uri_template: "/v1/{resource}:testIamPermissions",
174
+ matches: [
175
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false]
176
+ ],
177
+ body: "*"
178
+ ),
179
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
180
+ uri_method: :post,
181
+ uri_template: "/v1/{resource}:testIamPermissions",
182
+ matches: [
183
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false]
184
+ ],
185
+ body: "*"
186
+ ),
187
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
188
+ uri_method: :post,
189
+ uri_template: "/v1/{resource}:testIamPermissions",
190
+ matches: [
191
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false]
192
+ ],
193
+ body: "*"
194
+ )
195
+ ]
196
+ default_config
197
+ end
198
+ yield @configure if block_given?
199
+ @configure
200
+ end
201
+
202
+ ##
203
+ # @private
204
+ # Configuration class for the google.cloud.kms.v1 package.
205
+ #
206
+ # This class contains common configuration for all services
207
+ # of the google.cloud.kms.v1 package.
208
+ #
209
+ # This configuration is for internal use of the client library classes,
210
+ # and it is not intended that the end-users will read or change it.
211
+ #
212
+ class Configuration
213
+ extend ::Gapic::Config
214
+
215
+ # @private
216
+ # Overrides for http bindings for the RPC of the mixins for this package.
217
+ # Services in this package should use these when creating clients for the mixin services.
218
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
219
+ config_attr :bindings_override, {}, ::Hash, nil
220
+
221
+ # @private
222
+ def initialize parent_config = nil
223
+ @parent_config = parent_config unless parent_config.nil?
224
+
225
+ yield self if block_given?
226
+ end
227
+ end
228
+ end
229
+ end
230
+ end
231
+ end
@@ -260,13 +260,11 @@ module Google
260
260
  # # Call the list_ekm_connections method.
261
261
  # result = client.list_ekm_connections request
262
262
  #
263
- # # The returned object is of type Gapic::PagedEnumerable. You can
264
- # # iterate over all elements by calling #each, and the enumerable
265
- # # will lazily make API calls to fetch subsequent pages. Other
266
- # # methods are also available for managing paging directly.
267
- # result.each do |response|
263
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
264
+ # # over elements, and API calls will be issued to fetch pages as needed.
265
+ # result.each do |item|
268
266
  # # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection.
269
- # p response
267
+ # p item
270
268
  # end
271
269
  #
272
270
  def list_ekm_connections request, options = nil
@@ -580,6 +578,181 @@ module Google
580
578
  raise ::Google::Cloud::Error.from_error(e)
581
579
  end
582
580
 
581
+ ##
582
+ # Returns the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource
583
+ # for a given project and location.
584
+ #
585
+ # @overload get_ekm_config(request, options = nil)
586
+ # Pass arguments to `get_ekm_config` via a request object, either of type
587
+ # {::Google::Cloud::Kms::V1::GetEkmConfigRequest} or an equivalent Hash.
588
+ #
589
+ # @param request [::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::Hash]
590
+ # A request object representing the call parameters. Required. To specify no
591
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
592
+ # @param options [::Gapic::CallOptions, ::Hash]
593
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
594
+ #
595
+ # @overload get_ekm_config(name: nil)
596
+ # Pass arguments to `get_ekm_config` via keyword arguments. Note that at
597
+ # least one keyword argument is required. To specify no parameters, or to keep all
598
+ # the default parameter values, pass an empty Hash as a request object (see above).
599
+ #
600
+ # @param name [::String]
601
+ # Required. The {::Google::Cloud::Kms::V1::EkmConfig#name name} of the
602
+ # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} to get.
603
+ #
604
+ # @yield [response, operation] Access the result along with the RPC operation
605
+ # @yieldparam response [::Google::Cloud::Kms::V1::EkmConfig]
606
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
607
+ #
608
+ # @return [::Google::Cloud::Kms::V1::EkmConfig]
609
+ #
610
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
611
+ #
612
+ # @example Basic example
613
+ # require "google/cloud/kms/v1"
614
+ #
615
+ # # Create a client object. The client can be reused for multiple calls.
616
+ # client = Google::Cloud::Kms::V1::EkmService::Client.new
617
+ #
618
+ # # Create a request. To set request fields, pass in keyword arguments.
619
+ # request = Google::Cloud::Kms::V1::GetEkmConfigRequest.new
620
+ #
621
+ # # Call the get_ekm_config method.
622
+ # result = client.get_ekm_config request
623
+ #
624
+ # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig.
625
+ # p result
626
+ #
627
+ def get_ekm_config request, options = nil
628
+ raise ::ArgumentError, "request must be provided" if request.nil?
629
+
630
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConfigRequest
631
+
632
+ # Converts hash and nil to an options object
633
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
634
+
635
+ # Customize the options with defaults
636
+ metadata = @config.rpcs.get_ekm_config.metadata.to_h
637
+
638
+ # Set x-goog-api-client and x-goog-user-project headers
639
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
640
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
641
+ gapic_version: ::Google::Cloud::Kms::V1::VERSION
642
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
643
+
644
+ header_params = {}
645
+ if request.name
646
+ header_params["name"] = request.name
647
+ end
648
+
649
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
650
+ metadata[:"x-goog-request-params"] ||= request_params_header
651
+
652
+ options.apply_defaults timeout: @config.rpcs.get_ekm_config.timeout,
653
+ metadata: metadata,
654
+ retry_policy: @config.rpcs.get_ekm_config.retry_policy
655
+
656
+ options.apply_defaults timeout: @config.timeout,
657
+ metadata: @config.metadata,
658
+ retry_policy: @config.retry_policy
659
+
660
+ @ekm_service_stub.call_rpc :get_ekm_config, request, options: options do |response, operation|
661
+ yield response, operation if block_given?
662
+ return response
663
+ end
664
+ rescue ::GRPC::BadStatus => e
665
+ raise ::Google::Cloud::Error.from_error(e)
666
+ end
667
+
668
+ ##
669
+ # Updates the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource
670
+ # for a given project and location.
671
+ #
672
+ # @overload update_ekm_config(request, options = nil)
673
+ # Pass arguments to `update_ekm_config` via a request object, either of type
674
+ # {::Google::Cloud::Kms::V1::UpdateEkmConfigRequest} or an equivalent Hash.
675
+ #
676
+ # @param request [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Hash]
677
+ # A request object representing the call parameters. Required. To specify no
678
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
679
+ # @param options [::Gapic::CallOptions, ::Hash]
680
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
681
+ #
682
+ # @overload update_ekm_config(ekm_config: nil, update_mask: nil)
683
+ # Pass arguments to `update_ekm_config` via keyword arguments. Note that at
684
+ # least one keyword argument is required. To specify no parameters, or to keep all
685
+ # the default parameter values, pass an empty Hash as a request object (see above).
686
+ #
687
+ # @param ekm_config [::Google::Cloud::Kms::V1::EkmConfig, ::Hash]
688
+ # Required. {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} with updated values.
689
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
690
+ # Required. List of fields to be updated in this request.
691
+ #
692
+ # @yield [response, operation] Access the result along with the RPC operation
693
+ # @yieldparam response [::Google::Cloud::Kms::V1::EkmConfig]
694
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
695
+ #
696
+ # @return [::Google::Cloud::Kms::V1::EkmConfig]
697
+ #
698
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
699
+ #
700
+ # @example Basic example
701
+ # require "google/cloud/kms/v1"
702
+ #
703
+ # # Create a client object. The client can be reused for multiple calls.
704
+ # client = Google::Cloud::Kms::V1::EkmService::Client.new
705
+ #
706
+ # # Create a request. To set request fields, pass in keyword arguments.
707
+ # request = Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new
708
+ #
709
+ # # Call the update_ekm_config method.
710
+ # result = client.update_ekm_config request
711
+ #
712
+ # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig.
713
+ # p result
714
+ #
715
+ def update_ekm_config request, options = nil
716
+ raise ::ArgumentError, "request must be provided" if request.nil?
717
+
718
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest
719
+
720
+ # Converts hash and nil to an options object
721
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
722
+
723
+ # Customize the options with defaults
724
+ metadata = @config.rpcs.update_ekm_config.metadata.to_h
725
+
726
+ # Set x-goog-api-client and x-goog-user-project headers
727
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
728
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
729
+ gapic_version: ::Google::Cloud::Kms::V1::VERSION
730
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
731
+
732
+ header_params = {}
733
+ if request.ekm_config&.name
734
+ header_params["ekm_config.name"] = request.ekm_config.name
735
+ end
736
+
737
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
738
+ metadata[:"x-goog-request-params"] ||= request_params_header
739
+
740
+ options.apply_defaults timeout: @config.rpcs.update_ekm_config.timeout,
741
+ metadata: metadata,
742
+ retry_policy: @config.rpcs.update_ekm_config.retry_policy
743
+
744
+ options.apply_defaults timeout: @config.timeout,
745
+ metadata: @config.metadata,
746
+ retry_policy: @config.retry_policy
747
+
748
+ @ekm_service_stub.call_rpc :update_ekm_config, request, options: options do |response, operation|
749
+ yield response, operation if block_given?
750
+ return response
751
+ end
752
+ rescue ::GRPC::BadStatus => e
753
+ raise ::Google::Cloud::Error.from_error(e)
754
+ end
755
+
583
756
  ##
584
757
  # Configuration class for the EkmService API.
585
758
  #
@@ -735,6 +908,16 @@ module Google
735
908
  # @return [::Gapic::Config::Method]
736
909
  #
737
910
  attr_reader :update_ekm_connection
911
+ ##
912
+ # RPC-specific configuration for `get_ekm_config`
913
+ # @return [::Gapic::Config::Method]
914
+ #
915
+ attr_reader :get_ekm_config
916
+ ##
917
+ # RPC-specific configuration for `update_ekm_config`
918
+ # @return [::Gapic::Config::Method]
919
+ #
920
+ attr_reader :update_ekm_config
738
921
 
739
922
  # @private
740
923
  def initialize parent_rpcs = nil
@@ -746,6 +929,10 @@ module Google
746
929
  @create_ekm_connection = ::Gapic::Config::Method.new create_ekm_connection_config
747
930
  update_ekm_connection_config = parent_rpcs.update_ekm_connection if parent_rpcs.respond_to? :update_ekm_connection
748
931
  @update_ekm_connection = ::Gapic::Config::Method.new update_ekm_connection_config
932
+ get_ekm_config_config = parent_rpcs.get_ekm_config if parent_rpcs.respond_to? :get_ekm_config
933
+ @get_ekm_config = ::Gapic::Config::Method.new get_ekm_config_config
934
+ update_ekm_config_config = parent_rpcs.update_ekm_config if parent_rpcs.respond_to? :update_ekm_config
935
+ @update_ekm_config = ::Gapic::Config::Method.new update_ekm_config_config
749
936
 
750
937
  yield self if block_given?
751
938
  end
@@ -24,6 +24,23 @@ module Google
24
24
  module EkmService
25
25
  # Path helper methods for the EkmService API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified EkmConfig resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/ekmConfig`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ #
37
+ # @return [::String]
38
+ def ekm_config_path project:, location:
39
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/locations/#{location}/ekmConfig"
42
+ end
43
+
27
44
  ##
28
45
  # Create a fully-qualified EkmConnection resource string.
29
46
  #