google-cloud-functions-v1 0.1.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.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-functions-v1.rb +21 -0
  7. data/lib/google/cloud/functions/v1.rb +35 -0
  8. data/lib/google/cloud/functions/v1/cloud_functions_service.rb +50 -0
  9. data/lib/google/cloud/functions/v1/cloud_functions_service/client.rb +1196 -0
  10. data/lib/google/cloud/functions/v1/cloud_functions_service/credentials.rb +51 -0
  11. data/lib/google/cloud/functions/v1/cloud_functions_service/operations.rb +570 -0
  12. data/lib/google/cloud/functions/v1/cloud_functions_service/paths.rb +69 -0
  13. data/lib/google/cloud/functions/v1/functions_pb.rb +163 -0
  14. data/lib/google/cloud/functions/v1/functions_services_pb.rb +106 -0
  15. data/lib/google/cloud/functions/v1/operations_pb.rb +37 -0
  16. data/lib/google/cloud/functions/v1/version.rb +28 -0
  17. data/proto_docs/README.md +4 -0
  18. data/proto_docs/google/api/field_behavior.rb +59 -0
  19. data/proto_docs/google/api/resource.rb +247 -0
  20. data/proto_docs/google/cloud/functions/v1/functions.rb +491 -0
  21. data/proto_docs/google/cloud/functions/v1/operations.rb +68 -0
  22. data/proto_docs/google/iam/v1/iam_policy.rb +80 -0
  23. data/proto_docs/google/iam/v1/options.rb +40 -0
  24. data/proto_docs/google/iam/v1/policy.rb +248 -0
  25. data/proto_docs/google/longrunning/operations.rb +150 -0
  26. data/proto_docs/google/protobuf/any.rb +138 -0
  27. data/proto_docs/google/protobuf/duration.rb +98 -0
  28. data/proto_docs/google/protobuf/empty.rb +36 -0
  29. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  30. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  31. data/proto_docs/google/rpc/status.rb +46 -0
  32. data/proto_docs/google/type/expr.rb +52 -0
  33. metadata +234 -0
@@ -0,0 +1,247 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Api
22
+ # A simple descriptor of a resource type.
23
+ #
24
+ # ResourceDescriptor annotates a resource message (either by means of a
25
+ # protobuf annotation or use in the service config), and associates the
26
+ # resource's schema, the resource type, and the pattern of the resource name.
27
+ #
28
+ # Example:
29
+ #
30
+ # message Topic {
31
+ # // Indicates this message defines a resource schema.
32
+ # // Declares the resource type in the format of {service}/{kind}.
33
+ # // For Kubernetes resources, the format is {api group}/{kind}.
34
+ # option (google.api.resource) = {
35
+ # type: "pubsub.googleapis.com/Topic"
36
+ # name_descriptor: {
37
+ # pattern: "projects/{project}/topics/{topic}"
38
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
+ # parent_name_extractor: "projects/{project}"
40
+ # }
41
+ # };
42
+ # }
43
+ #
44
+ # The ResourceDescriptor Yaml config will look like:
45
+ #
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/\\{project}/topics/\\{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/\\{project}"
52
+ #
53
+ # Sometimes, resources have multiple patterns, typically because they can
54
+ # live under multiple parents.
55
+ #
56
+ # Example:
57
+ #
58
+ # message LogEntry {
59
+ # option (google.api.resource) = {
60
+ # type: "logging.googleapis.com/LogEntry"
61
+ # name_descriptor: {
62
+ # pattern: "projects/{project}/logs/{log}"
63
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
+ # parent_name_extractor: "projects/{project}"
65
+ # }
66
+ # name_descriptor: {
67
+ # pattern: "folders/{folder}/logs/{log}"
68
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
+ # parent_name_extractor: "folders/{folder}"
70
+ # }
71
+ # name_descriptor: {
72
+ # pattern: "organizations/{organization}/logs/{log}"
73
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
+ # parent_name_extractor: "organizations/{organization}"
75
+ # }
76
+ # name_descriptor: {
77
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
+ # parent_type: "billing.googleapis.com/BillingAccount"
79
+ # parent_name_extractor: "billingAccounts/{billing_account}"
80
+ # }
81
+ # };
82
+ # }
83
+ #
84
+ # The ResourceDescriptor Yaml config will look like:
85
+ #
86
+ # resources:
87
+ # - type: 'logging.googleapis.com/LogEntry'
88
+ # name_descriptor:
89
+ # - pattern: "projects/{project}/logs/{log}"
90
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
+ # parent_name_extractor: "projects/{project}"
92
+ # - pattern: "folders/{folder}/logs/{log}"
93
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
+ # parent_name_extractor: "folders/{folder}"
95
+ # - pattern: "organizations/{organization}/logs/{log}"
96
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
+ # parent_name_extractor: "organizations/{organization}"
98
+ # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
+ # parent_type: "billing.googleapis.com/BillingAccount"
100
+ # parent_name_extractor: "billingAccounts/{billing_account}"
101
+ #
102
+ # For flexible resources, the resource name doesn't contain parent names, but
103
+ # the resource itself has parents for policy evaluation.
104
+ #
105
+ # Example:
106
+ #
107
+ # message Shelf {
108
+ # option (google.api.resource) = {
109
+ # type: "library.googleapis.com/Shelf"
110
+ # name_descriptor: {
111
+ # pattern: "shelves/{shelf}"
112
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
+ # }
114
+ # name_descriptor: {
115
+ # pattern: "shelves/{shelf}"
116
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
+ # }
118
+ # };
119
+ # }
120
+ #
121
+ # The ResourceDescriptor Yaml config will look like:
122
+ #
123
+ # resources:
124
+ # - type: 'library.googleapis.com/Shelf'
125
+ # name_descriptor:
126
+ # - pattern: "shelves/{shelf}"
127
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
+ # - pattern: "shelves/{shelf}"
129
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
130
+ # @!attribute [rw] type
131
+ # @return [::String]
132
+ # The resource type. It must be in the format of
133
+ # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be
134
+ # singular and must not include version numbers.
135
+ #
136
+ # Example: `storage.googleapis.com/Bucket`
137
+ #
138
+ # The value of the resource_type_kind must follow the regular expression
139
+ # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
140
+ # should use PascalCase (UpperCamelCase). The maximum number of
141
+ # characters allowed for the `resource_type_kind` is 100.
142
+ # @!attribute [rw] pattern
143
+ # @return [::Array<::String>]
144
+ # Optional. The relative resource name pattern associated with this resource
145
+ # type. The DNS prefix of the full resource name shouldn't be specified here.
146
+ #
147
+ # The path pattern must follow the syntax, which aligns with HTTP binding
148
+ # syntax:
149
+ #
150
+ # Template = Segment { "/" Segment } ;
151
+ # Segment = LITERAL | Variable ;
152
+ # Variable = "{" LITERAL "}" ;
153
+ #
154
+ # Examples:
155
+ #
156
+ # - "projects/\\{project}/topics/\\{topic}"
157
+ # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}"
158
+ #
159
+ # The components in braces correspond to the IDs for each resource in the
160
+ # hierarchy. It is expected that, if multiple patterns are provided,
161
+ # the same component name (e.g. "project") refers to IDs of the same
162
+ # type of resource.
163
+ # @!attribute [rw] name_field
164
+ # @return [::String]
165
+ # Optional. The field on the resource that designates the resource name
166
+ # field. If omitted, this is assumed to be "name".
167
+ # @!attribute [rw] history
168
+ # @return [::Google::Api::ResourceDescriptor::History]
169
+ # Optional. The historical or future-looking state of the resource pattern.
170
+ #
171
+ # Example:
172
+ #
173
+ # // The InspectTemplate message originally only supported resource
174
+ # // names with organization, and project was added later.
175
+ # message InspectTemplate {
176
+ # option (google.api.resource) = {
177
+ # type: "dlp.googleapis.com/InspectTemplate"
178
+ # pattern:
179
+ # "organizations/{organization}/inspectTemplates/{inspect_template}"
180
+ # pattern: "projects/{project}/inspectTemplates/{inspect_template}"
181
+ # history: ORIGINALLY_SINGLE_PATTERN
182
+ # };
183
+ # }
184
+ # @!attribute [rw] plural
185
+ # @return [::String]
186
+ # The plural name used in the resource name, such as 'projects' for
187
+ # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
+ # field in k8s CRD spec
189
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
190
+ # @!attribute [rw] singular
191
+ # @return [::String]
192
+ # The same concept of the `singular` field in k8s CRD spec
193
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
+ # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
195
+ class ResourceDescriptor
196
+ include ::Google::Protobuf::MessageExts
197
+ extend ::Google::Protobuf::MessageExts::ClassMethods
198
+
199
+ # A description of the historical or future-looking state of the
200
+ # resource pattern.
201
+ module History
202
+ # The "unset" value.
203
+ HISTORY_UNSPECIFIED = 0
204
+
205
+ # The resource originally had one pattern and launched as such, and
206
+ # additional patterns were added later.
207
+ ORIGINALLY_SINGLE_PATTERN = 1
208
+
209
+ # The resource has one pattern, but the API owner expects to add more
210
+ # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
211
+ # that from being necessary once there are multiple patterns.)
212
+ FUTURE_MULTI_PATTERN = 2
213
+ end
214
+ end
215
+
216
+ # Defines a proto annotation that describes a string field that refers to
217
+ # an API resource.
218
+ # @!attribute [rw] type
219
+ # @return [::String]
220
+ # The resource type that the annotated field references.
221
+ #
222
+ # Example:
223
+ #
224
+ # message Subscription {
225
+ # string topic = 2 [(google.api.resource_reference) = {
226
+ # type: "pubsub.googleapis.com/Topic"
227
+ # }];
228
+ # }
229
+ # @!attribute [rw] child_type
230
+ # @return [::String]
231
+ # The resource type of a child collection that the annotated field
232
+ # references. This is useful for annotating the `parent` field that
233
+ # doesn't have a fixed resource type.
234
+ #
235
+ # Example:
236
+ #
237
+ # message ListLogEntriesRequest {
238
+ # string parent = 1 [(google.api.resource_reference) = {
239
+ # child_type: "logging.googleapis.com/LogEntry"
240
+ # };
241
+ # }
242
+ class ResourceReference
243
+ include ::Google::Protobuf::MessageExts
244
+ extend ::Google::Protobuf::MessageExts::ClassMethods
245
+ end
246
+ end
247
+ end
@@ -0,0 +1,491 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Cloud
22
+ module Functions
23
+ module V1
24
+ # Describes a Cloud Function that contains user computation executed in
25
+ # response to an event. It encapsulate function and triggers configurations.
26
+ # @!attribute [rw] name
27
+ # @return [::String]
28
+ # A user-defined name of the function. Function names must be unique
29
+ # globally and match pattern `projects/*/locations/*/functions/*`
30
+ # @!attribute [rw] description
31
+ # @return [::String]
32
+ # User-provided description of a function.
33
+ # @!attribute [rw] source_archive_url
34
+ # @return [::String]
35
+ # The Google Cloud Storage URL, starting with gs://, pointing to the zip
36
+ # archive which contains the function.
37
+ # @!attribute [rw] source_repository
38
+ # @return [::Google::Cloud::Functions::V1::SourceRepository]
39
+ # **Beta Feature**
40
+ #
41
+ # The source repository where a function is hosted.
42
+ # @!attribute [rw] source_upload_url
43
+ # @return [::String]
44
+ # The Google Cloud Storage signed URL used for source uploading, generated
45
+ # by [google.cloud.functions.v1.GenerateUploadUrl][]
46
+ # @!attribute [rw] https_trigger
47
+ # @return [::Google::Cloud::Functions::V1::HttpsTrigger]
48
+ # An HTTPS endpoint type of source that can be triggered via URL.
49
+ # @!attribute [rw] event_trigger
50
+ # @return [::Google::Cloud::Functions::V1::EventTrigger]
51
+ # A source that fires events in response to a condition in another service.
52
+ # @!attribute [r] status
53
+ # @return [::Google::Cloud::Functions::V1::CloudFunctionStatus]
54
+ # Output only. Status of the function deployment.
55
+ # @!attribute [rw] entry_point
56
+ # @return [::String]
57
+ # The name of the function (as defined in source code) that will be
58
+ # executed. Defaults to the resource name suffix, if not specified. For
59
+ # backward compatibility, if function with given name is not found, then the
60
+ # system will try to use function named "function".
61
+ # For Node.js this is name of a function exported by the module specified
62
+ # in `source_location`.
63
+ # @!attribute [rw] runtime
64
+ # @return [::String]
65
+ # The runtime in which to run the function. Required when deploying a new
66
+ # function, optional when updating an existing function. For a complete
67
+ # list of possible choices, see the
68
+ # [`gcloud` command
69
+ # reference](/sdk/gcloud/reference/functions/deploy#--runtime).
70
+ # @!attribute [rw] timeout
71
+ # @return [::Google::Protobuf::Duration]
72
+ # The function execution timeout. Execution is considered failed and
73
+ # can be terminated if the function is not completed at the end of the
74
+ # timeout period. Defaults to 60 seconds.
75
+ # @!attribute [rw] available_memory_mb
76
+ # @return [::Integer]
77
+ # The amount of memory in MB available for a function.
78
+ # Defaults to 256MB.
79
+ # @!attribute [rw] service_account_email
80
+ # @return [::String]
81
+ # The email of the function's service account. If empty, defaults to
82
+ # `{project_id}@appspot.gserviceaccount.com`.
83
+ # @!attribute [r] update_time
84
+ # @return [::Google::Protobuf::Timestamp]
85
+ # Output only. The last update timestamp of a Cloud Function.
86
+ # @!attribute [r] version_id
87
+ # @return [::Integer]
88
+ # Output only. The version identifier of the Cloud Function. Each deployment attempt
89
+ # results in a new version of a function being created.
90
+ # @!attribute [rw] labels
91
+ # @return [::Google::Protobuf::Map{::String => ::String}]
92
+ # Labels associated with this Cloud Function.
93
+ # @!attribute [rw] environment_variables
94
+ # @return [::Google::Protobuf::Map{::String => ::String}]
95
+ # Environment variables that shall be available during function execution.
96
+ # @!attribute [rw] network
97
+ # @return [::String]
98
+ # The VPC Network that this cloud function can connect to. It can be
99
+ # either the fully-qualified URI, or the short name of the network resource.
100
+ # If the short network name is used, the network must belong to the same
101
+ # project. Otherwise, it must belong to a project within the same
102
+ # organization. The format of this field is either
103
+ # `projects/{project}/global/networks/{network}` or `{network}`, where
104
+ # \\{project} is a project id where the network is defined, and \\{network} is
105
+ # the short name of the network.
106
+ #
107
+ # This field is mutually exclusive with `vpc_connector` and will be replaced
108
+ # by it.
109
+ #
110
+ # See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
111
+ # more information on connecting Cloud projects.
112
+ # @!attribute [rw] max_instances
113
+ # @return [::Integer]
114
+ # The limit on the maximum number of function instances that may coexist at a
115
+ # given time.
116
+ # @!attribute [rw] vpc_connector
117
+ # @return [::String]
118
+ # The VPC Network Connector that this cloud function can connect to. It can
119
+ # be either the fully-qualified URI, or the short name of the network
120
+ # connector resource. The format of this field is
121
+ # `projects/*/locations/*/connectors/*`
122
+ #
123
+ # This field is mutually exclusive with `network` field and will eventually
124
+ # replace it.
125
+ #
126
+ # See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
127
+ # more information on connecting Cloud projects.
128
+ # @!attribute [rw] vpc_connector_egress_settings
129
+ # @return [::Google::Cloud::Functions::V1::CloudFunction::VpcConnectorEgressSettings]
130
+ # The egress settings for the connector, controlling what traffic is diverted
131
+ # through it.
132
+ # @!attribute [rw] ingress_settings
133
+ # @return [::Google::Cloud::Functions::V1::CloudFunction::IngressSettings]
134
+ # The ingress settings for the function, controlling what traffic can reach
135
+ # it.
136
+ # @!attribute [r] build_id
137
+ # @return [::String]
138
+ # Output only. The Cloud Build ID of the latest successful deployment of the
139
+ # function.
140
+ class CloudFunction
141
+ include ::Google::Protobuf::MessageExts
142
+ extend ::Google::Protobuf::MessageExts::ClassMethods
143
+
144
+ # @!attribute [rw] key
145
+ # @return [::String]
146
+ # @!attribute [rw] value
147
+ # @return [::String]
148
+ class LabelsEntry
149
+ include ::Google::Protobuf::MessageExts
150
+ extend ::Google::Protobuf::MessageExts::ClassMethods
151
+ end
152
+
153
+ # @!attribute [rw] key
154
+ # @return [::String]
155
+ # @!attribute [rw] value
156
+ # @return [::String]
157
+ class EnvironmentVariablesEntry
158
+ include ::Google::Protobuf::MessageExts
159
+ extend ::Google::Protobuf::MessageExts::ClassMethods
160
+ end
161
+
162
+ # Available egress settings.
163
+ #
164
+ # This controls what traffic is diverted through the VPC Access Connector
165
+ # resource. By default PRIVATE_RANGES_ONLY will be used.
166
+ module VpcConnectorEgressSettings
167
+ # Unspecified.
168
+ VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0
169
+
170
+ # Use the VPC Access Connector only for private IP space from RFC1918.
171
+ PRIVATE_RANGES_ONLY = 1
172
+
173
+ # Force the use of VPC Access Connector for all egress traffic from the
174
+ # function.
175
+ ALL_TRAFFIC = 2
176
+ end
177
+
178
+ # Available ingress settings.
179
+ #
180
+ # This controls what traffic can reach the function.
181
+ #
182
+ # If unspecified, ALLOW_ALL will be used.
183
+ module IngressSettings
184
+ # Unspecified.
185
+ INGRESS_SETTINGS_UNSPECIFIED = 0
186
+
187
+ # Allow HTTP traffic from public and private sources.
188
+ ALLOW_ALL = 1
189
+
190
+ # Allow HTTP traffic from only private VPC sources.
191
+ ALLOW_INTERNAL_ONLY = 2
192
+
193
+ # Allow HTTP traffic from private VPC sources and through GCLB.
194
+ ALLOW_INTERNAL_AND_GCLB = 3
195
+ end
196
+ end
197
+
198
+ # Describes SourceRepository, used to represent parameters related to
199
+ # source repository where a function is hosted.
200
+ # @!attribute [rw] url
201
+ # @return [::String]
202
+ # The URL pointing to the hosted repository where the function is defined.
203
+ # There are supported Cloud Source Repository URLs in the following
204
+ # formats:
205
+ #
206
+ # To refer to a specific commit:
207
+ # `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
208
+ # To refer to a moveable alias (branch):
209
+ # `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
210
+ # In particular, to refer to HEAD use `master` moveable alias.
211
+ # To refer to a specific fixed alias (tag):
212
+ # `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
213
+ #
214
+ # You may omit `paths/*` if you want to use the main directory.
215
+ # @!attribute [r] deployed_url
216
+ # @return [::String]
217
+ # Output only. The URL pointing to the hosted repository where the function
218
+ # were defined at the time of deployment. It always points to a specific
219
+ # commit in the format described above.
220
+ class SourceRepository
221
+ include ::Google::Protobuf::MessageExts
222
+ extend ::Google::Protobuf::MessageExts::ClassMethods
223
+ end
224
+
225
+ # Describes HttpsTrigger, could be used to connect web hooks to function.
226
+ # @!attribute [r] url
227
+ # @return [::String]
228
+ # Output only. The deployed url for the function.
229
+ class HttpsTrigger
230
+ include ::Google::Protobuf::MessageExts
231
+ extend ::Google::Protobuf::MessageExts::ClassMethods
232
+ end
233
+
234
+ # Describes EventTrigger, used to request events be sent from another
235
+ # service.
236
+ # @!attribute [rw] event_type
237
+ # @return [::String]
238
+ # Required. The type of event to observe. For example:
239
+ # `providers/cloud.storage/eventTypes/object.change` and
240
+ # `providers/cloud.pubsub/eventTypes/topic.publish`.
241
+ #
242
+ # Event types match pattern `providers/*/eventTypes/*.*`.
243
+ # The pattern contains:
244
+ #
245
+ # 1. namespace: For example, `cloud.storage` and
246
+ # `google.firebase.analytics`.
247
+ # 2. resource type: The type of resource on which event occurs. For
248
+ # example, the Google Cloud Storage API includes the type `object`.
249
+ # 3. action: The action that generates the event. For example, action for
250
+ # a Google Cloud Storage Object is 'change'.
251
+ # These parts are lower case.
252
+ # @!attribute [rw] resource
253
+ # @return [::String]
254
+ # Required. The resource(s) from which to observe events, for example,
255
+ # `projects/_/buckets/myBucket`.
256
+ #
257
+ # Not all syntactically correct values are accepted by all services. For
258
+ # example:
259
+ #
260
+ # 1. The authorization model must support it. Google Cloud Functions
261
+ # only allows EventTriggers to be deployed that observe resources in the
262
+ # same project as the `CloudFunction`.
263
+ # 2. The resource type must match the pattern expected for an
264
+ # `event_type`. For example, an `EventTrigger` that has an
265
+ # `event_type` of "google.pubsub.topic.publish" should have a resource
266
+ # that matches Google Cloud Pub/Sub topics.
267
+ #
268
+ # Additionally, some services may support short names when creating an
269
+ # `EventTrigger`. These will always be returned in the normalized "long"
270
+ # format.
271
+ #
272
+ # See each *service's* documentation for supported formats.
273
+ # @!attribute [rw] service
274
+ # @return [::String]
275
+ # The hostname of the service that should be observed.
276
+ #
277
+ # If no string is provided, the default service implementing the API will
278
+ # be used. For example, `storage.googleapis.com` is the default for all
279
+ # event types in the `google.storage` namespace.
280
+ # @!attribute [rw] failure_policy
281
+ # @return [::Google::Cloud::Functions::V1::FailurePolicy]
282
+ # Specifies policy for failed executions.
283
+ class EventTrigger
284
+ include ::Google::Protobuf::MessageExts
285
+ extend ::Google::Protobuf::MessageExts::ClassMethods
286
+ end
287
+
288
+ # Describes the policy in case of function's execution failure.
289
+ # If empty, then defaults to ignoring failures (i.e. not retrying them).
290
+ # @!attribute [rw] retry
291
+ # @return [::Google::Cloud::Functions::V1::FailurePolicy::Retry]
292
+ # If specified, then the function will be retried in case of a failure.
293
+ class FailurePolicy
294
+ include ::Google::Protobuf::MessageExts
295
+ extend ::Google::Protobuf::MessageExts::ClassMethods
296
+
297
+ # Describes the retry policy in case of function's execution failure.
298
+ # A function execution will be retried on any failure.
299
+ # A failed execution will be retried up to 7 days with an exponential backoff
300
+ # (capped at 10 seconds).
301
+ # Retried execution is charged as any other execution.
302
+ class Retry
303
+ include ::Google::Protobuf::MessageExts
304
+ extend ::Google::Protobuf::MessageExts::ClassMethods
305
+ end
306
+ end
307
+
308
+ # Request for the `CreateFunction` method.
309
+ # @!attribute [rw] location
310
+ # @return [::String]
311
+ # Required. The project and location in which the function should be created, specified
312
+ # in the format `projects/*/locations/*`
313
+ # @!attribute [rw] function
314
+ # @return [::Google::Cloud::Functions::V1::CloudFunction]
315
+ # Required. Function to be created.
316
+ class CreateFunctionRequest
317
+ include ::Google::Protobuf::MessageExts
318
+ extend ::Google::Protobuf::MessageExts::ClassMethods
319
+ end
320
+
321
+ # Request for the `UpdateFunction` method.
322
+ # @!attribute [rw] function
323
+ # @return [::Google::Cloud::Functions::V1::CloudFunction]
324
+ # Required. New version of the function.
325
+ # @!attribute [rw] update_mask
326
+ # @return [::Google::Protobuf::FieldMask]
327
+ # Required list of fields to be updated in this request.
328
+ class UpdateFunctionRequest
329
+ include ::Google::Protobuf::MessageExts
330
+ extend ::Google::Protobuf::MessageExts::ClassMethods
331
+ end
332
+
333
+ # Request for the `GetFunction` method.
334
+ # @!attribute [rw] name
335
+ # @return [::String]
336
+ # Required. The name of the function which details should be obtained.
337
+ class GetFunctionRequest
338
+ include ::Google::Protobuf::MessageExts
339
+ extend ::Google::Protobuf::MessageExts::ClassMethods
340
+ end
341
+
342
+ # Request for the `ListFunctions` method.
343
+ # @!attribute [rw] parent
344
+ # @return [::String]
345
+ # The project and location from which the function should be listed,
346
+ # specified in the format `projects/*/locations/*`
347
+ # If you want to list functions in all locations, use "-" in place of a
348
+ # location. When listing functions in all locations, if one or more
349
+ # location(s) are unreachable, the response will contain functions from all
350
+ # reachable locations along with the names of any unreachable locations.
351
+ # @!attribute [rw] page_size
352
+ # @return [::Integer]
353
+ # Maximum number of functions to return per call.
354
+ # @!attribute [rw] page_token
355
+ # @return [::String]
356
+ # The value returned by the last
357
+ # `ListFunctionsResponse`; indicates that
358
+ # this is a continuation of a prior `ListFunctions` call, and that the
359
+ # system should return the next page of data.
360
+ class ListFunctionsRequest
361
+ include ::Google::Protobuf::MessageExts
362
+ extend ::Google::Protobuf::MessageExts::ClassMethods
363
+ end
364
+
365
+ # Response for the `ListFunctions` method.
366
+ # @!attribute [rw] functions
367
+ # @return [::Array<::Google::Cloud::Functions::V1::CloudFunction>]
368
+ # The functions that match the request.
369
+ # @!attribute [rw] next_page_token
370
+ # @return [::String]
371
+ # If not empty, indicates that there may be more functions that match
372
+ # the request; this value should be passed in a new
373
+ # {::Google::Cloud::Functions::V1::ListFunctionsRequest google.cloud.functions.v1.ListFunctionsRequest}
374
+ # to get more functions.
375
+ # @!attribute [rw] unreachable
376
+ # @return [::Array<::String>]
377
+ # Locations that could not be reached. The response does not include any
378
+ # functions from these locations.
379
+ class ListFunctionsResponse
380
+ include ::Google::Protobuf::MessageExts
381
+ extend ::Google::Protobuf::MessageExts::ClassMethods
382
+ end
383
+
384
+ # Request for the `DeleteFunction` method.
385
+ # @!attribute [rw] name
386
+ # @return [::String]
387
+ # Required. The name of the function which should be deleted.
388
+ class DeleteFunctionRequest
389
+ include ::Google::Protobuf::MessageExts
390
+ extend ::Google::Protobuf::MessageExts::ClassMethods
391
+ end
392
+
393
+ # Request for the `CallFunction` method.
394
+ # @!attribute [rw] name
395
+ # @return [::String]
396
+ # Required. The name of the function to be called.
397
+ # @!attribute [rw] data
398
+ # @return [::String]
399
+ # Required. Input to be passed to the function.
400
+ class CallFunctionRequest
401
+ include ::Google::Protobuf::MessageExts
402
+ extend ::Google::Protobuf::MessageExts::ClassMethods
403
+ end
404
+
405
+ # Response of `CallFunction` method.
406
+ # @!attribute [rw] execution_id
407
+ # @return [::String]
408
+ # Execution id of function invocation.
409
+ # @!attribute [rw] result
410
+ # @return [::String]
411
+ # Result populated for successful execution of synchronous function. Will
412
+ # not be populated if function does not return a result through context.
413
+ # @!attribute [rw] error
414
+ # @return [::String]
415
+ # Either system or user-function generated error. Set if execution
416
+ # was not successful.
417
+ class CallFunctionResponse
418
+ include ::Google::Protobuf::MessageExts
419
+ extend ::Google::Protobuf::MessageExts::ClassMethods
420
+ end
421
+
422
+ # Request of `GenerateSourceUploadUrl` method.
423
+ # @!attribute [rw] parent
424
+ # @return [::String]
425
+ # The project and location in which the Google Cloud Storage signed URL
426
+ # should be generated, specified in the format `projects/*/locations/*`.
427
+ class GenerateUploadUrlRequest
428
+ include ::Google::Protobuf::MessageExts
429
+ extend ::Google::Protobuf::MessageExts::ClassMethods
430
+ end
431
+
432
+ # Response of `GenerateSourceUploadUrl` method.
433
+ # @!attribute [rw] upload_url
434
+ # @return [::String]
435
+ # The generated Google Cloud Storage signed URL that should be used for a
436
+ # function source code upload. The uploaded file should be a zip archive
437
+ # which contains a function.
438
+ class GenerateUploadUrlResponse
439
+ include ::Google::Protobuf::MessageExts
440
+ extend ::Google::Protobuf::MessageExts::ClassMethods
441
+ end
442
+
443
+ # Request of `GenerateDownloadUrl` method.
444
+ # @!attribute [rw] name
445
+ # @return [::String]
446
+ # The name of function for which source code Google Cloud Storage signed
447
+ # URL should be generated.
448
+ # @!attribute [rw] version_id
449
+ # @return [::Integer]
450
+ # The optional version of function. If not set, default, current version
451
+ # is used.
452
+ class GenerateDownloadUrlRequest
453
+ include ::Google::Protobuf::MessageExts
454
+ extend ::Google::Protobuf::MessageExts::ClassMethods
455
+ end
456
+
457
+ # Response of `GenerateDownloadUrl` method.
458
+ # @!attribute [rw] download_url
459
+ # @return [::String]
460
+ # The generated Google Cloud Storage signed URL that should be used for
461
+ # function source code download.
462
+ class GenerateDownloadUrlResponse
463
+ include ::Google::Protobuf::MessageExts
464
+ extend ::Google::Protobuf::MessageExts::ClassMethods
465
+ end
466
+
467
+ # Describes the current stage of a deployment.
468
+ module CloudFunctionStatus
469
+ # Not specified. Invalid state.
470
+ CLOUD_FUNCTION_STATUS_UNSPECIFIED = 0
471
+
472
+ # Function has been successfully deployed and is serving.
473
+ ACTIVE = 1
474
+
475
+ # Function deployment failed and the function isn’t serving.
476
+ OFFLINE = 2
477
+
478
+ # Function is being created or updated.
479
+ DEPLOY_IN_PROGRESS = 3
480
+
481
+ # Function is being deleted.
482
+ DELETE_IN_PROGRESS = 4
483
+
484
+ # Function deployment failed and the function serving state is undefined.
485
+ # The function should be updated or deleted to move it out of this state.
486
+ UNKNOWN = 5
487
+ end
488
+ end
489
+ end
490
+ end
491
+ end