google-cloud-recaptcha_enterprise-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 RecaptchaEnterprise
24
+ module V1beta1
25
+ module RecaptchaEnterpriseService
26
+ # Credentials for the RecaptchaEnterpriseServiceV1Beta1 API.
27
+ class Credentials < Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "RECAPTCHA_ENTERPRISE_CREDENTIALS",
33
+ "RECAPTCHA_ENTERPRISE_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "RECAPTCHA_ENTERPRISE_CREDENTIALS_JSON",
38
+ "RECAPTCHA_ENTERPRISE_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,81 @@
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 RecaptchaEnterprise
23
+ module V1beta1
24
+ module RecaptchaEnterpriseService
25
+ # Path helper methods for the RecaptchaEnterpriseServiceV1Beta1 API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Assessment resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/assessments/{assessment}`
33
+ #
34
+ # @param project [String]
35
+ # @param assessment [String]
36
+ #
37
+ # @return [String]
38
+ def assessment_path project:, assessment:
39
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/assessments/#{assessment}"
42
+ end
43
+
44
+ ##
45
+ # Create a fully-qualified Key resource string.
46
+ #
47
+ # The resource will be in the following format:
48
+ #
49
+ # `projects/{project}/keys/{key}`
50
+ #
51
+ # @param project [String]
52
+ # @param key [String]
53
+ #
54
+ # @return [String]
55
+ def key_path project:, key:
56
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
57
+
58
+ "projects/#{project}/keys/#{key}"
59
+ end
60
+
61
+ ##
62
+ # Create a fully-qualified Project resource string.
63
+ #
64
+ # The resource will be in the following format:
65
+ #
66
+ # `projects/{project}`
67
+ #
68
+ # @param project [String]
69
+ #
70
+ # @return [String]
71
+ def project_path project:
72
+ "projects/#{project}"
73
+ end
74
+
75
+ extend self
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ 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 RecaptchaEnterprise
23
+ module V1beta1
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,156 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.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/protobuf/empty_pb'
11
+ require 'google/protobuf/field_mask_pb'
12
+ require 'google/protobuf/timestamp_pb'
13
+ Google::Protobuf::DescriptorPool.generated_pool.build do
14
+ add_file("google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto", :syntax => :proto3) do
15
+ add_message "google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest" do
16
+ optional :parent, :string, 1
17
+ optional :assessment, :message, 2, "google.cloud.recaptchaenterprise.v1beta1.Assessment"
18
+ end
19
+ add_message "google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest" do
20
+ optional :name, :string, 1
21
+ optional :annotation, :enum, 2, "google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation"
22
+ end
23
+ add_enum "google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation" do
24
+ value :ANNOTATION_UNSPECIFIED, 0
25
+ value :LEGITIMATE, 1
26
+ value :FRAUDULENT, 2
27
+ end
28
+ add_message "google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse" do
29
+ end
30
+ add_message "google.cloud.recaptchaenterprise.v1beta1.Assessment" do
31
+ optional :name, :string, 1
32
+ optional :event, :message, 2, "google.cloud.recaptchaenterprise.v1beta1.Event"
33
+ optional :score, :float, 3
34
+ optional :token_properties, :message, 4, "google.cloud.recaptchaenterprise.v1beta1.TokenProperties"
35
+ repeated :reasons, :enum, 5, "google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason"
36
+ end
37
+ add_enum "google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason" do
38
+ value :CLASSIFICATION_REASON_UNSPECIFIED, 0
39
+ value :AUTOMATION, 1
40
+ value :UNEXPECTED_ENVIRONMENT, 2
41
+ value :TOO_MUCH_TRAFFIC, 3
42
+ value :UNEXPECTED_USAGE_PATTERNS, 4
43
+ value :LOW_CONFIDENCE_SCORE, 5
44
+ end
45
+ add_message "google.cloud.recaptchaenterprise.v1beta1.Event" do
46
+ optional :token, :string, 1
47
+ optional :site_key, :string, 2
48
+ optional :user_agent, :string, 3
49
+ optional :user_ip_address, :string, 4
50
+ optional :expected_action, :string, 5
51
+ end
52
+ add_message "google.cloud.recaptchaenterprise.v1beta1.TokenProperties" do
53
+ optional :valid, :bool, 1
54
+ optional :invalid_reason, :enum, 2, "google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason"
55
+ optional :create_time, :message, 3, "google.protobuf.Timestamp"
56
+ optional :hostname, :string, 4
57
+ optional :action, :string, 5
58
+ end
59
+ add_enum "google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason" do
60
+ value :INVALID_REASON_UNSPECIFIED, 0
61
+ value :UNKNOWN_INVALID_REASON, 1
62
+ value :MALFORMED, 2
63
+ value :EXPIRED, 3
64
+ value :DUPE, 4
65
+ value :SITE_MISMATCH, 5
66
+ value :MISSING, 6
67
+ end
68
+ add_message "google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest" do
69
+ optional :parent, :string, 1
70
+ optional :key, :message, 2, "google.cloud.recaptchaenterprise.v1beta1.Key"
71
+ end
72
+ add_message "google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest" do
73
+ optional :parent, :string, 1
74
+ optional :page_size, :int32, 2
75
+ optional :page_token, :string, 3
76
+ end
77
+ add_message "google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse" do
78
+ repeated :keys, :message, 1, "google.cloud.recaptchaenterprise.v1beta1.Key"
79
+ optional :next_page_token, :string, 2
80
+ end
81
+ add_message "google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest" do
82
+ optional :name, :string, 1
83
+ end
84
+ add_message "google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest" do
85
+ optional :key, :message, 1, "google.cloud.recaptchaenterprise.v1beta1.Key"
86
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
87
+ end
88
+ add_message "google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest" do
89
+ optional :name, :string, 1
90
+ end
91
+ add_message "google.cloud.recaptchaenterprise.v1beta1.Key" do
92
+ optional :name, :string, 1
93
+ optional :display_name, :string, 2
94
+ oneof :platform_settings do
95
+ optional :web_settings, :message, 3, "google.cloud.recaptchaenterprise.v1beta1.WebKeySettings"
96
+ optional :android_settings, :message, 4, "google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings"
97
+ optional :ios_settings, :message, 5, "google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings"
98
+ end
99
+ end
100
+ add_message "google.cloud.recaptchaenterprise.v1beta1.WebKeySettings" do
101
+ optional :enforce_allowed_domains, :bool, 3
102
+ repeated :allowed_domains, :string, 1
103
+ optional :allow_amp_traffic, :bool, 2
104
+ optional :integration_type, :enum, 4, "google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType"
105
+ optional :challenge_security_preference, :enum, 5, "google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference"
106
+ end
107
+ add_enum "google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType" do
108
+ value :INTEGRATION_TYPE_UNSPECIFIED, 0
109
+ value :SCORE_ONLY, 1
110
+ value :CHECKBOX_CHALLENGE, 2
111
+ value :INVISIBLE_CHALLENGE, 3
112
+ end
113
+ add_enum "google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference" do
114
+ value :CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED, 0
115
+ value :USABILITY, 1
116
+ value :BALANCED, 2
117
+ value :SECURITY, 3
118
+ end
119
+ add_message "google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings" do
120
+ repeated :allowed_package_names, :string, 1
121
+ end
122
+ add_message "google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings" do
123
+ repeated :allowed_bundle_ids, :string, 1
124
+ end
125
+ end
126
+ end
127
+
128
+ module Google
129
+ module Cloud
130
+ module RecaptchaEnterprise
131
+ module V1beta1
132
+ CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest").msgclass
133
+ AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest").msgclass
134
+ AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation").enummodule
135
+ AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse").msgclass
136
+ Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Assessment").msgclass
137
+ Assessment::ClassificationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason").enummodule
138
+ Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Event").msgclass
139
+ TokenProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TokenProperties").msgclass
140
+ TokenProperties::InvalidReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason").enummodule
141
+ CreateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest").msgclass
142
+ ListKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest").msgclass
143
+ ListKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse").msgclass
144
+ GetKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest").msgclass
145
+ UpdateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest").msgclass
146
+ DeleteKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest").msgclass
147
+ Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Key").msgclass
148
+ WebKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.WebKeySettings").msgclass
149
+ WebKeySettings::IntegrationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType").enummodule
150
+ WebKeySettings::ChallengeSecurityPreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference").enummodule
151
+ AndroidKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings").msgclass
152
+ IOSKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings").msgclass
153
+ end
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,59 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto for package 'Google.Cloud.RecaptchaEnterprise.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/recaptchaenterprise/v1beta1/recaptchaenterprise_pb'
22
+
23
+ module Google
24
+ module Cloud
25
+ module RecaptchaEnterprise
26
+ module V1beta1
27
+ module RecaptchaEnterpriseServiceV1Beta1
28
+ # Service to determine the likelihood an event is legitimate.
29
+ class Service
30
+
31
+ include GRPC::GenericService
32
+
33
+ self.marshal_class_method = :encode
34
+ self.unmarshal_class_method = :decode
35
+ self.service_name = 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1'
36
+
37
+ # Creates an Assessment of the likelihood an event is legitimate.
38
+ rpc :CreateAssessment, Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment
39
+ # Annotates a previously created Assessment to provide additional information
40
+ # on whether the event turned out to be authentic or fradulent.
41
+ rpc :AnnotateAssessment, Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse
42
+ # Creates a new reCAPTCHA Enterprise key.
43
+ rpc :CreateKey, Google::Cloud::RecaptchaEnterprise::V1beta1::CreateKeyRequest, Google::Cloud::RecaptchaEnterprise::V1beta1::Key
44
+ # Returns the list of all keys that belong to a project.
45
+ rpc :ListKeys, Google::Cloud::RecaptchaEnterprise::V1beta1::ListKeysRequest, Google::Cloud::RecaptchaEnterprise::V1beta1::ListKeysResponse
46
+ # Returns the specified key.
47
+ rpc :GetKey, Google::Cloud::RecaptchaEnterprise::V1beta1::GetKeyRequest, Google::Cloud::RecaptchaEnterprise::V1beta1::Key
48
+ # Updates the specified key.
49
+ rpc :UpdateKey, Google::Cloud::RecaptchaEnterprise::V1beta1::UpdateKeyRequest, Google::Cloud::RecaptchaEnterprise::V1beta1::Key
50
+ # Deletes the specified key.
51
+ rpc :DeleteKey, Google::Cloud::RecaptchaEnterprise::V1beta1::DeleteKeyRequest, Google::Protobuf::Empty
52
+ end
53
+
54
+ Stub = Service.rpc_stub_class
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,4 @@
1
+ # reCAPTCHA Enterprise 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