google-cloud-binary_authorization-v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
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
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module BinaryAuthorization
24
+ module V1beta1
25
+ module BinauthzManagementService
26
+ # Credentials for the BinauthzManagementService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "BINARY_AUTHORIZATION_CREDENTIALS",
33
+ "BINARY_AUTHORIZATION_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "BINARY_AUTHORIZATION_CREDENTIALS_JSON",
38
+ "BINARY_AUTHORIZATION_KEYFILE_JSON",
39
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
40
+ "GOOGLE_CLOUD_KEYFILE_JSON",
41
+ "GCLOUD_KEYFILE_JSON"
42
+ ]
43
+ self.paths = [
44
+ "~/.config/google_cloud/application_default_credentials.json"
45
+ ]
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,78 @@
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 BinaryAuthorization
23
+ module V1beta1
24
+ module BinauthzManagementService
25
+ # Path helper methods for the BinauthzManagementService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Attestor resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/attestors/{attestor}`
33
+ #
34
+ # @param project [String]
35
+ # @param attestor [String]
36
+ #
37
+ # @return [::String]
38
+ def attestor_path project:, attestor:
39
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/attestors/#{attestor}"
42
+ end
43
+
44
+ ##
45
+ # Create a fully-qualified Policy resource string.
46
+ #
47
+ # The resource will be in the following format:
48
+ #
49
+ # `projects/{project}/policy`
50
+ #
51
+ # @param project [String]
52
+ #
53
+ # @return [::String]
54
+ def policy_path project:
55
+ "projects/#{project}/policy"
56
+ end
57
+
58
+ ##
59
+ # Create a fully-qualified Project resource string.
60
+ #
61
+ # The resource will be in the following format:
62
+ #
63
+ # `projects/{project}`
64
+ #
65
+ # @param project [String]
66
+ #
67
+ # @return [::String]
68
+ def project_path project:
69
+ "projects/#{project}"
70
+ end
71
+
72
+ extend self
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,28 @@
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 BinaryAuthorization
23
+ module V1beta1
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,105 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/binaryauthorization/v1beta1/resources.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/api/resource_pb'
8
+ require 'google/protobuf/timestamp_pb'
9
+ require 'google/api/annotations_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_file("google/cloud/binaryauthorization/v1beta1/resources.proto", :syntax => :proto3) do
12
+ add_message "google.cloud.binaryauthorization.v1beta1.Policy" do
13
+ optional :name, :string, 1
14
+ optional :description, :string, 6
15
+ optional :global_policy_evaluation_mode, :enum, 7, "google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode"
16
+ repeated :admission_whitelist_patterns, :message, 2, "google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern"
17
+ map :cluster_admission_rules, :string, :message, 3, "google.cloud.binaryauthorization.v1beta1.AdmissionRule"
18
+ optional :default_admission_rule, :message, 4, "google.cloud.binaryauthorization.v1beta1.AdmissionRule"
19
+ optional :update_time, :message, 5, "google.protobuf.Timestamp"
20
+ end
21
+ add_enum "google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode" do
22
+ value :GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED, 0
23
+ value :ENABLE, 1
24
+ value :DISABLE, 2
25
+ end
26
+ add_message "google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern" do
27
+ optional :name_pattern, :string, 1
28
+ end
29
+ add_message "google.cloud.binaryauthorization.v1beta1.AdmissionRule" do
30
+ optional :evaluation_mode, :enum, 1, "google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode"
31
+ repeated :require_attestations_by, :string, 2
32
+ optional :enforcement_mode, :enum, 3, "google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode"
33
+ end
34
+ add_enum "google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode" do
35
+ value :EVALUATION_MODE_UNSPECIFIED, 0
36
+ value :ALWAYS_ALLOW, 1
37
+ value :REQUIRE_ATTESTATION, 2
38
+ value :ALWAYS_DENY, 3
39
+ end
40
+ add_enum "google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode" do
41
+ value :ENFORCEMENT_MODE_UNSPECIFIED, 0
42
+ value :ENFORCED_BLOCK_AND_AUDIT_LOG, 1
43
+ value :DRYRUN_AUDIT_LOG_ONLY, 2
44
+ end
45
+ add_message "google.cloud.binaryauthorization.v1beta1.Attestor" do
46
+ optional :name, :string, 1
47
+ optional :description, :string, 6
48
+ optional :update_time, :message, 4, "google.protobuf.Timestamp"
49
+ oneof :attestor_type do
50
+ optional :user_owned_drydock_note, :message, 3, "google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote"
51
+ end
52
+ end
53
+ add_message "google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote" do
54
+ optional :note_reference, :string, 1
55
+ repeated :public_keys, :message, 2, "google.cloud.binaryauthorization.v1beta1.AttestorPublicKey"
56
+ optional :delegation_service_account_email, :string, 3
57
+ end
58
+ add_message "google.cloud.binaryauthorization.v1beta1.PkixPublicKey" do
59
+ optional :public_key_pem, :string, 1
60
+ optional :signature_algorithm, :enum, 2, "google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm"
61
+ end
62
+ add_enum "google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm" do
63
+ value :SIGNATURE_ALGORITHM_UNSPECIFIED, 0
64
+ value :RSA_PSS_2048_SHA256, 1
65
+ value :RSA_PSS_3072_SHA256, 2
66
+ value :RSA_PSS_4096_SHA256, 3
67
+ value :RSA_PSS_4096_SHA512, 4
68
+ value :RSA_SIGN_PKCS1_2048_SHA256, 5
69
+ value :RSA_SIGN_PKCS1_3072_SHA256, 6
70
+ value :RSA_SIGN_PKCS1_4096_SHA256, 7
71
+ value :RSA_SIGN_PKCS1_4096_SHA512, 8
72
+ value :ECDSA_P256_SHA256, 9
73
+ value :ECDSA_P384_SHA384, 10
74
+ value :ECDSA_P521_SHA512, 11
75
+ end
76
+ add_message "google.cloud.binaryauthorization.v1beta1.AttestorPublicKey" do
77
+ optional :comment, :string, 1
78
+ optional :id, :string, 2
79
+ oneof :public_key do
80
+ optional :ascii_armored_pgp_public_key, :string, 3
81
+ optional :pkix_public_key, :message, 5, "google.cloud.binaryauthorization.v1beta1.PkixPublicKey"
82
+ end
83
+ end
84
+ end
85
+ end
86
+
87
+ module Google
88
+ module Cloud
89
+ module BinaryAuthorization
90
+ module V1beta1
91
+ Policy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.Policy").msgclass
92
+ Policy::GlobalPolicyEvaluationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode").enummodule
93
+ AdmissionWhitelistPattern = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern").msgclass
94
+ AdmissionRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.AdmissionRule").msgclass
95
+ AdmissionRule::EvaluationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode").enummodule
96
+ AdmissionRule::EnforcementMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode").enummodule
97
+ Attestor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.Attestor").msgclass
98
+ UserOwnedDrydockNote = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote").msgclass
99
+ PkixPublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.PkixPublicKey").msgclass
100
+ PkixPublicKey::SignatureAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm").enummodule
101
+ AttestorPublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.AttestorPublicKey").msgclass
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,61 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/binaryauthorization/v1beta1/service.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ require 'google/cloud/binaryauthorization/v1beta1/resources_pb'
11
+ require 'google/protobuf/empty_pb'
12
+ Google::Protobuf::DescriptorPool.generated_pool.build do
13
+ add_file("google/cloud/binaryauthorization/v1beta1/service.proto", :syntax => :proto3) do
14
+ add_message "google.cloud.binaryauthorization.v1beta1.GetPolicyRequest" do
15
+ optional :name, :string, 1
16
+ end
17
+ add_message "google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest" do
18
+ optional :policy, :message, 1, "google.cloud.binaryauthorization.v1beta1.Policy"
19
+ end
20
+ add_message "google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest" do
21
+ optional :parent, :string, 1
22
+ optional :attestor_id, :string, 2
23
+ optional :attestor, :message, 3, "google.cloud.binaryauthorization.v1beta1.Attestor"
24
+ end
25
+ add_message "google.cloud.binaryauthorization.v1beta1.GetAttestorRequest" do
26
+ optional :name, :string, 1
27
+ end
28
+ add_message "google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest" do
29
+ optional :attestor, :message, 1, "google.cloud.binaryauthorization.v1beta1.Attestor"
30
+ end
31
+ add_message "google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest" do
32
+ optional :parent, :string, 1
33
+ optional :page_size, :int32, 2
34
+ optional :page_token, :string, 3
35
+ end
36
+ add_message "google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse" do
37
+ repeated :attestors, :message, 1, "google.cloud.binaryauthorization.v1beta1.Attestor"
38
+ optional :next_page_token, :string, 2
39
+ end
40
+ add_message "google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest" do
41
+ optional :name, :string, 1
42
+ end
43
+ end
44
+ end
45
+
46
+ module Google
47
+ module Cloud
48
+ module BinaryAuthorization
49
+ module V1beta1
50
+ GetPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.GetPolicyRequest").msgclass
51
+ UpdatePolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest").msgclass
52
+ CreateAttestorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest").msgclass
53
+ GetAttestorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.GetAttestorRequest").msgclass
54
+ UpdateAttestorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest").msgclass
55
+ ListAttestorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest").msgclass
56
+ ListAttestorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse").msgclass
57
+ DeleteAttestorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest").msgclass
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,83 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/binaryauthorization/v1beta1/service.proto for package 'Google.Cloud.BinaryAuthorization.V1beta1'
3
+ # Original file comments:
4
+ # Copyright 2019 Google LLC.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ #
19
+
20
+ require 'grpc'
21
+ require 'google/cloud/binaryauthorization/v1beta1/service_pb'
22
+
23
+ module Google
24
+ module Cloud
25
+ module BinaryAuthorization
26
+ module V1beta1
27
+ module BinauthzManagementServiceV1Beta1
28
+ # Customer-facing API for Cloud Binary Authorization.
29
+ #
30
+ # Google Cloud Management Service for Binary Authorization admission policies
31
+ # and attestation authorities.
32
+ #
33
+ # This API implements a REST model with the following objects:
34
+ #
35
+ # * [Policy][google.cloud.binaryauthorization.v1beta1.Policy]
36
+ # * [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor]
37
+ class Service
38
+
39
+ include GRPC::GenericService
40
+
41
+ self.marshal_class_method = :encode
42
+ self.unmarshal_class_method = :decode
43
+ self.service_name = 'google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1'
44
+
45
+ # A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must attest to
46
+ # a container image, before the project is allowed to deploy that
47
+ # image. There is at most one policy per project. All image admission
48
+ # requests are permitted if a project has no policy.
49
+ #
50
+ # Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this project. Returns a default
51
+ # [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not have one.
52
+ rpc :GetPolicy, ::Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest, ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
53
+ # Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a copy of the
54
+ # new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy is always updated as a whole, to avoid race
55
+ # conditions with concurrent policy enforcement (or management!)
56
+ # requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT
57
+ # if the request is malformed.
58
+ rpc :UpdatePolicy, ::Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest, ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
59
+ # Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of the new
60
+ # [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the project does not exist,
61
+ # INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the
62
+ # [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists.
63
+ rpc :CreateAttestor, ::Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest, ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
64
+ # Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
65
+ # Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist.
66
+ rpc :GetAttestor, ::Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest, ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
67
+ # Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
68
+ # Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist.
69
+ rpc :UpdateAttestor, ::Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest, ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
70
+ # Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
71
+ # Returns INVALID_ARGUMENT if the project does not exist.
72
+ rpc :ListAttestors, ::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest, ::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsResponse
73
+ # Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the
74
+ # [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist.
75
+ rpc :DeleteAttestor, ::Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest, ::Google::Protobuf::Empty
76
+ end
77
+
78
+ Stub = Service.rpc_stub_class
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,4 @@
1
+ # Binary Authorization V1beta1 Protocol Buffer Documentation
2
+
3
+ These files are for the YARD documentation of the generated protobuf files.
4
+ They are not intended to be required or loaded at runtime.
@@ -0,0 +1,59 @@
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
+ # An indicator of the behavior of a given field (for example, that a field
23
+ # is required in requests, or given as output but ignored as input).
24
+ # This **does not** change the behavior in protocol buffers itself; it only
25
+ # denotes the behavior and may affect how API tooling handles the field.
26
+ #
27
+ # Note: This enum **may** receive new values in the future.
28
+ module FieldBehavior
29
+ # Conventional default for enums. Do not use this.
30
+ FIELD_BEHAVIOR_UNSPECIFIED = 0
31
+
32
+ # Specifically denotes a field as optional.
33
+ # While all fields in protocol buffers are optional, this may be specified
34
+ # for emphasis if appropriate.
35
+ OPTIONAL = 1
36
+
37
+ # Denotes a field as required.
38
+ # This indicates that the field **must** be provided as part of the request,
39
+ # and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
40
+ REQUIRED = 2
41
+
42
+ # Denotes a field as output only.
43
+ # This indicates that the field is provided in responses, but including the
44
+ # field in a request does nothing (the server *must* ignore it and
45
+ # *must not* throw an error as a result of the field's presence).
46
+ OUTPUT_ONLY = 3
47
+
48
+ # Denotes a field as input only.
49
+ # This indicates that the field is provided in requests, and the
50
+ # corresponding field is not included in output.
51
+ INPUT_ONLY = 4
52
+
53
+ # Denotes a field as immutable.
54
+ # This indicates that the field may be set once in a request to create a
55
+ # resource, but may not be changed thereafter.
56
+ IMMUTABLE = 5
57
+ end
58
+ end
59
+ end