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.
@@ -1518,6 +1518,634 @@ module Google
1518
1518
  raise ::Google::Cloud::Error.from_error(e)
1519
1519
  end
1520
1520
 
1521
+ ##
1522
+ # Lists the acls in a given cluster.
1523
+ #
1524
+ # @overload list_acls(request, options = nil)
1525
+ # Pass arguments to `list_acls` via a request object, either of type
1526
+ # {::Google::Cloud::ManagedKafka::V1::ListAclsRequest} or an equivalent Hash.
1527
+ #
1528
+ # @param request [::Google::Cloud::ManagedKafka::V1::ListAclsRequest, ::Hash]
1529
+ # A request object representing the call parameters. Required. To specify no
1530
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1531
+ # @param options [::Gapic::CallOptions, ::Hash]
1532
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1533
+ #
1534
+ # @overload list_acls(parent: nil, page_size: nil, page_token: nil)
1535
+ # Pass arguments to `list_acls` via keyword arguments. Note that at
1536
+ # least one keyword argument is required. To specify no parameters, or to keep all
1537
+ # the default parameter values, pass an empty Hash as a request object (see above).
1538
+ #
1539
+ # @param parent [::String]
1540
+ # Required. The parent cluster whose acls are to be listed.
1541
+ # Structured like
1542
+ # `projects/{project}/locations/{location}/clusters/{cluster}`.
1543
+ # @param page_size [::Integer]
1544
+ # Optional. The maximum number of acls to return. The service may return
1545
+ # fewer than this value. If unset or zero, all acls for the parent is
1546
+ # returned.
1547
+ # @param page_token [::String]
1548
+ # Optional. A page token, received from a previous `ListAcls` call.
1549
+ # Provide this to retrieve the subsequent page.
1550
+ #
1551
+ # When paginating, all other parameters provided to `ListAcls` must match
1552
+ # the call that provided the page token.
1553
+ # @yield [result, operation] Access the result along with the TransportOperation object
1554
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>]
1555
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1556
+ #
1557
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>]
1558
+ #
1559
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1560
+ #
1561
+ # @example Basic example
1562
+ # require "google/cloud/managed_kafka/v1"
1563
+ #
1564
+ # # Create a client object. The client can be reused for multiple calls.
1565
+ # client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Rest::Client.new
1566
+ #
1567
+ # # Create a request. To set request fields, pass in keyword arguments.
1568
+ # request = Google::Cloud::ManagedKafka::V1::ListAclsRequest.new
1569
+ #
1570
+ # # Call the list_acls method.
1571
+ # result = client.list_acls request
1572
+ #
1573
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1574
+ # # over elements, and API calls will be issued to fetch pages as needed.
1575
+ # result.each do |item|
1576
+ # # Each element is of type ::Google::Cloud::ManagedKafka::V1::Acl.
1577
+ # p item
1578
+ # end
1579
+ #
1580
+ def list_acls request, options = nil
1581
+ raise ::ArgumentError, "request must be provided" if request.nil?
1582
+
1583
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::ListAclsRequest
1584
+
1585
+ # Converts hash and nil to an options object
1586
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1587
+
1588
+ # Customize the options with defaults
1589
+ call_metadata = @config.rpcs.list_acls.metadata.to_h
1590
+
1591
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1592
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1593
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1594
+ gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION,
1595
+ transports_version_send: [:rest]
1596
+
1597
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1598
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1599
+
1600
+ options.apply_defaults timeout: @config.rpcs.list_acls.timeout,
1601
+ metadata: call_metadata,
1602
+ retry_policy: @config.rpcs.list_acls.retry_policy
1603
+
1604
+ options.apply_defaults timeout: @config.timeout,
1605
+ metadata: @config.metadata,
1606
+ retry_policy: @config.retry_policy
1607
+
1608
+ @managed_kafka_stub.list_acls request, options do |result, operation|
1609
+ result = ::Gapic::Rest::PagedEnumerable.new @managed_kafka_stub, :list_acls, "acls", request, result, options
1610
+ yield result, operation if block_given?
1611
+ throw :response, result
1612
+ end
1613
+ rescue ::Gapic::Rest::Error => e
1614
+ raise ::Google::Cloud::Error.from_error(e)
1615
+ end
1616
+
1617
+ ##
1618
+ # Returns the properties of a single acl.
1619
+ #
1620
+ # @overload get_acl(request, options = nil)
1621
+ # Pass arguments to `get_acl` via a request object, either of type
1622
+ # {::Google::Cloud::ManagedKafka::V1::GetAclRequest} or an equivalent Hash.
1623
+ #
1624
+ # @param request [::Google::Cloud::ManagedKafka::V1::GetAclRequest, ::Hash]
1625
+ # A request object representing the call parameters. Required. To specify no
1626
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1627
+ # @param options [::Gapic::CallOptions, ::Hash]
1628
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1629
+ #
1630
+ # @overload get_acl(name: nil)
1631
+ # Pass arguments to `get_acl` via keyword arguments. Note that at
1632
+ # least one keyword argument is required. To specify no parameters, or to keep all
1633
+ # the default parameter values, pass an empty Hash as a request object (see above).
1634
+ #
1635
+ # @param name [::String]
1636
+ # Required. The name of the acl to return.
1637
+ # Structured like:
1638
+ # `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
1639
+ #
1640
+ # The structure of `acl_id` defines the Resource Pattern (resource_type,
1641
+ # resource_name, pattern_type) of the acl. See `Acl.name` for
1642
+ # details.
1643
+ # @yield [result, operation] Access the result along with the TransportOperation object
1644
+ # @yieldparam result [::Google::Cloud::ManagedKafka::V1::Acl]
1645
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1646
+ #
1647
+ # @return [::Google::Cloud::ManagedKafka::V1::Acl]
1648
+ #
1649
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1650
+ #
1651
+ # @example Basic example
1652
+ # require "google/cloud/managed_kafka/v1"
1653
+ #
1654
+ # # Create a client object. The client can be reused for multiple calls.
1655
+ # client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Rest::Client.new
1656
+ #
1657
+ # # Create a request. To set request fields, pass in keyword arguments.
1658
+ # request = Google::Cloud::ManagedKafka::V1::GetAclRequest.new
1659
+ #
1660
+ # # Call the get_acl method.
1661
+ # result = client.get_acl request
1662
+ #
1663
+ # # The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
1664
+ # p result
1665
+ #
1666
+ def get_acl request, options = nil
1667
+ raise ::ArgumentError, "request must be provided" if request.nil?
1668
+
1669
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::GetAclRequest
1670
+
1671
+ # Converts hash and nil to an options object
1672
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1673
+
1674
+ # Customize the options with defaults
1675
+ call_metadata = @config.rpcs.get_acl.metadata.to_h
1676
+
1677
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1678
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1679
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1680
+ gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION,
1681
+ transports_version_send: [:rest]
1682
+
1683
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1684
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1685
+
1686
+ options.apply_defaults timeout: @config.rpcs.get_acl.timeout,
1687
+ metadata: call_metadata,
1688
+ retry_policy: @config.rpcs.get_acl.retry_policy
1689
+
1690
+ options.apply_defaults timeout: @config.timeout,
1691
+ metadata: @config.metadata,
1692
+ retry_policy: @config.retry_policy
1693
+
1694
+ @managed_kafka_stub.get_acl request, options do |result, operation|
1695
+ yield result, operation if block_given?
1696
+ end
1697
+ rescue ::Gapic::Rest::Error => e
1698
+ raise ::Google::Cloud::Error.from_error(e)
1699
+ end
1700
+
1701
+ ##
1702
+ # Creates a new acl in the given project, location, and cluster.
1703
+ #
1704
+ # @overload create_acl(request, options = nil)
1705
+ # Pass arguments to `create_acl` via a request object, either of type
1706
+ # {::Google::Cloud::ManagedKafka::V1::CreateAclRequest} or an equivalent Hash.
1707
+ #
1708
+ # @param request [::Google::Cloud::ManagedKafka::V1::CreateAclRequest, ::Hash]
1709
+ # A request object representing the call parameters. Required. To specify no
1710
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1711
+ # @param options [::Gapic::CallOptions, ::Hash]
1712
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1713
+ #
1714
+ # @overload create_acl(parent: nil, acl_id: nil, acl: nil)
1715
+ # Pass arguments to `create_acl` via keyword arguments. Note that at
1716
+ # least one keyword argument is required. To specify no parameters, or to keep all
1717
+ # the default parameter values, pass an empty Hash as a request object (see above).
1718
+ #
1719
+ # @param parent [::String]
1720
+ # Required. The parent cluster in which to create the acl.
1721
+ # Structured like
1722
+ # `projects/{project}/locations/{location}/clusters/{cluster}`.
1723
+ # @param acl_id [::String]
1724
+ # Required. The ID to use for the acl, which will become the final component
1725
+ # of the acl's name. The structure of `acl_id` defines the Resource Pattern
1726
+ # (resource_type, resource_name, pattern_type) of the acl. `acl_id` is
1727
+ # structured like one of the following:
1728
+ #
1729
+ # For acls on the cluster:
1730
+ # `cluster`
1731
+ #
1732
+ # For acls on a single resource within the cluster:
1733
+ # `topic/{resource_name}`
1734
+ # `consumerGroup/{resource_name}`
1735
+ # `transactionalId/{resource_name}`
1736
+ #
1737
+ # For acls on all resources that match a prefix:
1738
+ # `topicPrefixed/{resource_name}`
1739
+ # `consumerGroupPrefixed/{resource_name}`
1740
+ # `transactionalIdPrefixed/{resource_name}`
1741
+ #
1742
+ # For acls on all resources of a given type (i.e. the wildcard literal "*"):
1743
+ # `allTopics` (represents `topic/*`)
1744
+ # `allConsumerGroups` (represents `consumerGroup/*`)
1745
+ # `allTransactionalIds` (represents `transactionalId/*`)
1746
+ # @param acl [::Google::Cloud::ManagedKafka::V1::Acl, ::Hash]
1747
+ # Required. Configuration of the acl to create. Its `name` field is ignored.
1748
+ # @yield [result, operation] Access the result along with the TransportOperation object
1749
+ # @yieldparam result [::Google::Cloud::ManagedKafka::V1::Acl]
1750
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1751
+ #
1752
+ # @return [::Google::Cloud::ManagedKafka::V1::Acl]
1753
+ #
1754
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1755
+ #
1756
+ # @example Basic example
1757
+ # require "google/cloud/managed_kafka/v1"
1758
+ #
1759
+ # # Create a client object. The client can be reused for multiple calls.
1760
+ # client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Rest::Client.new
1761
+ #
1762
+ # # Create a request. To set request fields, pass in keyword arguments.
1763
+ # request = Google::Cloud::ManagedKafka::V1::CreateAclRequest.new
1764
+ #
1765
+ # # Call the create_acl method.
1766
+ # result = client.create_acl request
1767
+ #
1768
+ # # The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
1769
+ # p result
1770
+ #
1771
+ def create_acl request, options = nil
1772
+ raise ::ArgumentError, "request must be provided" if request.nil?
1773
+
1774
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::CreateAclRequest
1775
+
1776
+ # Converts hash and nil to an options object
1777
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1778
+
1779
+ # Customize the options with defaults
1780
+ call_metadata = @config.rpcs.create_acl.metadata.to_h
1781
+
1782
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1783
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1784
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1785
+ gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION,
1786
+ transports_version_send: [:rest]
1787
+
1788
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1789
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1790
+
1791
+ options.apply_defaults timeout: @config.rpcs.create_acl.timeout,
1792
+ metadata: call_metadata,
1793
+ retry_policy: @config.rpcs.create_acl.retry_policy
1794
+
1795
+ options.apply_defaults timeout: @config.timeout,
1796
+ metadata: @config.metadata,
1797
+ retry_policy: @config.retry_policy
1798
+
1799
+ @managed_kafka_stub.create_acl request, options do |result, operation|
1800
+ yield result, operation if block_given?
1801
+ end
1802
+ rescue ::Gapic::Rest::Error => e
1803
+ raise ::Google::Cloud::Error.from_error(e)
1804
+ end
1805
+
1806
+ ##
1807
+ # Updates the properties of a single acl.
1808
+ #
1809
+ # @overload update_acl(request, options = nil)
1810
+ # Pass arguments to `update_acl` via a request object, either of type
1811
+ # {::Google::Cloud::ManagedKafka::V1::UpdateAclRequest} or an equivalent Hash.
1812
+ #
1813
+ # @param request [::Google::Cloud::ManagedKafka::V1::UpdateAclRequest, ::Hash]
1814
+ # A request object representing the call parameters. Required. To specify no
1815
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1816
+ # @param options [::Gapic::CallOptions, ::Hash]
1817
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1818
+ #
1819
+ # @overload update_acl(acl: nil, update_mask: nil)
1820
+ # Pass arguments to `update_acl` via keyword arguments. Note that at
1821
+ # least one keyword argument is required. To specify no parameters, or to keep all
1822
+ # the default parameter values, pass an empty Hash as a request object (see above).
1823
+ #
1824
+ # @param acl [::Google::Cloud::ManagedKafka::V1::Acl, ::Hash]
1825
+ # Required. The updated acl. Its `name` and `etag` fields must be populated.
1826
+ # `acl_entries` must not be empty in the updated acl; to remove all acl
1827
+ # entries for an acl, use DeleteAcl.
1828
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1829
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1830
+ # Acl resource by the update. The fields specified in the update_mask are
1831
+ # relative to the resource, not the full request. A field will be overwritten
1832
+ # if it is in the mask.
1833
+ # @yield [result, operation] Access the result along with the TransportOperation object
1834
+ # @yieldparam result [::Google::Cloud::ManagedKafka::V1::Acl]
1835
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1836
+ #
1837
+ # @return [::Google::Cloud::ManagedKafka::V1::Acl]
1838
+ #
1839
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1840
+ #
1841
+ # @example Basic example
1842
+ # require "google/cloud/managed_kafka/v1"
1843
+ #
1844
+ # # Create a client object. The client can be reused for multiple calls.
1845
+ # client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Rest::Client.new
1846
+ #
1847
+ # # Create a request. To set request fields, pass in keyword arguments.
1848
+ # request = Google::Cloud::ManagedKafka::V1::UpdateAclRequest.new
1849
+ #
1850
+ # # Call the update_acl method.
1851
+ # result = client.update_acl request
1852
+ #
1853
+ # # The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
1854
+ # p result
1855
+ #
1856
+ def update_acl request, options = nil
1857
+ raise ::ArgumentError, "request must be provided" if request.nil?
1858
+
1859
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::UpdateAclRequest
1860
+
1861
+ # Converts hash and nil to an options object
1862
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1863
+
1864
+ # Customize the options with defaults
1865
+ call_metadata = @config.rpcs.update_acl.metadata.to_h
1866
+
1867
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1868
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1869
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1870
+ gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION,
1871
+ transports_version_send: [:rest]
1872
+
1873
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1874
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1875
+
1876
+ options.apply_defaults timeout: @config.rpcs.update_acl.timeout,
1877
+ metadata: call_metadata,
1878
+ retry_policy: @config.rpcs.update_acl.retry_policy
1879
+
1880
+ options.apply_defaults timeout: @config.timeout,
1881
+ metadata: @config.metadata,
1882
+ retry_policy: @config.retry_policy
1883
+
1884
+ @managed_kafka_stub.update_acl request, options do |result, operation|
1885
+ yield result, operation if block_given?
1886
+ end
1887
+ rescue ::Gapic::Rest::Error => e
1888
+ raise ::Google::Cloud::Error.from_error(e)
1889
+ end
1890
+
1891
+ ##
1892
+ # Deletes an acl.
1893
+ #
1894
+ # @overload delete_acl(request, options = nil)
1895
+ # Pass arguments to `delete_acl` via a request object, either of type
1896
+ # {::Google::Cloud::ManagedKafka::V1::DeleteAclRequest} or an equivalent Hash.
1897
+ #
1898
+ # @param request [::Google::Cloud::ManagedKafka::V1::DeleteAclRequest, ::Hash]
1899
+ # A request object representing the call parameters. Required. To specify no
1900
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1901
+ # @param options [::Gapic::CallOptions, ::Hash]
1902
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1903
+ #
1904
+ # @overload delete_acl(name: nil)
1905
+ # Pass arguments to `delete_acl` via keyword arguments. Note that at
1906
+ # least one keyword argument is required. To specify no parameters, or to keep all
1907
+ # the default parameter values, pass an empty Hash as a request object (see above).
1908
+ #
1909
+ # @param name [::String]
1910
+ # Required. The name of the acl to delete.
1911
+ # Structured like:
1912
+ # `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
1913
+ #
1914
+ # The structure of `acl_id` defines the Resource Pattern (resource_type,
1915
+ # resource_name, pattern_type) of the acl. See `Acl.name` for details.
1916
+ # @yield [result, operation] Access the result along with the TransportOperation object
1917
+ # @yieldparam result [::Google::Protobuf::Empty]
1918
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1919
+ #
1920
+ # @return [::Google::Protobuf::Empty]
1921
+ #
1922
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1923
+ #
1924
+ # @example Basic example
1925
+ # require "google/cloud/managed_kafka/v1"
1926
+ #
1927
+ # # Create a client object. The client can be reused for multiple calls.
1928
+ # client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Rest::Client.new
1929
+ #
1930
+ # # Create a request. To set request fields, pass in keyword arguments.
1931
+ # request = Google::Cloud::ManagedKafka::V1::DeleteAclRequest.new
1932
+ #
1933
+ # # Call the delete_acl method.
1934
+ # result = client.delete_acl request
1935
+ #
1936
+ # # The returned object is of type Google::Protobuf::Empty.
1937
+ # p result
1938
+ #
1939
+ def delete_acl request, options = nil
1940
+ raise ::ArgumentError, "request must be provided" if request.nil?
1941
+
1942
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::DeleteAclRequest
1943
+
1944
+ # Converts hash and nil to an options object
1945
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1946
+
1947
+ # Customize the options with defaults
1948
+ call_metadata = @config.rpcs.delete_acl.metadata.to_h
1949
+
1950
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1951
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1952
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1953
+ gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION,
1954
+ transports_version_send: [:rest]
1955
+
1956
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1957
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1958
+
1959
+ options.apply_defaults timeout: @config.rpcs.delete_acl.timeout,
1960
+ metadata: call_metadata,
1961
+ retry_policy: @config.rpcs.delete_acl.retry_policy
1962
+
1963
+ options.apply_defaults timeout: @config.timeout,
1964
+ metadata: @config.metadata,
1965
+ retry_policy: @config.retry_policy
1966
+
1967
+ @managed_kafka_stub.delete_acl request, options do |result, operation|
1968
+ yield result, operation if block_given?
1969
+ end
1970
+ rescue ::Gapic::Rest::Error => e
1971
+ raise ::Google::Cloud::Error.from_error(e)
1972
+ end
1973
+
1974
+ ##
1975
+ # Incremental update: Adds an acl entry to an acl. Creates the acl if it does
1976
+ # not exist yet.
1977
+ #
1978
+ # @overload add_acl_entry(request, options = nil)
1979
+ # Pass arguments to `add_acl_entry` via a request object, either of type
1980
+ # {::Google::Cloud::ManagedKafka::V1::AddAclEntryRequest} or an equivalent Hash.
1981
+ #
1982
+ # @param request [::Google::Cloud::ManagedKafka::V1::AddAclEntryRequest, ::Hash]
1983
+ # A request object representing the call parameters. Required. To specify no
1984
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1985
+ # @param options [::Gapic::CallOptions, ::Hash]
1986
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1987
+ #
1988
+ # @overload add_acl_entry(acl: nil, acl_entry: nil)
1989
+ # Pass arguments to `add_acl_entry` via keyword arguments. Note that at
1990
+ # least one keyword argument is required. To specify no parameters, or to keep all
1991
+ # the default parameter values, pass an empty Hash as a request object (see above).
1992
+ #
1993
+ # @param acl [::String]
1994
+ # Required. The name of the acl to add the acl entry to.
1995
+ # Structured like:
1996
+ # `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
1997
+ #
1998
+ # The structure of `acl_id` defines the Resource Pattern (resource_type,
1999
+ # resource_name, pattern_type) of the acl. See `Acl.name` for
2000
+ # details.
2001
+ # @param acl_entry [::Google::Cloud::ManagedKafka::V1::AclEntry, ::Hash]
2002
+ # Required. The acl entry to add.
2003
+ # @yield [result, operation] Access the result along with the TransportOperation object
2004
+ # @yieldparam result [::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse]
2005
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2006
+ #
2007
+ # @return [::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse]
2008
+ #
2009
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2010
+ #
2011
+ # @example Basic example
2012
+ # require "google/cloud/managed_kafka/v1"
2013
+ #
2014
+ # # Create a client object. The client can be reused for multiple calls.
2015
+ # client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Rest::Client.new
2016
+ #
2017
+ # # Create a request. To set request fields, pass in keyword arguments.
2018
+ # request = Google::Cloud::ManagedKafka::V1::AddAclEntryRequest.new
2019
+ #
2020
+ # # Call the add_acl_entry method.
2021
+ # result = client.add_acl_entry request
2022
+ #
2023
+ # # The returned object is of type Google::Cloud::ManagedKafka::V1::AddAclEntryResponse.
2024
+ # p result
2025
+ #
2026
+ def add_acl_entry request, options = nil
2027
+ raise ::ArgumentError, "request must be provided" if request.nil?
2028
+
2029
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::AddAclEntryRequest
2030
+
2031
+ # Converts hash and nil to an options object
2032
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2033
+
2034
+ # Customize the options with defaults
2035
+ call_metadata = @config.rpcs.add_acl_entry.metadata.to_h
2036
+
2037
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2038
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2039
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2040
+ gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION,
2041
+ transports_version_send: [:rest]
2042
+
2043
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2044
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2045
+
2046
+ options.apply_defaults timeout: @config.rpcs.add_acl_entry.timeout,
2047
+ metadata: call_metadata,
2048
+ retry_policy: @config.rpcs.add_acl_entry.retry_policy
2049
+
2050
+ options.apply_defaults timeout: @config.timeout,
2051
+ metadata: @config.metadata,
2052
+ retry_policy: @config.retry_policy
2053
+
2054
+ @managed_kafka_stub.add_acl_entry request, options do |result, operation|
2055
+ yield result, operation if block_given?
2056
+ end
2057
+ rescue ::Gapic::Rest::Error => e
2058
+ raise ::Google::Cloud::Error.from_error(e)
2059
+ end
2060
+
2061
+ ##
2062
+ # Incremental update: Removes an acl entry from an acl. Deletes the acl if
2063
+ # its acl entries become empty (i.e. if the removed entry was the last one in
2064
+ # the acl).
2065
+ #
2066
+ # @overload remove_acl_entry(request, options = nil)
2067
+ # Pass arguments to `remove_acl_entry` via a request object, either of type
2068
+ # {::Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest} or an equivalent Hash.
2069
+ #
2070
+ # @param request [::Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest, ::Hash]
2071
+ # A request object representing the call parameters. Required. To specify no
2072
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2073
+ # @param options [::Gapic::CallOptions, ::Hash]
2074
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2075
+ #
2076
+ # @overload remove_acl_entry(acl: nil, acl_entry: nil)
2077
+ # Pass arguments to `remove_acl_entry` via keyword arguments. Note that at
2078
+ # least one keyword argument is required. To specify no parameters, or to keep all
2079
+ # the default parameter values, pass an empty Hash as a request object (see above).
2080
+ #
2081
+ # @param acl [::String]
2082
+ # Required. The name of the acl to remove the acl entry from.
2083
+ # Structured like:
2084
+ # `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
2085
+ #
2086
+ # The structure of `acl_id` defines the Resource Pattern (resource_type,
2087
+ # resource_name, pattern_type) of the acl. See `Acl.name` for
2088
+ # details.
2089
+ # @param acl_entry [::Google::Cloud::ManagedKafka::V1::AclEntry, ::Hash]
2090
+ # Required. The acl entry to remove.
2091
+ # @yield [result, operation] Access the result along with the TransportOperation object
2092
+ # @yieldparam result [::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse]
2093
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2094
+ #
2095
+ # @return [::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse]
2096
+ #
2097
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2098
+ #
2099
+ # @example Basic example
2100
+ # require "google/cloud/managed_kafka/v1"
2101
+ #
2102
+ # # Create a client object. The client can be reused for multiple calls.
2103
+ # client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Rest::Client.new
2104
+ #
2105
+ # # Create a request. To set request fields, pass in keyword arguments.
2106
+ # request = Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest.new
2107
+ #
2108
+ # # Call the remove_acl_entry method.
2109
+ # result = client.remove_acl_entry request
2110
+ #
2111
+ # # The returned object is of type Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse.
2112
+ # p result
2113
+ #
2114
+ def remove_acl_entry request, options = nil
2115
+ raise ::ArgumentError, "request must be provided" if request.nil?
2116
+
2117
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest
2118
+
2119
+ # Converts hash and nil to an options object
2120
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2121
+
2122
+ # Customize the options with defaults
2123
+ call_metadata = @config.rpcs.remove_acl_entry.metadata.to_h
2124
+
2125
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2126
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2127
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2128
+ gapic_version: ::Google::Cloud::ManagedKafka::V1::VERSION,
2129
+ transports_version_send: [:rest]
2130
+
2131
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2132
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2133
+
2134
+ options.apply_defaults timeout: @config.rpcs.remove_acl_entry.timeout,
2135
+ metadata: call_metadata,
2136
+ retry_policy: @config.rpcs.remove_acl_entry.retry_policy
2137
+
2138
+ options.apply_defaults timeout: @config.timeout,
2139
+ metadata: @config.metadata,
2140
+ retry_policy: @config.retry_policy
2141
+
2142
+ @managed_kafka_stub.remove_acl_entry request, options do |result, operation|
2143
+ yield result, operation if block_given?
2144
+ end
2145
+ rescue ::Gapic::Rest::Error => e
2146
+ raise ::Google::Cloud::Error.from_error(e)
2147
+ end
2148
+
1521
2149
  ##
1522
2150
  # Configuration class for the ManagedKafka REST API.
1523
2151
  #
@@ -1741,6 +2369,41 @@ module Google
1741
2369
  # @return [::Gapic::Config::Method]
1742
2370
  #
1743
2371
  attr_reader :delete_consumer_group
2372
+ ##
2373
+ # RPC-specific configuration for `list_acls`
2374
+ # @return [::Gapic::Config::Method]
2375
+ #
2376
+ attr_reader :list_acls
2377
+ ##
2378
+ # RPC-specific configuration for `get_acl`
2379
+ # @return [::Gapic::Config::Method]
2380
+ #
2381
+ attr_reader :get_acl
2382
+ ##
2383
+ # RPC-specific configuration for `create_acl`
2384
+ # @return [::Gapic::Config::Method]
2385
+ #
2386
+ attr_reader :create_acl
2387
+ ##
2388
+ # RPC-specific configuration for `update_acl`
2389
+ # @return [::Gapic::Config::Method]
2390
+ #
2391
+ attr_reader :update_acl
2392
+ ##
2393
+ # RPC-specific configuration for `delete_acl`
2394
+ # @return [::Gapic::Config::Method]
2395
+ #
2396
+ attr_reader :delete_acl
2397
+ ##
2398
+ # RPC-specific configuration for `add_acl_entry`
2399
+ # @return [::Gapic::Config::Method]
2400
+ #
2401
+ attr_reader :add_acl_entry
2402
+ ##
2403
+ # RPC-specific configuration for `remove_acl_entry`
2404
+ # @return [::Gapic::Config::Method]
2405
+ #
2406
+ attr_reader :remove_acl_entry
1744
2407
 
1745
2408
  # @private
1746
2409
  def initialize parent_rpcs = nil
@@ -1772,6 +2435,20 @@ module Google
1772
2435
  @update_consumer_group = ::Gapic::Config::Method.new update_consumer_group_config
1773
2436
  delete_consumer_group_config = parent_rpcs.delete_consumer_group if parent_rpcs.respond_to? :delete_consumer_group
1774
2437
  @delete_consumer_group = ::Gapic::Config::Method.new delete_consumer_group_config
2438
+ list_acls_config = parent_rpcs.list_acls if parent_rpcs.respond_to? :list_acls
2439
+ @list_acls = ::Gapic::Config::Method.new list_acls_config
2440
+ get_acl_config = parent_rpcs.get_acl if parent_rpcs.respond_to? :get_acl
2441
+ @get_acl = ::Gapic::Config::Method.new get_acl_config
2442
+ create_acl_config = parent_rpcs.create_acl if parent_rpcs.respond_to? :create_acl
2443
+ @create_acl = ::Gapic::Config::Method.new create_acl_config
2444
+ update_acl_config = parent_rpcs.update_acl if parent_rpcs.respond_to? :update_acl
2445
+ @update_acl = ::Gapic::Config::Method.new update_acl_config
2446
+ delete_acl_config = parent_rpcs.delete_acl if parent_rpcs.respond_to? :delete_acl
2447
+ @delete_acl = ::Gapic::Config::Method.new delete_acl_config
2448
+ add_acl_entry_config = parent_rpcs.add_acl_entry if parent_rpcs.respond_to? :add_acl_entry
2449
+ @add_acl_entry = ::Gapic::Config::Method.new add_acl_entry_config
2450
+ remove_acl_entry_config = parent_rpcs.remove_acl_entry if parent_rpcs.respond_to? :remove_acl_entry
2451
+ @remove_acl_entry = ::Gapic::Config::Method.new remove_acl_entry_config
1775
2452
 
1776
2453
  yield self if block_given?
1777
2454
  end