google-cloud-secret_manager-v1 0.20.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/secret_manager/v1/bindings_override.rb +102 -0
- data/lib/google/cloud/secret_manager/v1/rest.rb +1 -0
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb +139 -68
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb +83 -16
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb +149 -70
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb +113 -0
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb +1 -0
- data/lib/google/cloud/secret_manager/v1/version.rb +1 -1
- data/lib/google/cloud/secretmanager/v1/resources_pb.rb +1 -1
- data/lib/google/cloud/secretmanager/v1/service_pb.rb +1 -1
- data/lib/google/cloud/secretmanager/v1/service_services_pb.rb +25 -15
- data/proto_docs/google/api/client.rb +4 -0
- data/proto_docs/google/cloud/secretmanager/v1/resources.rb +38 -4
- data/proto_docs/google/cloud/secretmanager/v1/service.rb +117 -63
- metadata +23 -2
@@ -24,6 +24,23 @@ module Google
|
|
24
24
|
module SecretManagerService
|
25
25
|
# Path helper methods for the SecretManagerService API.
|
26
26
|
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Location resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
#
|
37
|
+
# @return [::String]
|
38
|
+
def location_path project:, location:
|
39
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
40
|
+
|
41
|
+
"projects/#{project}/locations/#{location}"
|
42
|
+
end
|
43
|
+
|
27
44
|
##
|
28
45
|
# Create a fully-qualified Project resource string.
|
29
46
|
#
|
@@ -41,37 +58,87 @@ module Google
|
|
41
58
|
##
|
42
59
|
# Create a fully-qualified Secret resource string.
|
43
60
|
#
|
44
|
-
#
|
61
|
+
# @overload secret_path(project:, secret:)
|
62
|
+
# The resource will be in the following format:
|
45
63
|
#
|
46
|
-
#
|
64
|
+
# `projects/{project}/secrets/{secret}`
|
47
65
|
#
|
48
|
-
#
|
49
|
-
#
|
66
|
+
# @param project [String]
|
67
|
+
# @param secret [String]
|
68
|
+
#
|
69
|
+
# @overload secret_path(project:, location:, secret:)
|
70
|
+
# The resource will be in the following format:
|
71
|
+
#
|
72
|
+
# `projects/{project}/locations/{location}/secrets/{secret}`
|
73
|
+
#
|
74
|
+
# @param project [String]
|
75
|
+
# @param location [String]
|
76
|
+
# @param secret [String]
|
50
77
|
#
|
51
78
|
# @return [::String]
|
52
|
-
def secret_path
|
53
|
-
|
79
|
+
def secret_path **args
|
80
|
+
resources = {
|
81
|
+
"project:secret" => (proc do |project:, secret:|
|
82
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
54
83
|
|
55
|
-
|
84
|
+
"projects/#{project}/secrets/#{secret}"
|
85
|
+
end),
|
86
|
+
"location:project:secret" => (proc do |project:, location:, secret:|
|
87
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
88
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
89
|
+
|
90
|
+
"projects/#{project}/locations/#{location}/secrets/#{secret}"
|
91
|
+
end)
|
92
|
+
}
|
93
|
+
|
94
|
+
resource = resources[args.keys.sort.join(":")]
|
95
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
96
|
+
resource.call(**args)
|
56
97
|
end
|
57
98
|
|
58
99
|
##
|
59
100
|
# Create a fully-qualified SecretVersion resource string.
|
60
101
|
#
|
61
|
-
#
|
102
|
+
# @overload secret_version_path(project:, secret:, secret_version:)
|
103
|
+
# The resource will be in the following format:
|
62
104
|
#
|
63
|
-
#
|
105
|
+
# `projects/{project}/secrets/{secret}/versions/{secret_version}`
|
64
106
|
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
107
|
+
# @param project [String]
|
108
|
+
# @param secret [String]
|
109
|
+
# @param secret_version [String]
|
110
|
+
#
|
111
|
+
# @overload secret_version_path(project:, location:, secret:, secret_version:)
|
112
|
+
# The resource will be in the following format:
|
113
|
+
#
|
114
|
+
# `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}`
|
115
|
+
#
|
116
|
+
# @param project [String]
|
117
|
+
# @param location [String]
|
118
|
+
# @param secret [String]
|
119
|
+
# @param secret_version [String]
|
68
120
|
#
|
69
121
|
# @return [::String]
|
70
|
-
def secret_version_path
|
71
|
-
|
72
|
-
|
122
|
+
def secret_version_path **args
|
123
|
+
resources = {
|
124
|
+
"project:secret:secret_version" => (proc do |project:, secret:, secret_version:|
|
125
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
126
|
+
raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/"
|
127
|
+
|
128
|
+
"projects/#{project}/secrets/#{secret}/versions/#{secret_version}"
|
129
|
+
end),
|
130
|
+
"location:project:secret:secret_version" => (proc do |project:, location:, secret:, secret_version:|
|
131
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
132
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
133
|
+
raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/"
|
134
|
+
|
135
|
+
"projects/#{project}/locations/#{location}/secrets/#{secret}/versions/#{secret_version}"
|
136
|
+
end)
|
137
|
+
}
|
73
138
|
|
74
|
-
"
|
139
|
+
resource = resources[args.keys.sort.join(":")]
|
140
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
141
|
+
resource.call(**args)
|
75
142
|
end
|
76
143
|
|
77
144
|
##
|