google-cloud-managed_kafka-v1 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/managed_kafka/v1/managed_kafka/client.rb +726 -0
- data/lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb +21 -0
- data/lib/google/cloud/managed_kafka/v1/managed_kafka/rest/client.rb +677 -0
- data/lib/google/cloud/managed_kafka/v1/managed_kafka/rest/service_stub.rb +431 -0
- data/lib/google/cloud/managed_kafka/v1/version.rb +1 -1
- data/lib/google/cloud/managedkafka/v1/managed_kafka_pb.rb +11 -1
- data/lib/google/cloud/managedkafka/v1/managed_kafka_services_pb.rb +17 -0
- data/lib/google/cloud/managedkafka/v1/resources_pb.rb +3 -1
- data/proto_docs/google/cloud/managedkafka/v1/managed_kafka.rb +187 -0
- data/proto_docs/google/cloud/managedkafka/v1/resources.rb +89 -0
- metadata +2 -2
@@ -1622,6 +1622,683 @@ module Google
|
|
1622
1622
|
raise ::Google::Cloud::Error.from_error(e)
|
1623
1623
|
end
|
1624
1624
|
|
1625
|
+
##
|
1626
|
+
# Lists the acls in a given cluster.
|
1627
|
+
#
|
1628
|
+
# @overload list_acls(request, options = nil)
|
1629
|
+
# Pass arguments to `list_acls` via a request object, either of type
|
1630
|
+
# {::Google::Cloud::ManagedKafka::V1::ListAclsRequest} or an equivalent Hash.
|
1631
|
+
#
|
1632
|
+
# @param request [::Google::Cloud::ManagedKafka::V1::ListAclsRequest, ::Hash]
|
1633
|
+
# A request object representing the call parameters. Required. To specify no
|
1634
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1635
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1636
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1637
|
+
#
|
1638
|
+
# @overload list_acls(parent: nil, page_size: nil, page_token: nil)
|
1639
|
+
# Pass arguments to `list_acls` via keyword arguments. Note that at
|
1640
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1641
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1642
|
+
#
|
1643
|
+
# @param parent [::String]
|
1644
|
+
# Required. The parent cluster whose acls are to be listed.
|
1645
|
+
# Structured like
|
1646
|
+
# `projects/{project}/locations/{location}/clusters/{cluster}`.
|
1647
|
+
# @param page_size [::Integer]
|
1648
|
+
# Optional. The maximum number of acls to return. The service may return
|
1649
|
+
# fewer than this value. If unset or zero, all acls for the parent is
|
1650
|
+
# returned.
|
1651
|
+
# @param page_token [::String]
|
1652
|
+
# Optional. A page token, received from a previous `ListAcls` call.
|
1653
|
+
# Provide this to retrieve the subsequent page.
|
1654
|
+
#
|
1655
|
+
# When paginating, all other parameters provided to `ListAcls` must match
|
1656
|
+
# the call that provided the page token.
|
1657
|
+
#
|
1658
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1659
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>]
|
1660
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1661
|
+
#
|
1662
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>]
|
1663
|
+
#
|
1664
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1665
|
+
#
|
1666
|
+
# @example Basic example
|
1667
|
+
# require "google/cloud/managed_kafka/v1"
|
1668
|
+
#
|
1669
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1670
|
+
# client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new
|
1671
|
+
#
|
1672
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1673
|
+
# request = Google::Cloud::ManagedKafka::V1::ListAclsRequest.new
|
1674
|
+
#
|
1675
|
+
# # Call the list_acls method.
|
1676
|
+
# result = client.list_acls request
|
1677
|
+
#
|
1678
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1679
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1680
|
+
# result.each do |item|
|
1681
|
+
# # Each element is of type ::Google::Cloud::ManagedKafka::V1::Acl.
|
1682
|
+
# p item
|
1683
|
+
# end
|
1684
|
+
#
|
1685
|
+
def list_acls request, options = nil
|
1686
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1687
|
+
|
1688
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::ListAclsRequest
|
1689
|
+
|
1690
|
+
# Converts hash and nil to an options object
|
1691
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1692
|
+
|
1693
|
+
# Customize the options with defaults
|
1694
|
+
metadata = @config.rpcs.list_acls.metadata.to_h
|
1695
|
+
|
1696
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1697
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1698
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1699
|
+
gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION
|
1700
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1701
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1702
|
+
|
1703
|
+
header_params = {}
|
1704
|
+
if request.parent
|
1705
|
+
header_params["parent"] = request.parent
|
1706
|
+
end
|
1707
|
+
|
1708
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1709
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1710
|
+
|
1711
|
+
options.apply_defaults timeout: @config.rpcs.list_acls.timeout,
|
1712
|
+
metadata: metadata,
|
1713
|
+
retry_policy: @config.rpcs.list_acls.retry_policy
|
1714
|
+
|
1715
|
+
options.apply_defaults timeout: @config.timeout,
|
1716
|
+
metadata: @config.metadata,
|
1717
|
+
retry_policy: @config.retry_policy
|
1718
|
+
|
1719
|
+
@managed_kafka_stub.call_rpc :list_acls, request, options: options do |response, operation|
|
1720
|
+
response = ::Gapic::PagedEnumerable.new @managed_kafka_stub, :list_acls, request, response, operation, options
|
1721
|
+
yield response, operation if block_given?
|
1722
|
+
throw :response, response
|
1723
|
+
end
|
1724
|
+
rescue ::GRPC::BadStatus => e
|
1725
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1726
|
+
end
|
1727
|
+
|
1728
|
+
##
|
1729
|
+
# Returns the properties of a single acl.
|
1730
|
+
#
|
1731
|
+
# @overload get_acl(request, options = nil)
|
1732
|
+
# Pass arguments to `get_acl` via a request object, either of type
|
1733
|
+
# {::Google::Cloud::ManagedKafka::V1::GetAclRequest} or an equivalent Hash.
|
1734
|
+
#
|
1735
|
+
# @param request [::Google::Cloud::ManagedKafka::V1::GetAclRequest, ::Hash]
|
1736
|
+
# A request object representing the call parameters. Required. To specify no
|
1737
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1738
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1739
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1740
|
+
#
|
1741
|
+
# @overload get_acl(name: nil)
|
1742
|
+
# Pass arguments to `get_acl` via keyword arguments. Note that at
|
1743
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1744
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1745
|
+
#
|
1746
|
+
# @param name [::String]
|
1747
|
+
# Required. The name of the acl to return.
|
1748
|
+
# Structured like:
|
1749
|
+
# `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
|
1750
|
+
#
|
1751
|
+
# The structure of `acl_id` defines the Resource Pattern (resource_type,
|
1752
|
+
# resource_name, pattern_type) of the acl. See `Acl.name` for
|
1753
|
+
# details.
|
1754
|
+
#
|
1755
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1756
|
+
# @yieldparam response [::Google::Cloud::ManagedKafka::V1::Acl]
|
1757
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1758
|
+
#
|
1759
|
+
# @return [::Google::Cloud::ManagedKafka::V1::Acl]
|
1760
|
+
#
|
1761
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1762
|
+
#
|
1763
|
+
# @example Basic example
|
1764
|
+
# require "google/cloud/managed_kafka/v1"
|
1765
|
+
#
|
1766
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1767
|
+
# client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new
|
1768
|
+
#
|
1769
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1770
|
+
# request = Google::Cloud::ManagedKafka::V1::GetAclRequest.new
|
1771
|
+
#
|
1772
|
+
# # Call the get_acl method.
|
1773
|
+
# result = client.get_acl request
|
1774
|
+
#
|
1775
|
+
# # The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
|
1776
|
+
# p result
|
1777
|
+
#
|
1778
|
+
def get_acl request, options = nil
|
1779
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1780
|
+
|
1781
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::GetAclRequest
|
1782
|
+
|
1783
|
+
# Converts hash and nil to an options object
|
1784
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1785
|
+
|
1786
|
+
# Customize the options with defaults
|
1787
|
+
metadata = @config.rpcs.get_acl.metadata.to_h
|
1788
|
+
|
1789
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1790
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1791
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1792
|
+
gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION
|
1793
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1794
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1795
|
+
|
1796
|
+
header_params = {}
|
1797
|
+
if request.name
|
1798
|
+
header_params["name"] = request.name
|
1799
|
+
end
|
1800
|
+
|
1801
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1802
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1803
|
+
|
1804
|
+
options.apply_defaults timeout: @config.rpcs.get_acl.timeout,
|
1805
|
+
metadata: metadata,
|
1806
|
+
retry_policy: @config.rpcs.get_acl.retry_policy
|
1807
|
+
|
1808
|
+
options.apply_defaults timeout: @config.timeout,
|
1809
|
+
metadata: @config.metadata,
|
1810
|
+
retry_policy: @config.retry_policy
|
1811
|
+
|
1812
|
+
@managed_kafka_stub.call_rpc :get_acl, request, options: options do |response, operation|
|
1813
|
+
yield response, operation if block_given?
|
1814
|
+
end
|
1815
|
+
rescue ::GRPC::BadStatus => e
|
1816
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1817
|
+
end
|
1818
|
+
|
1819
|
+
##
|
1820
|
+
# Creates a new acl in the given project, location, and cluster.
|
1821
|
+
#
|
1822
|
+
# @overload create_acl(request, options = nil)
|
1823
|
+
# Pass arguments to `create_acl` via a request object, either of type
|
1824
|
+
# {::Google::Cloud::ManagedKafka::V1::CreateAclRequest} or an equivalent Hash.
|
1825
|
+
#
|
1826
|
+
# @param request [::Google::Cloud::ManagedKafka::V1::CreateAclRequest, ::Hash]
|
1827
|
+
# A request object representing the call parameters. Required. To specify no
|
1828
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1829
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1830
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1831
|
+
#
|
1832
|
+
# @overload create_acl(parent: nil, acl_id: nil, acl: nil)
|
1833
|
+
# Pass arguments to `create_acl` via keyword arguments. Note that at
|
1834
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1835
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1836
|
+
#
|
1837
|
+
# @param parent [::String]
|
1838
|
+
# Required. The parent cluster in which to create the acl.
|
1839
|
+
# Structured like
|
1840
|
+
# `projects/{project}/locations/{location}/clusters/{cluster}`.
|
1841
|
+
# @param acl_id [::String]
|
1842
|
+
# Required. The ID to use for the acl, which will become the final component
|
1843
|
+
# of the acl's name. The structure of `acl_id` defines the Resource Pattern
|
1844
|
+
# (resource_type, resource_name, pattern_type) of the acl. `acl_id` is
|
1845
|
+
# structured like one of the following:
|
1846
|
+
#
|
1847
|
+
# For acls on the cluster:
|
1848
|
+
# `cluster`
|
1849
|
+
#
|
1850
|
+
# For acls on a single resource within the cluster:
|
1851
|
+
# `topic/{resource_name}`
|
1852
|
+
# `consumerGroup/{resource_name}`
|
1853
|
+
# `transactionalId/{resource_name}`
|
1854
|
+
#
|
1855
|
+
# For acls on all resources that match a prefix:
|
1856
|
+
# `topicPrefixed/{resource_name}`
|
1857
|
+
# `consumerGroupPrefixed/{resource_name}`
|
1858
|
+
# `transactionalIdPrefixed/{resource_name}`
|
1859
|
+
#
|
1860
|
+
# For acls on all resources of a given type (i.e. the wildcard literal "*"):
|
1861
|
+
# `allTopics` (represents `topic/*`)
|
1862
|
+
# `allConsumerGroups` (represents `consumerGroup/*`)
|
1863
|
+
# `allTransactionalIds` (represents `transactionalId/*`)
|
1864
|
+
# @param acl [::Google::Cloud::ManagedKafka::V1::Acl, ::Hash]
|
1865
|
+
# Required. Configuration of the acl to create. Its `name` field is ignored.
|
1866
|
+
#
|
1867
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1868
|
+
# @yieldparam response [::Google::Cloud::ManagedKafka::V1::Acl]
|
1869
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1870
|
+
#
|
1871
|
+
# @return [::Google::Cloud::ManagedKafka::V1::Acl]
|
1872
|
+
#
|
1873
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1874
|
+
#
|
1875
|
+
# @example Basic example
|
1876
|
+
# require "google/cloud/managed_kafka/v1"
|
1877
|
+
#
|
1878
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1879
|
+
# client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new
|
1880
|
+
#
|
1881
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1882
|
+
# request = Google::Cloud::ManagedKafka::V1::CreateAclRequest.new
|
1883
|
+
#
|
1884
|
+
# # Call the create_acl method.
|
1885
|
+
# result = client.create_acl request
|
1886
|
+
#
|
1887
|
+
# # The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
|
1888
|
+
# p result
|
1889
|
+
#
|
1890
|
+
def create_acl request, options = nil
|
1891
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1892
|
+
|
1893
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::CreateAclRequest
|
1894
|
+
|
1895
|
+
# Converts hash and nil to an options object
|
1896
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1897
|
+
|
1898
|
+
# Customize the options with defaults
|
1899
|
+
metadata = @config.rpcs.create_acl.metadata.to_h
|
1900
|
+
|
1901
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1902
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1903
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1904
|
+
gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION
|
1905
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1906
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1907
|
+
|
1908
|
+
header_params = {}
|
1909
|
+
if request.parent
|
1910
|
+
header_params["parent"] = request.parent
|
1911
|
+
end
|
1912
|
+
|
1913
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1914
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1915
|
+
|
1916
|
+
options.apply_defaults timeout: @config.rpcs.create_acl.timeout,
|
1917
|
+
metadata: metadata,
|
1918
|
+
retry_policy: @config.rpcs.create_acl.retry_policy
|
1919
|
+
|
1920
|
+
options.apply_defaults timeout: @config.timeout,
|
1921
|
+
metadata: @config.metadata,
|
1922
|
+
retry_policy: @config.retry_policy
|
1923
|
+
|
1924
|
+
@managed_kafka_stub.call_rpc :create_acl, request, options: options do |response, operation|
|
1925
|
+
yield response, operation if block_given?
|
1926
|
+
end
|
1927
|
+
rescue ::GRPC::BadStatus => e
|
1928
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1929
|
+
end
|
1930
|
+
|
1931
|
+
##
|
1932
|
+
# Updates the properties of a single acl.
|
1933
|
+
#
|
1934
|
+
# @overload update_acl(request, options = nil)
|
1935
|
+
# Pass arguments to `update_acl` via a request object, either of type
|
1936
|
+
# {::Google::Cloud::ManagedKafka::V1::UpdateAclRequest} or an equivalent Hash.
|
1937
|
+
#
|
1938
|
+
# @param request [::Google::Cloud::ManagedKafka::V1::UpdateAclRequest, ::Hash]
|
1939
|
+
# A request object representing the call parameters. Required. To specify no
|
1940
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1941
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1942
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1943
|
+
#
|
1944
|
+
# @overload update_acl(acl: nil, update_mask: nil)
|
1945
|
+
# Pass arguments to `update_acl` via keyword arguments. Note that at
|
1946
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1947
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1948
|
+
#
|
1949
|
+
# @param acl [::Google::Cloud::ManagedKafka::V1::Acl, ::Hash]
|
1950
|
+
# Required. The updated acl. Its `name` and `etag` fields must be populated.
|
1951
|
+
# `acl_entries` must not be empty in the updated acl; to remove all acl
|
1952
|
+
# entries for an acl, use DeleteAcl.
|
1953
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1954
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
1955
|
+
# Acl resource by the update. The fields specified in the update_mask are
|
1956
|
+
# relative to the resource, not the full request. A field will be overwritten
|
1957
|
+
# if it is in the mask.
|
1958
|
+
#
|
1959
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1960
|
+
# @yieldparam response [::Google::Cloud::ManagedKafka::V1::Acl]
|
1961
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1962
|
+
#
|
1963
|
+
# @return [::Google::Cloud::ManagedKafka::V1::Acl]
|
1964
|
+
#
|
1965
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1966
|
+
#
|
1967
|
+
# @example Basic example
|
1968
|
+
# require "google/cloud/managed_kafka/v1"
|
1969
|
+
#
|
1970
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1971
|
+
# client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new
|
1972
|
+
#
|
1973
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1974
|
+
# request = Google::Cloud::ManagedKafka::V1::UpdateAclRequest.new
|
1975
|
+
#
|
1976
|
+
# # Call the update_acl method.
|
1977
|
+
# result = client.update_acl request
|
1978
|
+
#
|
1979
|
+
# # The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
|
1980
|
+
# p result
|
1981
|
+
#
|
1982
|
+
def update_acl request, options = nil
|
1983
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1984
|
+
|
1985
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::UpdateAclRequest
|
1986
|
+
|
1987
|
+
# Converts hash and nil to an options object
|
1988
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1989
|
+
|
1990
|
+
# Customize the options with defaults
|
1991
|
+
metadata = @config.rpcs.update_acl.metadata.to_h
|
1992
|
+
|
1993
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1994
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1995
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1996
|
+
gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION
|
1997
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1998
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1999
|
+
|
2000
|
+
header_params = {}
|
2001
|
+
if request.acl&.name
|
2002
|
+
header_params["acl.name"] = request.acl.name
|
2003
|
+
end
|
2004
|
+
|
2005
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2006
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2007
|
+
|
2008
|
+
options.apply_defaults timeout: @config.rpcs.update_acl.timeout,
|
2009
|
+
metadata: metadata,
|
2010
|
+
retry_policy: @config.rpcs.update_acl.retry_policy
|
2011
|
+
|
2012
|
+
options.apply_defaults timeout: @config.timeout,
|
2013
|
+
metadata: @config.metadata,
|
2014
|
+
retry_policy: @config.retry_policy
|
2015
|
+
|
2016
|
+
@managed_kafka_stub.call_rpc :update_acl, request, options: options do |response, operation|
|
2017
|
+
yield response, operation if block_given?
|
2018
|
+
end
|
2019
|
+
rescue ::GRPC::BadStatus => e
|
2020
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2021
|
+
end
|
2022
|
+
|
2023
|
+
##
|
2024
|
+
# Deletes an acl.
|
2025
|
+
#
|
2026
|
+
# @overload delete_acl(request, options = nil)
|
2027
|
+
# Pass arguments to `delete_acl` via a request object, either of type
|
2028
|
+
# {::Google::Cloud::ManagedKafka::V1::DeleteAclRequest} or an equivalent Hash.
|
2029
|
+
#
|
2030
|
+
# @param request [::Google::Cloud::ManagedKafka::V1::DeleteAclRequest, ::Hash]
|
2031
|
+
# A request object representing the call parameters. Required. To specify no
|
2032
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2033
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2034
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2035
|
+
#
|
2036
|
+
# @overload delete_acl(name: nil)
|
2037
|
+
# Pass arguments to `delete_acl` via keyword arguments. Note that at
|
2038
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2039
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2040
|
+
#
|
2041
|
+
# @param name [::String]
|
2042
|
+
# Required. The name of the acl to delete.
|
2043
|
+
# Structured like:
|
2044
|
+
# `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
|
2045
|
+
#
|
2046
|
+
# The structure of `acl_id` defines the Resource Pattern (resource_type,
|
2047
|
+
# resource_name, pattern_type) of the acl. See `Acl.name` for details.
|
2048
|
+
#
|
2049
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2050
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
2051
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2052
|
+
#
|
2053
|
+
# @return [::Google::Protobuf::Empty]
|
2054
|
+
#
|
2055
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2056
|
+
#
|
2057
|
+
# @example Basic example
|
2058
|
+
# require "google/cloud/managed_kafka/v1"
|
2059
|
+
#
|
2060
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2061
|
+
# client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new
|
2062
|
+
#
|
2063
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2064
|
+
# request = Google::Cloud::ManagedKafka::V1::DeleteAclRequest.new
|
2065
|
+
#
|
2066
|
+
# # Call the delete_acl method.
|
2067
|
+
# result = client.delete_acl request
|
2068
|
+
#
|
2069
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
2070
|
+
# p result
|
2071
|
+
#
|
2072
|
+
def delete_acl request, options = nil
|
2073
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2074
|
+
|
2075
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::DeleteAclRequest
|
2076
|
+
|
2077
|
+
# Converts hash and nil to an options object
|
2078
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2079
|
+
|
2080
|
+
# Customize the options with defaults
|
2081
|
+
metadata = @config.rpcs.delete_acl.metadata.to_h
|
2082
|
+
|
2083
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2084
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2085
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2086
|
+
gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION
|
2087
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2088
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2089
|
+
|
2090
|
+
header_params = {}
|
2091
|
+
if request.name
|
2092
|
+
header_params["name"] = request.name
|
2093
|
+
end
|
2094
|
+
|
2095
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2096
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2097
|
+
|
2098
|
+
options.apply_defaults timeout: @config.rpcs.delete_acl.timeout,
|
2099
|
+
metadata: metadata,
|
2100
|
+
retry_policy: @config.rpcs.delete_acl.retry_policy
|
2101
|
+
|
2102
|
+
options.apply_defaults timeout: @config.timeout,
|
2103
|
+
metadata: @config.metadata,
|
2104
|
+
retry_policy: @config.retry_policy
|
2105
|
+
|
2106
|
+
@managed_kafka_stub.call_rpc :delete_acl, request, options: options do |response, operation|
|
2107
|
+
yield response, operation if block_given?
|
2108
|
+
end
|
2109
|
+
rescue ::GRPC::BadStatus => e
|
2110
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2111
|
+
end
|
2112
|
+
|
2113
|
+
##
|
2114
|
+
# Incremental update: Adds an acl entry to an acl. Creates the acl if it does
|
2115
|
+
# not exist yet.
|
2116
|
+
#
|
2117
|
+
# @overload add_acl_entry(request, options = nil)
|
2118
|
+
# Pass arguments to `add_acl_entry` via a request object, either of type
|
2119
|
+
# {::Google::Cloud::ManagedKafka::V1::AddAclEntryRequest} or an equivalent Hash.
|
2120
|
+
#
|
2121
|
+
# @param request [::Google::Cloud::ManagedKafka::V1::AddAclEntryRequest, ::Hash]
|
2122
|
+
# A request object representing the call parameters. Required. To specify no
|
2123
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2124
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2125
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2126
|
+
#
|
2127
|
+
# @overload add_acl_entry(acl: nil, acl_entry: nil)
|
2128
|
+
# Pass arguments to `add_acl_entry` via keyword arguments. Note that at
|
2129
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2130
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2131
|
+
#
|
2132
|
+
# @param acl [::String]
|
2133
|
+
# Required. The name of the acl to add the acl entry to.
|
2134
|
+
# Structured like:
|
2135
|
+
# `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
|
2136
|
+
#
|
2137
|
+
# The structure of `acl_id` defines the Resource Pattern (resource_type,
|
2138
|
+
# resource_name, pattern_type) of the acl. See `Acl.name` for
|
2139
|
+
# details.
|
2140
|
+
# @param acl_entry [::Google::Cloud::ManagedKafka::V1::AclEntry, ::Hash]
|
2141
|
+
# Required. The acl entry to add.
|
2142
|
+
#
|
2143
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2144
|
+
# @yieldparam response [::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse]
|
2145
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2146
|
+
#
|
2147
|
+
# @return [::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse]
|
2148
|
+
#
|
2149
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2150
|
+
#
|
2151
|
+
# @example Basic example
|
2152
|
+
# require "google/cloud/managed_kafka/v1"
|
2153
|
+
#
|
2154
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2155
|
+
# client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new
|
2156
|
+
#
|
2157
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2158
|
+
# request = Google::Cloud::ManagedKafka::V1::AddAclEntryRequest.new
|
2159
|
+
#
|
2160
|
+
# # Call the add_acl_entry method.
|
2161
|
+
# result = client.add_acl_entry request
|
2162
|
+
#
|
2163
|
+
# # The returned object is of type Google::Cloud::ManagedKafka::V1::AddAclEntryResponse.
|
2164
|
+
# p result
|
2165
|
+
#
|
2166
|
+
def add_acl_entry request, options = nil
|
2167
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2168
|
+
|
2169
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::AddAclEntryRequest
|
2170
|
+
|
2171
|
+
# Converts hash and nil to an options object
|
2172
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2173
|
+
|
2174
|
+
# Customize the options with defaults
|
2175
|
+
metadata = @config.rpcs.add_acl_entry.metadata.to_h
|
2176
|
+
|
2177
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2178
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2179
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2180
|
+
gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION
|
2181
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2182
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2183
|
+
|
2184
|
+
header_params = {}
|
2185
|
+
if request.acl
|
2186
|
+
header_params["acl"] = request.acl
|
2187
|
+
end
|
2188
|
+
|
2189
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2190
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2191
|
+
|
2192
|
+
options.apply_defaults timeout: @config.rpcs.add_acl_entry.timeout,
|
2193
|
+
metadata: metadata,
|
2194
|
+
retry_policy: @config.rpcs.add_acl_entry.retry_policy
|
2195
|
+
|
2196
|
+
options.apply_defaults timeout: @config.timeout,
|
2197
|
+
metadata: @config.metadata,
|
2198
|
+
retry_policy: @config.retry_policy
|
2199
|
+
|
2200
|
+
@managed_kafka_stub.call_rpc :add_acl_entry, request, options: options do |response, operation|
|
2201
|
+
yield response, operation if block_given?
|
2202
|
+
end
|
2203
|
+
rescue ::GRPC::BadStatus => e
|
2204
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2205
|
+
end
|
2206
|
+
|
2207
|
+
##
|
2208
|
+
# Incremental update: Removes an acl entry from an acl. Deletes the acl if
|
2209
|
+
# its acl entries become empty (i.e. if the removed entry was the last one in
|
2210
|
+
# the acl).
|
2211
|
+
#
|
2212
|
+
# @overload remove_acl_entry(request, options = nil)
|
2213
|
+
# Pass arguments to `remove_acl_entry` via a request object, either of type
|
2214
|
+
# {::Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest} or an equivalent Hash.
|
2215
|
+
#
|
2216
|
+
# @param request [::Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest, ::Hash]
|
2217
|
+
# A request object representing the call parameters. Required. To specify no
|
2218
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2219
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2220
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2221
|
+
#
|
2222
|
+
# @overload remove_acl_entry(acl: nil, acl_entry: nil)
|
2223
|
+
# Pass arguments to `remove_acl_entry` via keyword arguments. Note that at
|
2224
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2225
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2226
|
+
#
|
2227
|
+
# @param acl [::String]
|
2228
|
+
# Required. The name of the acl to remove the acl entry from.
|
2229
|
+
# Structured like:
|
2230
|
+
# `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
|
2231
|
+
#
|
2232
|
+
# The structure of `acl_id` defines the Resource Pattern (resource_type,
|
2233
|
+
# resource_name, pattern_type) of the acl. See `Acl.name` for
|
2234
|
+
# details.
|
2235
|
+
# @param acl_entry [::Google::Cloud::ManagedKafka::V1::AclEntry, ::Hash]
|
2236
|
+
# Required. The acl entry to remove.
|
2237
|
+
#
|
2238
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2239
|
+
# @yieldparam response [::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse]
|
2240
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2241
|
+
#
|
2242
|
+
# @return [::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse]
|
2243
|
+
#
|
2244
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2245
|
+
#
|
2246
|
+
# @example Basic example
|
2247
|
+
# require "google/cloud/managed_kafka/v1"
|
2248
|
+
#
|
2249
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2250
|
+
# client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new
|
2251
|
+
#
|
2252
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2253
|
+
# request = Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest.new
|
2254
|
+
#
|
2255
|
+
# # Call the remove_acl_entry method.
|
2256
|
+
# result = client.remove_acl_entry request
|
2257
|
+
#
|
2258
|
+
# # The returned object is of type Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse.
|
2259
|
+
# p result
|
2260
|
+
#
|
2261
|
+
def remove_acl_entry request, options = nil
|
2262
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2263
|
+
|
2264
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest
|
2265
|
+
|
2266
|
+
# Converts hash and nil to an options object
|
2267
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2268
|
+
|
2269
|
+
# Customize the options with defaults
|
2270
|
+
metadata = @config.rpcs.remove_acl_entry.metadata.to_h
|
2271
|
+
|
2272
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2273
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2274
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2275
|
+
gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION
|
2276
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2277
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2278
|
+
|
2279
|
+
header_params = {}
|
2280
|
+
if request.acl
|
2281
|
+
header_params["acl"] = request.acl
|
2282
|
+
end
|
2283
|
+
|
2284
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2285
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2286
|
+
|
2287
|
+
options.apply_defaults timeout: @config.rpcs.remove_acl_entry.timeout,
|
2288
|
+
metadata: metadata,
|
2289
|
+
retry_policy: @config.rpcs.remove_acl_entry.retry_policy
|
2290
|
+
|
2291
|
+
options.apply_defaults timeout: @config.timeout,
|
2292
|
+
metadata: @config.metadata,
|
2293
|
+
retry_policy: @config.retry_policy
|
2294
|
+
|
2295
|
+
@managed_kafka_stub.call_rpc :remove_acl_entry, request, options: options do |response, operation|
|
2296
|
+
yield response, operation if block_given?
|
2297
|
+
end
|
2298
|
+
rescue ::GRPC::BadStatus => e
|
2299
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2300
|
+
end
|
2301
|
+
|
1625
2302
|
##
|
1626
2303
|
# Configuration class for the ManagedKafka API.
|
1627
2304
|
#
|
@@ -1858,6 +2535,41 @@ module Google
|
|
1858
2535
|
# @return [::Gapic::Config::Method]
|
1859
2536
|
#
|
1860
2537
|
attr_reader :delete_consumer_group
|
2538
|
+
##
|
2539
|
+
# RPC-specific configuration for `list_acls`
|
2540
|
+
# @return [::Gapic::Config::Method]
|
2541
|
+
#
|
2542
|
+
attr_reader :list_acls
|
2543
|
+
##
|
2544
|
+
# RPC-specific configuration for `get_acl`
|
2545
|
+
# @return [::Gapic::Config::Method]
|
2546
|
+
#
|
2547
|
+
attr_reader :get_acl
|
2548
|
+
##
|
2549
|
+
# RPC-specific configuration for `create_acl`
|
2550
|
+
# @return [::Gapic::Config::Method]
|
2551
|
+
#
|
2552
|
+
attr_reader :create_acl
|
2553
|
+
##
|
2554
|
+
# RPC-specific configuration for `update_acl`
|
2555
|
+
# @return [::Gapic::Config::Method]
|
2556
|
+
#
|
2557
|
+
attr_reader :update_acl
|
2558
|
+
##
|
2559
|
+
# RPC-specific configuration for `delete_acl`
|
2560
|
+
# @return [::Gapic::Config::Method]
|
2561
|
+
#
|
2562
|
+
attr_reader :delete_acl
|
2563
|
+
##
|
2564
|
+
# RPC-specific configuration for `add_acl_entry`
|
2565
|
+
# @return [::Gapic::Config::Method]
|
2566
|
+
#
|
2567
|
+
attr_reader :add_acl_entry
|
2568
|
+
##
|
2569
|
+
# RPC-specific configuration for `remove_acl_entry`
|
2570
|
+
# @return [::Gapic::Config::Method]
|
2571
|
+
#
|
2572
|
+
attr_reader :remove_acl_entry
|
1861
2573
|
|
1862
2574
|
# @private
|
1863
2575
|
def initialize parent_rpcs = nil
|
@@ -1889,6 +2601,20 @@ module Google
|
|
1889
2601
|
@update_consumer_group = ::Gapic::Config::Method.new update_consumer_group_config
|
1890
2602
|
delete_consumer_group_config = parent_rpcs.delete_consumer_group if parent_rpcs.respond_to? :delete_consumer_group
|
1891
2603
|
@delete_consumer_group = ::Gapic::Config::Method.new delete_consumer_group_config
|
2604
|
+
list_acls_config = parent_rpcs.list_acls if parent_rpcs.respond_to? :list_acls
|
2605
|
+
@list_acls = ::Gapic::Config::Method.new list_acls_config
|
2606
|
+
get_acl_config = parent_rpcs.get_acl if parent_rpcs.respond_to? :get_acl
|
2607
|
+
@get_acl = ::Gapic::Config::Method.new get_acl_config
|
2608
|
+
create_acl_config = parent_rpcs.create_acl if parent_rpcs.respond_to? :create_acl
|
2609
|
+
@create_acl = ::Gapic::Config::Method.new create_acl_config
|
2610
|
+
update_acl_config = parent_rpcs.update_acl if parent_rpcs.respond_to? :update_acl
|
2611
|
+
@update_acl = ::Gapic::Config::Method.new update_acl_config
|
2612
|
+
delete_acl_config = parent_rpcs.delete_acl if parent_rpcs.respond_to? :delete_acl
|
2613
|
+
@delete_acl = ::Gapic::Config::Method.new delete_acl_config
|
2614
|
+
add_acl_entry_config = parent_rpcs.add_acl_entry if parent_rpcs.respond_to? :add_acl_entry
|
2615
|
+
@add_acl_entry = ::Gapic::Config::Method.new add_acl_entry_config
|
2616
|
+
remove_acl_entry_config = parent_rpcs.remove_acl_entry if parent_rpcs.respond_to? :remove_acl_entry
|
2617
|
+
@remove_acl_entry = ::Gapic::Config::Method.new remove_acl_entry_config
|
1892
2618
|
|
1893
2619
|
yield self if block_given?
|
1894
2620
|
end
|