google-cloud-essential_contacts-v1 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 2021 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 EssentialContacts
24
+ module V1
25
+ module EssentialContactsService
26
+ # Credentials for the EssentialContactsService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "ESSENTIAL_CONTACTS_CREDENTIALS",
33
+ "ESSENTIAL_CONTACTS_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "ESSENTIAL_CONTACTS_CREDENTIALS_JSON",
38
+ "ESSENTIAL_CONTACTS_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,127 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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 EssentialContacts
23
+ module V1
24
+ module EssentialContactsService
25
+ # Path helper methods for the EssentialContactsService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Contact resource string.
29
+ #
30
+ # @overload contact_path(project:, contact:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/contacts/{contact}`
34
+ #
35
+ # @param project [String]
36
+ # @param contact [String]
37
+ #
38
+ # @overload contact_path(folder:, contact:)
39
+ # The resource will be in the following format:
40
+ #
41
+ # `folders/{folder}/contacts/{contact}`
42
+ #
43
+ # @param folder [String]
44
+ # @param contact [String]
45
+ #
46
+ # @overload contact_path(organization:, contact:)
47
+ # The resource will be in the following format:
48
+ #
49
+ # `organizations/{organization}/contacts/{contact}`
50
+ #
51
+ # @param organization [String]
52
+ # @param contact [String]
53
+ #
54
+ # @return [::String]
55
+ def contact_path **args
56
+ resources = {
57
+ "contact:project" => (proc do |project:, contact:|
58
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
59
+
60
+ "projects/#{project}/contacts/#{contact}"
61
+ end),
62
+ "contact:folder" => (proc do |folder:, contact:|
63
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
64
+
65
+ "folders/#{folder}/contacts/#{contact}"
66
+ end),
67
+ "contact:organization" => (proc do |organization:, contact:|
68
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
69
+
70
+ "organizations/#{organization}/contacts/#{contact}"
71
+ end)
72
+ }
73
+
74
+ resource = resources[args.keys.sort.join(":")]
75
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
76
+ resource.call(**args)
77
+ end
78
+
79
+ ##
80
+ # Create a fully-qualified Folder resource string.
81
+ #
82
+ # The resource will be in the following format:
83
+ #
84
+ # `folders/{folder}`
85
+ #
86
+ # @param folder [String]
87
+ #
88
+ # @return [::String]
89
+ def folder_path folder:
90
+ "folders/#{folder}"
91
+ end
92
+
93
+ ##
94
+ # Create a fully-qualified Organization resource string.
95
+ #
96
+ # The resource will be in the following format:
97
+ #
98
+ # `organizations/{organization}`
99
+ #
100
+ # @param organization [String]
101
+ #
102
+ # @return [::String]
103
+ def organization_path organization:
104
+ "organizations/#{organization}"
105
+ end
106
+
107
+ ##
108
+ # Create a fully-qualified Project resource string.
109
+ #
110
+ # The resource will be in the following format:
111
+ #
112
+ # `projects/{project}`
113
+ #
114
+ # @param project [String]
115
+ #
116
+ # @return [::String]
117
+ def project_path project:
118
+ "projects/#{project}"
119
+ end
120
+
121
+ extend self
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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 EssentialContacts
23
+ module V1
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,36 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/essentialcontacts/v1/enums.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/cloud/essentialcontacts/v1/enums.proto", :syntax => :proto3) do
8
+ add_enum "google.cloud.essentialcontacts.v1.NotificationCategory" do
9
+ value :NOTIFICATION_CATEGORY_UNSPECIFIED, 0
10
+ value :ALL, 2
11
+ value :SUSPENSION, 3
12
+ value :SECURITY, 5
13
+ value :TECHNICAL, 6
14
+ value :BILLING, 7
15
+ value :LEGAL, 8
16
+ value :PRODUCT_UPDATES, 9
17
+ value :TECHNICAL_INCIDENTS, 10
18
+ end
19
+ add_enum "google.cloud.essentialcontacts.v1.ValidationState" do
20
+ value :VALIDATION_STATE_UNSPECIFIED, 0
21
+ value :VALID, 1
22
+ value :INVALID, 2
23
+ end
24
+ end
25
+ end
26
+
27
+ module Google
28
+ module Cloud
29
+ module EssentialContacts
30
+ module V1
31
+ NotificationCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.NotificationCategory").enummodule
32
+ ValidationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.ValidationState").enummodule
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,82 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/essentialcontacts/v1/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/essentialcontacts/v1/enums_pb'
11
+ require 'google/protobuf/empty_pb'
12
+ require 'google/protobuf/field_mask_pb'
13
+ require 'google/protobuf/timestamp_pb'
14
+ Google::Protobuf::DescriptorPool.generated_pool.build do
15
+ add_file("google/cloud/essentialcontacts/v1/service.proto", :syntax => :proto3) do
16
+ add_message "google.cloud.essentialcontacts.v1.Contact" do
17
+ optional :name, :string, 1
18
+ optional :email, :string, 2
19
+ repeated :notification_category_subscriptions, :enum, 3, "google.cloud.essentialcontacts.v1.NotificationCategory"
20
+ optional :language_tag, :string, 4
21
+ optional :validation_state, :enum, 8, "google.cloud.essentialcontacts.v1.ValidationState"
22
+ optional :validate_time, :message, 9, "google.protobuf.Timestamp"
23
+ end
24
+ add_message "google.cloud.essentialcontacts.v1.ListContactsRequest" do
25
+ optional :parent, :string, 1
26
+ optional :page_size, :int32, 2
27
+ optional :page_token, :string, 3
28
+ end
29
+ add_message "google.cloud.essentialcontacts.v1.ListContactsResponse" do
30
+ repeated :contacts, :message, 1, "google.cloud.essentialcontacts.v1.Contact"
31
+ optional :next_page_token, :string, 2
32
+ end
33
+ add_message "google.cloud.essentialcontacts.v1.GetContactRequest" do
34
+ optional :name, :string, 1
35
+ end
36
+ add_message "google.cloud.essentialcontacts.v1.DeleteContactRequest" do
37
+ optional :name, :string, 1
38
+ end
39
+ add_message "google.cloud.essentialcontacts.v1.CreateContactRequest" do
40
+ optional :parent, :string, 1
41
+ optional :contact, :message, 2, "google.cloud.essentialcontacts.v1.Contact"
42
+ end
43
+ add_message "google.cloud.essentialcontacts.v1.UpdateContactRequest" do
44
+ optional :contact, :message, 2, "google.cloud.essentialcontacts.v1.Contact"
45
+ optional :update_mask, :message, 3, "google.protobuf.FieldMask"
46
+ end
47
+ add_message "google.cloud.essentialcontacts.v1.ComputeContactsRequest" do
48
+ optional :parent, :string, 1
49
+ repeated :notification_categories, :enum, 6, "google.cloud.essentialcontacts.v1.NotificationCategory"
50
+ optional :page_size, :int32, 3
51
+ optional :page_token, :string, 4
52
+ end
53
+ add_message "google.cloud.essentialcontacts.v1.ComputeContactsResponse" do
54
+ repeated :contacts, :message, 1, "google.cloud.essentialcontacts.v1.Contact"
55
+ optional :next_page_token, :string, 2
56
+ end
57
+ add_message "google.cloud.essentialcontacts.v1.SendTestMessageRequest" do
58
+ repeated :contacts, :string, 1
59
+ optional :resource, :string, 2
60
+ optional :notification_category, :enum, 3, "google.cloud.essentialcontacts.v1.NotificationCategory"
61
+ end
62
+ end
63
+ end
64
+
65
+ module Google
66
+ module Cloud
67
+ module EssentialContacts
68
+ module V1
69
+ Contact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.Contact").msgclass
70
+ ListContactsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.ListContactsRequest").msgclass
71
+ ListContactsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.ListContactsResponse").msgclass
72
+ GetContactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.GetContactRequest").msgclass
73
+ DeleteContactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.DeleteContactRequest").msgclass
74
+ CreateContactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.CreateContactRequest").msgclass
75
+ UpdateContactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.UpdateContactRequest").msgclass
76
+ ComputeContactsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.ComputeContactsRequest").msgclass
77
+ ComputeContactsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.ComputeContactsResponse").msgclass
78
+ SendTestMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.essentialcontacts.v1.SendTestMessageRequest").msgclass
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,61 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/essentialcontacts/v1/service.proto for package 'Google.Cloud.EssentialContacts.V1'
3
+ # Original file comments:
4
+ # Copyright 2021 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/essentialcontacts/v1/service_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module EssentialContacts
25
+ module V1
26
+ module EssentialContactsService
27
+ # Manages contacts for important Google Cloud notifications.
28
+ class Service
29
+
30
+ include GRPC::GenericService
31
+
32
+ self.marshal_class_method = :encode
33
+ self.unmarshal_class_method = :decode
34
+ self.service_name = 'google.cloud.essentialcontacts.v1.EssentialContactsService'
35
+
36
+ # Adds a new contact for a resource.
37
+ rpc :CreateContact, ::Google::Cloud::EssentialContacts::V1::CreateContactRequest, ::Google::Cloud::EssentialContacts::V1::Contact
38
+ # Updates a contact.
39
+ # Note: A contact's email address cannot be changed.
40
+ rpc :UpdateContact, ::Google::Cloud::EssentialContacts::V1::UpdateContactRequest, ::Google::Cloud::EssentialContacts::V1::Contact
41
+ # Lists the contacts that have been set on a resource.
42
+ rpc :ListContacts, ::Google::Cloud::EssentialContacts::V1::ListContactsRequest, ::Google::Cloud::EssentialContacts::V1::ListContactsResponse
43
+ # Gets a single contact.
44
+ rpc :GetContact, ::Google::Cloud::EssentialContacts::V1::GetContactRequest, ::Google::Cloud::EssentialContacts::V1::Contact
45
+ # Deletes a contact.
46
+ rpc :DeleteContact, ::Google::Cloud::EssentialContacts::V1::DeleteContactRequest, ::Google::Protobuf::Empty
47
+ # Lists all contacts for the resource that are subscribed to the
48
+ # specified notification categories, including contacts inherited from
49
+ # any parent resources.
50
+ rpc :ComputeContacts, ::Google::Cloud::EssentialContacts::V1::ComputeContactsRequest, ::Google::Cloud::EssentialContacts::V1::ComputeContactsResponse
51
+ # Allows a contact admin to send a test message to contact to verify that it
52
+ # has been configured correctly.
53
+ rpc :SendTestMessage, ::Google::Cloud::EssentialContacts::V1::SendTestMessageRequest, ::Google::Protobuf::Empty
54
+ end
55
+
56
+ Stub = Service.rpc_stub_class
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,4 @@
1
+ # Essential Contacts V1 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,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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
+ end
64
+ end
65
+ end