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.
@@ -24,6 +24,27 @@ module Google
24
24
  module ManagedKafka
25
25
  # Path helper methods for the ManagedKafka API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified Acl resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param cluster [String]
37
+ # @param acl [String]
38
+ #
39
+ # @return [::String]
40
+ def acl_path project:, location:, cluster:, acl:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+ raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/"
44
+
45
+ "projects/#{project}/locations/#{location}/clusters/#{cluster}/acls/#{acl}"
46
+ end
47
+
27
48
  ##
28
49
  # Create a fully-qualified Cluster resource string.
29
50
  #