google-cloud-bigquery-data_policies-v1beta1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 Bigquery
24
+ module DataPolicies
25
+ module V1beta1
26
+ module DataPolicyService
27
+ # Credentials for the DataPolicyService API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/bigquery",
31
+ "https://www.googleapis.com/auth/cloud-platform"
32
+ ]
33
+ self.env_vars = [
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
38
+ "GOOGLE_CLOUD_KEYFILE_JSON",
39
+ "GCLOUD_KEYFILE_JSON"
40
+ ]
41
+ self.paths = [
42
+ "~/.config/google_cloud/application_default_credentials.json"
43
+ ]
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 Bigquery
23
+ module DataPolicies
24
+ module V1beta1
25
+ module DataPolicyService
26
+ # Path helper methods for the DataPolicyService API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified DataPolicy resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/dataPolicies/{data_policy}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param data_policy [String]
38
+ #
39
+ # @return [::String]
40
+ def data_policy_path project:, location:, data_policy:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+
44
+ "projects/#{project}/locations/#{location}/dataPolicies/#{data_policy}"
45
+ end
46
+
47
+ ##
48
+ # Create a fully-qualified Location resource string.
49
+ #
50
+ # The resource will be in the following format:
51
+ #
52
+ # `projects/{project}/locations/{location}`
53
+ #
54
+ # @param project [String]
55
+ # @param location [String]
56
+ #
57
+ # @return [::String]
58
+ def location_path project:, location:
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+
61
+ "projects/#{project}/locations/#{location}"
62
+ end
63
+
64
+ extend self
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/bigquery/data_policies/v1beta1/version"
24
+
25
+ require "google/cloud/bigquery/data_policies/v1beta1/data_policy_service/credentials"
26
+ require "google/cloud/bigquery/data_policies/v1beta1/data_policy_service/paths"
27
+ require "google/cloud/bigquery/data_policies/v1beta1/data_policy_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Bigquery
32
+ module DataPolicies
33
+ module V1beta1
34
+ ##
35
+ # Data Policy Service provides APIs for managing the label-policy bindings.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/bigquery/data_policies/v1beta1/data_policy_service"
40
+ # client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
41
+ #
42
+ module DataPolicyService
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "data_policy_service", "helpers.rb"
51
+ require "google/cloud/bigquery/data_policies/v1beta1/data_policy_service/helpers" if ::File.file? helper_path
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright 2022 Google LLC
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
4
6
  # you may not use this file except in compliance with the License.
5
7
  # You may obtain a copy of the License at
6
8
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
9
+ # https://www.apache.org/licenses/LICENSE-2.0
8
10
  #
9
11
  # Unless required by applicable law or agreed to in writing, software
10
12
  # distributed under the License is distributed on an "AS IS" BASIS,
@@ -12,12 +14,15 @@
12
14
  # See the License for the specific language governing permissions and
13
15
  # limitations under the License.
14
16
 
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
15
20
  module Google
16
21
  module Cloud
17
22
  module Bigquery
18
23
  module DataPolicies
19
24
  module V1beta1
20
- VERSION = "0.a"
25
+ VERSION = "0.1.0"
21
26
  end
22
27
  end
23
28
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 "google/cloud/bigquery/data_policies/v1beta1/data_policy_service"
20
+ require "google/cloud/bigquery/data_policies/v1beta1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Bigquery
25
+ module DataPolicies
26
+ ##
27
+ # To load this package, including all its services, and instantiate a client:
28
+ #
29
+ # @example
30
+ #
31
+ # require "google/cloud/bigquery/data_policies/v1beta1"
32
+ # client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
33
+ #
34
+ module V1beta1
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb"
42
+ require "google/cloud/bigquery/data_policies/v1beta1/_helpers" if ::File.file? helper_path
@@ -0,0 +1,89 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/bigquery/datapolicies/v1beta1/datapolicy.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/iam/v1/iam_policy_pb'
11
+ require 'google/iam/v1/policy_pb'
12
+ require 'google/protobuf/empty_pb'
13
+ require 'google/protobuf/field_mask_pb'
14
+
15
+ Google::Protobuf::DescriptorPool.generated_pool.build do
16
+ add_file("google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto", :syntax => :proto3) do
17
+ add_message "google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest" do
18
+ optional :parent, :string, 1
19
+ optional :data_policy, :message, 2, "google.cloud.bigquery.datapolicies.v1beta1.DataPolicy"
20
+ end
21
+ add_message "google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest" do
22
+ optional :data_policy, :message, 1, "google.cloud.bigquery.datapolicies.v1beta1.DataPolicy"
23
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
24
+ end
25
+ add_message "google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest" do
26
+ optional :name, :string, 1
27
+ end
28
+ add_message "google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest" do
29
+ optional :name, :string, 1
30
+ end
31
+ add_message "google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest" 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.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse" do
37
+ repeated :data_policies, :message, 1, "google.cloud.bigquery.datapolicies.v1beta1.DataPolicy"
38
+ optional :next_page_token, :string, 2
39
+ end
40
+ add_message "google.cloud.bigquery.datapolicies.v1beta1.DataPolicy" do
41
+ optional :name, :string, 1
42
+ optional :data_policy_type, :enum, 2, "google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType"
43
+ optional :data_policy_id, :string, 3
44
+ oneof :matching_label do
45
+ optional :policy_tag, :string, 4
46
+ end
47
+ oneof :policy do
48
+ optional :data_masking_policy, :message, 5, "google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy"
49
+ end
50
+ end
51
+ add_enum "google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType" do
52
+ value :DATA_POLICY_TYPE_UNSPECIFIED, 0
53
+ value :COLUMN_LEVEL_SECURITY_POLICY, 3
54
+ value :DATA_MASKING_POLICY, 2
55
+ end
56
+ add_message "google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy" do
57
+ oneof :masking_expression do
58
+ optional :predefined_expression, :enum, 1, "google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression"
59
+ end
60
+ end
61
+ add_enum "google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression" do
62
+ value :PREDEFINED_EXPRESSION_UNSPECIFIED, 0
63
+ value :SHA256, 3
64
+ value :ALWAYS_NULL, 5
65
+ value :DEFAULT_MASKING_VALUE, 7
66
+ end
67
+ end
68
+ end
69
+
70
+ module Google
71
+ module Cloud
72
+ module Bigquery
73
+ module DataPolicies
74
+ module V1beta1
75
+ CreateDataPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest").msgclass
76
+ UpdateDataPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest").msgclass
77
+ DeleteDataPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest").msgclass
78
+ GetDataPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest").msgclass
79
+ ListDataPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest").msgclass
80
+ ListDataPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse").msgclass
81
+ DataPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.DataPolicy").msgclass
82
+ DataPolicy::DataPolicyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType").enummodule
83
+ DataMaskingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy").msgclass
84
+ DataMaskingPolicy::PredefinedExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression").enummodule
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,63 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto for package 'Google.Cloud.Bigquery.DataPolicies.V1beta1'
3
+ # Original file comments:
4
+ # Copyright 2022 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
+ require 'grpc'
20
+ require 'google/cloud/bigquery/datapolicies/v1beta1/datapolicy_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Bigquery
25
+ module DataPolicies
26
+ module V1beta1
27
+ module DataPolicyService
28
+ # Data Policy Service provides APIs for managing the label-policy bindings.
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.bigquery.datapolicies.v1beta1.DataPolicyService'
36
+
37
+ # Creates a new data policy under a project with the given `dataPolicyId`
38
+ # (used as the display name), policy tag, and data policy type.
39
+ rpc :CreateDataPolicy, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::CreateDataPolicyRequest, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy
40
+ # Updates the metadata for an existing data policy. The target data policy
41
+ # can be specified by the resource name.
42
+ rpc :UpdateDataPolicy, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::UpdateDataPolicyRequest, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy
43
+ # Deletes the data policy specified by its resource name.
44
+ rpc :DeleteDataPolicy, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DeleteDataPolicyRequest, ::Google::Protobuf::Empty
45
+ # Gets the data policy specified by its resource name.
46
+ rpc :GetDataPolicy, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::GetDataPolicyRequest, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy
47
+ # List all of the data policies in the specified parent project.
48
+ rpc :ListDataPolicies, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesRequest, ::Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesResponse
49
+ # Gets the IAM policy for the specified data policy.
50
+ rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy
51
+ # Sets the IAM policy for the specified data policy.
52
+ rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy
53
+ # Returns the caller's permission on the specified data policy resource.
54
+ rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse
55
+ end
56
+
57
+ Stub = Service.rpc_stub_class
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/bigquery/data_policies/v1beta1"
@@ -0,0 +1,4 @@
1
+ # BigQuery Data Policy Service 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,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
69
+ end
70
+ end
71
+ end