google-cloud-service_management-v1 0.3.6 → 0.3.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08670dcd2436bd5ca038f3642bf032428700c9710456d0454d6e0a042c99d746'
4
- data.tar.gz: 1a200a5d2a56cd10c2b9c55f92d63349512bdca63b93f67456af50edfcd1263e
3
+ metadata.gz: ec1222d9da72a94e95e79259fb66d969809d0df642ee30d0d818c7efa6fe1a22
4
+ data.tar.gz: d5675736c700851350a5c1dd50c2f61e275fb5f9dd2393f777995e85ac4f9be1
5
5
  SHA512:
6
- metadata.gz: 86792cc0240a868dad3564ad3f0b1102a106a7032990732b95763458e0bbbd661efbea6d25573138f961681c3f00b3bfe4188948cd0c9c2ce5d59ead8720d8ff
7
- data.tar.gz: 997c0cc69166353387d8cece94783a7161f69af48ac1c319853cfb8c005f237547a9aff599a9055b737220d941e86f501ec1e514237241740b38ec102807b7b6
6
+ metadata.gz: e9f25db1c9c234205b1d0d2b728736b80978fd441dea5efd502b64a7aeb8b274469ea46a9a17f64a450222ea72b30e145ca4816308a091e8cddbda0dcb126be6
7
+ data.tar.gz: 49ef15b4c801f448342a0cf0d96e962a41d1ae5614dc356d0037224331c400891c943fedaf9cae609a202f356fdc2b8e65f05f77d1302a26d4e1aa15de6a6246
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title="Service Management API V1 API"
2
+ --title="Service Management V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # Ruby Client for the Service Management API V1 API
1
+ # Ruby Client for the Service Management V1 API
2
2
 
3
- API Client library for the Service Management API V1 API
3
+ API Client library for the Service Management V1 API
4
4
 
5
5
  Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers.
6
6
 
7
7
  https://github.com/googleapis/google-cloud-ruby
8
8
 
9
9
  This gem is a _versioned_ client. It provides basic client classes for a
10
- specific version of the Service Management API V1 API. Most users should consider using
10
+ specific version of the Service Management V1 API. Most users should consider using
11
11
  the main client gem,
12
12
  [google-cloud-service_management](https://rubygems.org/gems/google-cloud-service_management).
13
13
  See the section below titled *Which client should I use?* for more information.
@@ -37,7 +37,7 @@ request = ::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new # (req
37
37
  response = client.list_services request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-service_management-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_management-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/service-infrastructure/docs/overview/)
@@ -1,17 +1,9 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/api/servicemanagement/v1/resources.proto
3
3
 
4
- require 'google/api/annotations_pb'
5
4
  require 'google/api/config_change_pb'
6
5
  require 'google/api/field_behavior_pb'
7
- require 'google/api/metric_pb'
8
- require 'google/api/quota_pb'
9
- require 'google/api/service_pb'
10
- require 'google/longrunning/operations_pb'
11
- require 'google/protobuf/any_pb'
12
- require 'google/protobuf/field_mask_pb'
13
6
  require 'google/protobuf/timestamp_pb'
14
- require 'google/rpc/status_pb'
15
7
  require 'google/protobuf'
16
8
 
17
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
@@ -8,8 +8,6 @@ require 'google/api/service_pb'
8
8
  require 'google/api/servicemanagement/v1/resources_pb'
9
9
  require 'google/longrunning/operations_pb'
10
10
  require 'google/protobuf/any_pb'
11
- require 'google/protobuf/field_mask_pb'
12
- require 'google/rpc/status_pb'
13
11
  require 'google/protobuf'
14
12
 
15
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
@@ -87,18 +85,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
87
85
  optional :service_name, :string, 1
88
86
  optional :rollout_id, :string, 2
89
87
  end
90
- add_message "google.api.servicemanagement.v1.EnableServiceRequest" do
91
- optional :service_name, :string, 1
92
- optional :consumer_id, :string, 2
93
- end
94
- add_message "google.api.servicemanagement.v1.EnableServiceResponse" do
95
- end
96
- add_message "google.api.servicemanagement.v1.DisableServiceRequest" do
97
- optional :service_name, :string, 1
98
- optional :consumer_id, :string, 2
99
- end
100
- add_message "google.api.servicemanagement.v1.DisableServiceResponse" do
101
- end
102
88
  add_message "google.api.servicemanagement.v1.GenerateConfigReportRequest" do
103
89
  optional :new_config, :message, 1, "google.protobuf.Any"
104
90
  optional :old_config, :message, 2, "google.protobuf.Any"
@@ -134,10 +120,6 @@ module Google
134
120
  ListServiceRolloutsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceRolloutsRequest").msgclass
135
121
  ListServiceRolloutsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceRolloutsResponse").msgclass
136
122
  GetServiceRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceRolloutRequest").msgclass
137
- EnableServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.EnableServiceRequest").msgclass
138
- EnableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.EnableServiceResponse").msgclass
139
- DisableServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.DisableServiceRequest").msgclass
140
- DisableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.DisableServiceResponse").msgclass
141
123
  GenerateConfigReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GenerateConfigReportRequest").msgclass
142
124
  GenerateConfigReportResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GenerateConfigReportResponse").msgclass
143
125
  end
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/api/servicemanagement/v1/servicemanager.proto for package 'Google.Cloud.ServiceManagement.V1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2022 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -24,7 +24,8 @@ module Google
24
24
  module ServiceManagement
25
25
  module V1
26
26
  module ServiceManager
27
- # [Google Service Management API](https://cloud.google.com/service-management/overview)
27
+ # [Google Service Management
28
+ # API](https://cloud.google.com/service-infrastructure/docs/overview)
28
29
  class Service
29
30
 
30
31
  include ::GRPC::GenericService
@@ -38,23 +39,28 @@ module Google
38
39
  # Returns all public services. For authenticated users, also returns all
39
40
  # services the calling user has "servicemanagement.services.get" permission
40
41
  # for.
41
- #
42
- # **BETA:** If the caller specifies the `consumer_id`, it returns only the
43
- # services enabled on the consumer. The `consumer_id` must have the format
44
- # of "project:{PROJECT-ID}".
45
42
  rpc :ListServices, ::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Google::Cloud::ServiceManagement::V1::ListServicesResponse
46
43
  # Gets a managed service. Authentication is required unless the service is
47
44
  # public.
48
45
  rpc :GetService, ::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Google::Cloud::ServiceManagement::V1::ManagedService
49
46
  # Creates a new managed service.
50
- # Please note one producer project can own no more than 20 services.
47
+ #
48
+ # A managed service is immutable, and is subject to mandatory 30-day
49
+ # data retention. You cannot move a service or recreate it within 30 days
50
+ # after deletion.
51
+ #
52
+ # One producer project can own no more than 500 services. For security and
53
+ # reliability purposes, a production service should be hosted in a
54
+ # dedicated producer project.
51
55
  #
52
56
  # Operation<response: ManagedService>
53
57
  rpc :CreateService, ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Google::Longrunning::Operation
54
58
  # Deletes a managed service. This method will change the service to the
55
59
  # `Soft-Delete` state for 30 days. Within this period, service producers may
56
- # call [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] to restore the service.
57
- # After 30 days, the service will be permanently deleted.
60
+ # call
61
+ # [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService]
62
+ # to restore the service. After 30 days, the service will be permanently
63
+ # deleted.
58
64
  #
59
65
  # Operation<response: google.protobuf.Empty>
60
66
  rpc :DeleteService, ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Google::Longrunning::Operation
@@ -85,7 +91,8 @@ module Google
85
91
  # Specification). This method stores the source configurations as well as the
86
92
  # generated service configuration. To rollout the service configuration to
87
93
  # other services,
88
- # please call [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout].
94
+ # please call
95
+ # [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout].
89
96
  #
90
97
  # Only the 100 most recent configuration sources and ones referenced by
91
98
  # existing service configurtions are kept for each service. The rest will be
@@ -96,7 +103,8 @@ module Google
96
103
  # Lists the history of the service configuration rollouts for a managed
97
104
  # service, from the newest to the oldest.
98
105
  rpc :ListServiceRollouts, ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse
99
- # Gets a service configuration [rollout][google.api.servicemanagement.v1.Rollout].
106
+ # Gets a service configuration
107
+ # [rollout][google.api.servicemanagement.v1.Rollout].
100
108
  rpc :GetServiceRollout, ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Google::Cloud::ServiceManagement::V1::Rollout
101
109
  # Creates a new service configuration rollout. Based on rollout, the
102
110
  # Google Service Management will roll out the service configurations to
@@ -125,19 +133,6 @@ module Google
125
133
  # will compare GenerateConfigReportRequest.new_value with the last pushed
126
134
  # service configuration.
127
135
  rpc :GenerateConfigReport, ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse
128
- # Enables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can be used
129
- # for the project. See
130
- # [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for
131
- # more information.
132
- #
133
- # Operation<response: EnableServiceResponse>
134
- rpc :EnableService, ::Google::Cloud::ServiceManagement::V1::EnableServiceRequest, ::Google::Longrunning::Operation
135
- # Disables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can no longer be
136
- # be used for the project. It prevents accidental usage that may cause
137
- # unexpected billing charges or security leaks.
138
- #
139
- # Operation<response: DisableServiceResponse>
140
- rpc :DisableService, ::Google::Cloud::ServiceManagement::V1::DisableServiceRequest, ::Google::Longrunning::Operation
141
136
  end
142
137
 
143
138
  Stub = Service.rpc_stub_class
@@ -27,7 +27,8 @@ module Google
27
27
  ##
28
28
  # Client for the ServiceManager service.
29
29
  #
30
- # [Google Service Management API](https://cloud.google.com/service-management/overview)
30
+ # [Google Service Management
31
+ # API](https://cloud.google.com/service-infrastructure/docs/overview)
31
32
  #
32
33
  class Client
33
34
  # @private
@@ -62,6 +63,8 @@ module Google
62
63
  end
63
64
  default_config = Client::Configuration.new parent_config
64
65
 
66
+ default_config.timeout = 10.0
67
+
65
68
  default_config
66
69
  end
67
70
  yield @configure if block_given?
@@ -162,10 +165,6 @@ module Google
162
165
  # services the calling user has "servicemanagement.services.get" permission
163
166
  # for.
164
167
  #
165
- # **BETA:** If the caller specifies the `consumer_id`, it returns only the
166
- # services enabled on the consumer. The `consumer_id` must have the format
167
- # of "project:\\{PROJECT-ID}".
168
- #
169
168
  # @overload list_services(request, options = nil)
170
169
  # Pass arguments to `list_services` via a request object, either of type
171
170
  # {::Google::Cloud::ServiceManagement::V1::ListServicesRequest} or an equivalent Hash.
@@ -279,8 +278,8 @@ module Google
279
278
  # the default parameter values, pass an empty Hash as a request object (see above).
280
279
  #
281
280
  # @param service_name [::String]
282
- # Required. The name of the service. See the `ServiceManager` overview for naming
283
- # requirements. For example: `example.googleapis.com`.
281
+ # Required. The name of the service. See the `ServiceManager` overview for
282
+ # naming requirements. For example: `example.googleapis.com`.
284
283
  #
285
284
  # @yield [response, operation] Access the result along with the RPC operation
286
285
  # @yieldparam response [::Google::Cloud::ServiceManagement::V1::ManagedService]
@@ -348,7 +347,14 @@ module Google
348
347
 
349
348
  ##
350
349
  # Creates a new managed service.
351
- # Please note one producer project can own no more than 20 services.
350
+ #
351
+ # A managed service is immutable, and is subject to mandatory 30-day
352
+ # data retention. You cannot move a service or recreate it within 30 days
353
+ # after deletion.
354
+ #
355
+ # One producer project can own no more than 500 services. For security and
356
+ # reliability purposes, a production service should be hosted in a
357
+ # dedicated producer project.
352
358
  #
353
359
  # Operation<response: ManagedService>
354
360
  #
@@ -437,8 +443,10 @@ module Google
437
443
  ##
438
444
  # Deletes a managed service. This method will change the service to the
439
445
  # `Soft-Delete` state for 30 days. Within this period, service producers may
440
- # call {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service UndeleteService} to restore the service.
441
- # After 30 days, the service will be permanently deleted.
446
+ # call
447
+ # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service UndeleteService}
448
+ # to restore the service. After 30 days, the service will be permanently
449
+ # deleted.
442
450
  #
443
451
  # Operation<response: google.protobuf.Empty>
444
452
  #
@@ -458,8 +466,9 @@ module Google
458
466
  # the default parameter values, pass an empty Hash as a request object (see above).
459
467
  #
460
468
  # @param service_name [::String]
461
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
462
- # for naming requirements. For example: `example.googleapis.com`.
469
+ # Required. The name of the service. See the
470
+ # [overview](/service-management/overview) for naming requirements. For
471
+ # example: `example.googleapis.com`.
463
472
  #
464
473
  # @yield [response, operation] Access the result along with the RPC operation
465
474
  # @yieldparam response [::Gapic::Operation]
@@ -557,8 +566,9 @@ module Google
557
566
  # the default parameter values, pass an empty Hash as a request object (see above).
558
567
  #
559
568
  # @param service_name [::String]
560
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
561
- # for naming requirements. For example: `example.googleapis.com`.
569
+ # Required. The name of the service. See the
570
+ # [overview](/service-management/overview) for naming requirements. For
571
+ # example: `example.googleapis.com`.
562
572
  #
563
573
  # @yield [response, operation] Access the result along with the RPC operation
564
574
  # @yieldparam response [::Gapic::Operation]
@@ -652,8 +662,9 @@ module Google
652
662
  # the default parameter values, pass an empty Hash as a request object (see above).
653
663
  #
654
664
  # @param service_name [::String]
655
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
656
- # for naming requirements. For example: `example.googleapis.com`.
665
+ # Required. The name of the service. See the
666
+ # [overview](/service-management/overview) for naming requirements. For
667
+ # example: `example.googleapis.com`.
657
668
  # @param page_token [::String]
658
669
  # The token of the page to retrieve.
659
670
  # @param page_size [::Integer]
@@ -750,8 +761,9 @@ module Google
750
761
  # the default parameter values, pass an empty Hash as a request object (see above).
751
762
  #
752
763
  # @param service_name [::String]
753
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
754
- # for naming requirements. For example: `example.googleapis.com`.
764
+ # Required. The name of the service. See the
765
+ # [overview](/service-management/overview) for naming requirements. For
766
+ # example: `example.googleapis.com`.
755
767
  # @param config_id [::String]
756
768
  # Required. The id of the service configuration resource.
757
769
  #
@@ -854,8 +866,9 @@ module Google
854
866
  # the default parameter values, pass an empty Hash as a request object (see above).
855
867
  #
856
868
  # @param service_name [::String]
857
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
858
- # for naming requirements. For example: `example.googleapis.com`.
869
+ # Required. The name of the service. See the
870
+ # [overview](/service-management/overview) for naming requirements. For
871
+ # example: `example.googleapis.com`.
859
872
  # @param service_config [::Google::Api::Service, ::Hash]
860
873
  # Required. The service configuration resource.
861
874
  #
@@ -930,7 +943,8 @@ module Google
930
943
  # Specification). This method stores the source configurations as well as the
931
944
  # generated service configuration. To rollout the service configuration to
932
945
  # other services,
933
- # please call {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout CreateServiceRollout}.
946
+ # please call
947
+ # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout CreateServiceRollout}.
934
948
  #
935
949
  # Only the 100 most recent configuration sources and ones referenced by
936
950
  # existing service configurtions are kept for each service. The rest will be
@@ -954,8 +968,9 @@ module Google
954
968
  # the default parameter values, pass an empty Hash as a request object (see above).
955
969
  #
956
970
  # @param service_name [::String]
957
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
958
- # for naming requirements. For example: `example.googleapis.com`.
971
+ # Required. The name of the service. See the
972
+ # [overview](/service-management/overview) for naming requirements. For
973
+ # example: `example.googleapis.com`.
959
974
  # @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash]
960
975
  # Required. The source configuration for the service.
961
976
  # @param validate_only [::Boolean]
@@ -1055,8 +1070,9 @@ module Google
1055
1070
  # the default parameter values, pass an empty Hash as a request object (see above).
1056
1071
  #
1057
1072
  # @param service_name [::String]
1058
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
1059
- # for naming requirements. For example: `example.googleapis.com`.
1073
+ # Required. The name of the service. See the
1074
+ # [overview](/service-management/overview) for naming requirements. For
1075
+ # example: `example.googleapis.com`.
1060
1076
  # @param page_token [::String]
1061
1077
  # The token of the page to retrieve.
1062
1078
  # @param page_size [::Integer]
@@ -1144,7 +1160,8 @@ module Google
1144
1160
  end
1145
1161
 
1146
1162
  ##
1147
- # Gets a service configuration {::Google::Cloud::ServiceManagement::V1::Rollout rollout}.
1163
+ # Gets a service configuration
1164
+ # {::Google::Cloud::ServiceManagement::V1::Rollout rollout}.
1148
1165
  #
1149
1166
  # @overload get_service_rollout(request, options = nil)
1150
1167
  # Pass arguments to `get_service_rollout` via a request object, either of type
@@ -1162,8 +1179,9 @@ module Google
1162
1179
  # the default parameter values, pass an empty Hash as a request object (see above).
1163
1180
  #
1164
1181
  # @param service_name [::String]
1165
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
1166
- # for naming requirements. For example: `example.googleapis.com`.
1182
+ # Required. The name of the service. See the
1183
+ # [overview](/service-management/overview) for naming requirements. For
1184
+ # example: `example.googleapis.com`.
1167
1185
  # @param rollout_id [::String]
1168
1186
  # Required. The id of the rollout resource.
1169
1187
  #
@@ -1266,8 +1284,9 @@ module Google
1266
1284
  # the default parameter values, pass an empty Hash as a request object (see above).
1267
1285
  #
1268
1286
  # @param service_name [::String]
1269
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
1270
- # for naming requirements. For example: `example.googleapis.com`.
1287
+ # Required. The name of the service. See the
1288
+ # [overview](/service-management/overview) for naming requirements. For
1289
+ # example: `example.googleapis.com`.
1271
1290
  # @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash]
1272
1291
  # Required. The rollout resource. The `service_name` field is output only.
1273
1292
  #
@@ -1440,227 +1459,6 @@ module Google
1440
1459
  raise ::Google::Cloud::Error.from_error(e)
1441
1460
  end
1442
1461
 
1443
- ##
1444
- # Enables a {::Google::Cloud::ServiceManagement::V1::ManagedService service} for a project, so it can be used
1445
- # for the project. See
1446
- # [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for
1447
- # more information.
1448
- #
1449
- # Operation<response: EnableServiceResponse>
1450
- #
1451
- # @deprecated This method is deprecated and may be removed in the next major version update.
1452
- #
1453
- # @overload enable_service(request, options = nil)
1454
- # Pass arguments to `enable_service` via a request object, either of type
1455
- # {::Google::Cloud::ServiceManagement::V1::EnableServiceRequest} or an equivalent Hash.
1456
- #
1457
- # @param request [::Google::Cloud::ServiceManagement::V1::EnableServiceRequest, ::Hash]
1458
- # A request object representing the call parameters. Required. To specify no
1459
- # parameters, or to keep all the default parameter values, pass an empty Hash.
1460
- # @param options [::Gapic::CallOptions, ::Hash]
1461
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1462
- #
1463
- # @overload enable_service(service_name: nil, consumer_id: nil)
1464
- # Pass arguments to `enable_service` via keyword arguments. Note that at
1465
- # least one keyword argument is required. To specify no parameters, or to keep all
1466
- # the default parameter values, pass an empty Hash as a request object (see above).
1467
- #
1468
- # @param service_name [::String]
1469
- # Required. Name of the service to enable. Specifying an unknown service name will
1470
- # cause the request to fail.
1471
- # @param consumer_id [::String]
1472
- # Required. The identity of consumer resource which service enablement will be
1473
- # applied to.
1474
- #
1475
- # The Google Service Management implementation accepts the following
1476
- # forms:
1477
- # - "project:<project_id>"
1478
- #
1479
- # Note: this is made compatible with
1480
- # google.api.servicecontrol.v1.Operation.consumer_id.
1481
- #
1482
- # @yield [response, operation] Access the result along with the RPC operation
1483
- # @yieldparam response [::Gapic::Operation]
1484
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
1485
- #
1486
- # @return [::Gapic::Operation]
1487
- #
1488
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
1489
- #
1490
- # @example Basic example
1491
- # require "google/cloud/service_management/v1"
1492
- #
1493
- # # Create a client object. The client can be reused for multiple calls.
1494
- # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new
1495
- #
1496
- # # Create a request. To set request fields, pass in keyword arguments.
1497
- # request = Google::Cloud::ServiceManagement::V1::EnableServiceRequest.new
1498
- #
1499
- # # Call the enable_service method.
1500
- # result = client.enable_service request
1501
- #
1502
- # # The returned object is of type Gapic::Operation. You can use this
1503
- # # object to check the status of an operation, cancel it, or wait
1504
- # # for results. Here is how to block until completion:
1505
- # result.wait_until_done! timeout: 60
1506
- # if result.response?
1507
- # p result.response
1508
- # else
1509
- # puts "Error!"
1510
- # end
1511
- #
1512
- def enable_service request, options = nil
1513
- raise ::ArgumentError, "request must be provided" if request.nil?
1514
-
1515
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::EnableServiceRequest
1516
-
1517
- # Converts hash and nil to an options object
1518
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1519
-
1520
- # Customize the options with defaults
1521
- metadata = @config.rpcs.enable_service.metadata.to_h
1522
-
1523
- # Set x-goog-api-client and x-goog-user-project headers
1524
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1525
- lib_name: @config.lib_name, lib_version: @config.lib_version,
1526
- gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION
1527
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1528
-
1529
- header_params = {}
1530
- if request.service_name
1531
- header_params["service_name"] = request.service_name
1532
- end
1533
-
1534
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1535
- metadata[:"x-goog-request-params"] ||= request_params_header
1536
-
1537
- options.apply_defaults timeout: @config.rpcs.enable_service.timeout,
1538
- metadata: metadata,
1539
- retry_policy: @config.rpcs.enable_service.retry_policy
1540
-
1541
- options.apply_defaults timeout: @config.timeout,
1542
- metadata: @config.metadata,
1543
- retry_policy: @config.retry_policy
1544
-
1545
- @service_manager_stub.call_rpc :enable_service, request, options: options do |response, operation|
1546
- response = ::Gapic::Operation.new response, @operations_client, options: options
1547
- yield response, operation if block_given?
1548
- return response
1549
- end
1550
- rescue ::GRPC::BadStatus => e
1551
- raise ::Google::Cloud::Error.from_error(e)
1552
- end
1553
-
1554
- ##
1555
- # Disables a {::Google::Cloud::ServiceManagement::V1::ManagedService service} for a project, so it can no longer be
1556
- # be used for the project. It prevents accidental usage that may cause
1557
- # unexpected billing charges or security leaks.
1558
- #
1559
- # Operation<response: DisableServiceResponse>
1560
- #
1561
- # @deprecated This method is deprecated and may be removed in the next major version update.
1562
- #
1563
- # @overload disable_service(request, options = nil)
1564
- # Pass arguments to `disable_service` via a request object, either of type
1565
- # {::Google::Cloud::ServiceManagement::V1::DisableServiceRequest} or an equivalent Hash.
1566
- #
1567
- # @param request [::Google::Cloud::ServiceManagement::V1::DisableServiceRequest, ::Hash]
1568
- # A request object representing the call parameters. Required. To specify no
1569
- # parameters, or to keep all the default parameter values, pass an empty Hash.
1570
- # @param options [::Gapic::CallOptions, ::Hash]
1571
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1572
- #
1573
- # @overload disable_service(service_name: nil, consumer_id: nil)
1574
- # Pass arguments to `disable_service` via keyword arguments. Note that at
1575
- # least one keyword argument is required. To specify no parameters, or to keep all
1576
- # the default parameter values, pass an empty Hash as a request object (see above).
1577
- #
1578
- # @param service_name [::String]
1579
- # Required. Name of the service to disable. Specifying an unknown service name
1580
- # will cause the request to fail.
1581
- # @param consumer_id [::String]
1582
- # Required. The identity of consumer resource which service disablement will be
1583
- # applied to.
1584
- #
1585
- # The Google Service Management implementation accepts the following
1586
- # forms:
1587
- # - "project:<project_id>"
1588
- #
1589
- # Note: this is made compatible with
1590
- # google.api.servicecontrol.v1.Operation.consumer_id.
1591
- #
1592
- # @yield [response, operation] Access the result along with the RPC operation
1593
- # @yieldparam response [::Gapic::Operation]
1594
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
1595
- #
1596
- # @return [::Gapic::Operation]
1597
- #
1598
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
1599
- #
1600
- # @example Basic example
1601
- # require "google/cloud/service_management/v1"
1602
- #
1603
- # # Create a client object. The client can be reused for multiple calls.
1604
- # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new
1605
- #
1606
- # # Create a request. To set request fields, pass in keyword arguments.
1607
- # request = Google::Cloud::ServiceManagement::V1::DisableServiceRequest.new
1608
- #
1609
- # # Call the disable_service method.
1610
- # result = client.disable_service request
1611
- #
1612
- # # The returned object is of type Gapic::Operation. You can use this
1613
- # # object to check the status of an operation, cancel it, or wait
1614
- # # for results. Here is how to block until completion:
1615
- # result.wait_until_done! timeout: 60
1616
- # if result.response?
1617
- # p result.response
1618
- # else
1619
- # puts "Error!"
1620
- # end
1621
- #
1622
- def disable_service request, options = nil
1623
- raise ::ArgumentError, "request must be provided" if request.nil?
1624
-
1625
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DisableServiceRequest
1626
-
1627
- # Converts hash and nil to an options object
1628
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1629
-
1630
- # Customize the options with defaults
1631
- metadata = @config.rpcs.disable_service.metadata.to_h
1632
-
1633
- # Set x-goog-api-client and x-goog-user-project headers
1634
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1635
- lib_name: @config.lib_name, lib_version: @config.lib_version,
1636
- gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION
1637
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1638
-
1639
- header_params = {}
1640
- if request.service_name
1641
- header_params["service_name"] = request.service_name
1642
- end
1643
-
1644
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1645
- metadata[:"x-goog-request-params"] ||= request_params_header
1646
-
1647
- options.apply_defaults timeout: @config.rpcs.disable_service.timeout,
1648
- metadata: metadata,
1649
- retry_policy: @config.rpcs.disable_service.retry_policy
1650
-
1651
- options.apply_defaults timeout: @config.timeout,
1652
- metadata: @config.metadata,
1653
- retry_policy: @config.retry_policy
1654
-
1655
- @service_manager_stub.call_rpc :disable_service, request, options: options do |response, operation|
1656
- response = ::Gapic::Operation.new response, @operations_client, options: options
1657
- yield response, operation if block_given?
1658
- return response
1659
- end
1660
- rescue ::GRPC::BadStatus => e
1661
- raise ::Google::Cloud::Error.from_error(e)
1662
- end
1663
-
1664
1462
  ##
1665
1463
  # Configuration class for the ServiceManager API.
1666
1464
  #
@@ -1861,16 +1659,6 @@ module Google
1861
1659
  # @return [::Gapic::Config::Method]
1862
1660
  #
1863
1661
  attr_reader :generate_config_report
1864
- ##
1865
- # RPC-specific configuration for `enable_service`
1866
- # @return [::Gapic::Config::Method]
1867
- #
1868
- attr_reader :enable_service
1869
- ##
1870
- # RPC-specific configuration for `disable_service`
1871
- # @return [::Gapic::Config::Method]
1872
- #
1873
- attr_reader :disable_service
1874
1662
 
1875
1663
  # @private
1876
1664
  def initialize parent_rpcs = nil
@@ -1900,10 +1688,6 @@ module Google
1900
1688
  @create_service_rollout = ::Gapic::Config::Method.new create_service_rollout_config
1901
1689
  generate_config_report_config = parent_rpcs.generate_config_report if parent_rpcs.respond_to? :generate_config_report
1902
1690
  @generate_config_report = ::Gapic::Config::Method.new generate_config_report_config
1903
- enable_service_config = parent_rpcs.enable_service if parent_rpcs.respond_to? :enable_service
1904
- @enable_service = ::Gapic::Config::Method.new enable_service_config
1905
- disable_service_config = parent_rpcs.disable_service if parent_rpcs.respond_to? :disable_service
1906
- @disable_service = ::Gapic::Config::Method.new disable_service_config
1907
1691
 
1908
1692
  yield self if block_given?
1909
1693
  end
@@ -31,7 +31,8 @@ module Google
31
31
  module ServiceManagement
32
32
  module V1
33
33
  ##
34
- # [Google Service Management API](https://cloud.google.com/service-management/overview)
34
+ # [Google Service Management
35
+ # API](https://cloud.google.com/service-infrastructure/docs/overview)
35
36
  #
36
37
  # To load this service and instantiate a client:
37
38
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module ServiceManagement
23
23
  module V1
24
- VERSION = "0.3.6"
24
+ VERSION = "0.3.9"
25
25
  end
26
26
  end
27
27
  end
@@ -25,6 +25,8 @@ module Google
25
25
  ##
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
+ # @example
29
+ #
28
30
  # require "google/cloud/service_management/v1"
29
31
  # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new
30
32
  #
data/proto_docs/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Service Management API V1 Protocol Buffer Documentation
1
+ # Service Management V1 Protocol Buffer Documentation
2
2
 
3
3
  These files are for the YARD documentation of the generated protobuf files.
4
4
  They are not intended to be required or loaded at runtime.
@@ -25,7 +25,8 @@ module Google
25
25
  # Google Service Management.
26
26
  # @!attribute [rw] service_name
27
27
  # @return [::String]
28
- # The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
28
+ # The name of the service. See the
29
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview)
29
30
  # for naming requirements.
30
31
  # @!attribute [rw] producer_project_id
31
32
  # @return [::String]
@@ -204,8 +205,9 @@ module Google
204
205
  # service config, and then create a Rollout to push the service config.
205
206
  # @!attribute [rw] rollout_id
206
207
  # @return [::String]
207
- # Optional. Unique identifier of this Rollout. Must be no longer than 63 characters
208
- # and only lower case letters, digits, '.', '_' and '-' are allowed.
208
+ # Optional. Unique identifier of this Rollout. Must be no longer than 63
209
+ # characters and only lower case letters, digits, '.', '_' and '-' are
210
+ # allowed.
209
211
  #
210
212
  # If not specified by client, the server will generate one. The generated id
211
213
  # will have the form of <date><revision number>, where "date" is the create
@@ -60,8 +60,8 @@ module Google
60
60
  # Request message for `GetService` method.
61
61
  # @!attribute [rw] service_name
62
62
  # @return [::String]
63
- # Required. The name of the service. See the `ServiceManager` overview for naming
64
- # requirements. For example: `example.googleapis.com`.
63
+ # Required. The name of the service. See the `ServiceManager` overview for
64
+ # naming requirements. For example: `example.googleapis.com`.
65
65
  class GetServiceRequest
66
66
  include ::Google::Protobuf::MessageExts
67
67
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -79,8 +79,9 @@ module Google
79
79
  # Request message for DeleteService method.
80
80
  # @!attribute [rw] service_name
81
81
  # @return [::String]
82
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
83
- # for naming requirements. For example: `example.googleapis.com`.
82
+ # Required. The name of the service. See the
83
+ # [overview](/service-management/overview) for naming requirements. For
84
+ # example: `example.googleapis.com`.
84
85
  class DeleteServiceRequest
85
86
  include ::Google::Protobuf::MessageExts
86
87
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -89,8 +90,9 @@ module Google
89
90
  # Request message for UndeleteService method.
90
91
  # @!attribute [rw] service_name
91
92
  # @return [::String]
92
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
93
- # for naming requirements. For example: `example.googleapis.com`.
93
+ # Required. The name of the service. See the
94
+ # [overview](/service-management/overview) for naming requirements. For
95
+ # example: `example.googleapis.com`.
94
96
  class UndeleteServiceRequest
95
97
  include ::Google::Protobuf::MessageExts
96
98
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -108,8 +110,9 @@ module Google
108
110
  # Request message for GetServiceConfig method.
109
111
  # @!attribute [rw] service_name
110
112
  # @return [::String]
111
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
112
- # for naming requirements. For example: `example.googleapis.com`.
113
+ # Required. The name of the service. See the
114
+ # [overview](/service-management/overview) for naming requirements. For
115
+ # example: `example.googleapis.com`.
113
116
  # @!attribute [rw] config_id
114
117
  # @return [::String]
115
118
  # Required. The id of the service configuration resource.
@@ -139,8 +142,9 @@ module Google
139
142
  # Request message for ListServiceConfigs method.
140
143
  # @!attribute [rw] service_name
141
144
  # @return [::String]
142
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
143
- # for naming requirements. For example: `example.googleapis.com`.
145
+ # Required. The name of the service. See the
146
+ # [overview](/service-management/overview) for naming requirements. For
147
+ # example: `example.googleapis.com`.
144
148
  # @!attribute [rw] page_token
145
149
  # @return [::String]
146
150
  # The token of the page to retrieve.
@@ -168,8 +172,9 @@ module Google
168
172
  # Request message for CreateServiceConfig method.
169
173
  # @!attribute [rw] service_name
170
174
  # @return [::String]
171
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
172
- # for naming requirements. For example: `example.googleapis.com`.
175
+ # Required. The name of the service. See the
176
+ # [overview](/service-management/overview) for naming requirements. For
177
+ # example: `example.googleapis.com`.
173
178
  # @!attribute [rw] service_config
174
179
  # @return [::Google::Api::Service]
175
180
  # Required. The service configuration resource.
@@ -181,8 +186,9 @@ module Google
181
186
  # Request message for SubmitConfigSource method.
182
187
  # @!attribute [rw] service_name
183
188
  # @return [::String]
184
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
185
- # for naming requirements. For example: `example.googleapis.com`.
189
+ # Required. The name of the service. See the
190
+ # [overview](/service-management/overview) for naming requirements. For
191
+ # example: `example.googleapis.com`.
186
192
  # @!attribute [rw] config_source
187
193
  # @return [::Google::Cloud::ServiceManagement::V1::ConfigSource]
188
194
  # Required. The source configuration for the service.
@@ -208,8 +214,9 @@ module Google
208
214
  # Request message for 'CreateServiceRollout'
209
215
  # @!attribute [rw] service_name
210
216
  # @return [::String]
211
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
212
- # for naming requirements. For example: `example.googleapis.com`.
217
+ # Required. The name of the service. See the
218
+ # [overview](/service-management/overview) for naming requirements. For
219
+ # example: `example.googleapis.com`.
213
220
  # @!attribute [rw] rollout
214
221
  # @return [::Google::Cloud::ServiceManagement::V1::Rollout]
215
222
  # Required. The rollout resource. The `service_name` field is output only.
@@ -221,8 +228,9 @@ module Google
221
228
  # Request message for 'ListServiceRollouts'
222
229
  # @!attribute [rw] service_name
223
230
  # @return [::String]
224
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
225
- # for naming requirements. For example: `example.googleapis.com`.
231
+ # Required. The name of the service. See the
232
+ # [overview](/service-management/overview) for naming requirements. For
233
+ # example: `example.googleapis.com`.
226
234
  # @!attribute [rw] page_token
227
235
  # @return [::String]
228
236
  # The token of the page to retrieve.
@@ -260,8 +268,9 @@ module Google
260
268
  # Request message for GetServiceRollout method.
261
269
  # @!attribute [rw] service_name
262
270
  # @return [::String]
263
- # Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
264
- # for naming requirements. For example: `example.googleapis.com`.
271
+ # Required. The name of the service. See the
272
+ # [overview](/service-management/overview) for naming requirements. For
273
+ # example: `example.googleapis.com`.
265
274
  # @!attribute [rw] rollout_id
266
275
  # @return [::String]
267
276
  # Required. The id of the rollout resource.
@@ -270,60 +279,6 @@ module Google
270
279
  extend ::Google::Protobuf::MessageExts::ClassMethods
271
280
  end
272
281
 
273
- # Request message for EnableService method.
274
- # @!attribute [rw] service_name
275
- # @return [::String]
276
- # Required. Name of the service to enable. Specifying an unknown service name will
277
- # cause the request to fail.
278
- # @!attribute [rw] consumer_id
279
- # @return [::String]
280
- # Required. The identity of consumer resource which service enablement will be
281
- # applied to.
282
- #
283
- # The Google Service Management implementation accepts the following
284
- # forms:
285
- # - "project:<project_id>"
286
- #
287
- # Note: this is made compatible with
288
- # google.api.servicecontrol.v1.Operation.consumer_id.
289
- class EnableServiceRequest
290
- include ::Google::Protobuf::MessageExts
291
- extend ::Google::Protobuf::MessageExts::ClassMethods
292
- end
293
-
294
- # Operation payload for EnableService method.
295
- class EnableServiceResponse
296
- include ::Google::Protobuf::MessageExts
297
- extend ::Google::Protobuf::MessageExts::ClassMethods
298
- end
299
-
300
- # Request message for DisableService method.
301
- # @!attribute [rw] service_name
302
- # @return [::String]
303
- # Required. Name of the service to disable. Specifying an unknown service name
304
- # will cause the request to fail.
305
- # @!attribute [rw] consumer_id
306
- # @return [::String]
307
- # Required. The identity of consumer resource which service disablement will be
308
- # applied to.
309
- #
310
- # The Google Service Management implementation accepts the following
311
- # forms:
312
- # - "project:<project_id>"
313
- #
314
- # Note: this is made compatible with
315
- # google.api.servicecontrol.v1.Operation.consumer_id.
316
- class DisableServiceRequest
317
- include ::Google::Protobuf::MessageExts
318
- extend ::Google::Protobuf::MessageExts::ClassMethods
319
- end
320
-
321
- # Operation payload for DisableService method.
322
- class DisableServiceResponse
323
- include ::Google::Protobuf::MessageExts
324
- extend ::Google::Protobuf::MessageExts::ClassMethods
325
- end
326
-
327
282
  # Request message for GenerateConfigReport method.
328
283
  # @!attribute [rw] new_config
329
284
  # @return [::Google::Protobuf::Any]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-service_management-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2022-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -210,7 +210,6 @@ files:
210
210
  - proto_docs/google/protobuf/api.rb
211
211
  - proto_docs/google/protobuf/duration.rb
212
212
  - proto_docs/google/protobuf/empty.rb
213
- - proto_docs/google/protobuf/field_mask.rb
214
213
  - proto_docs/google/protobuf/source_context.rb
215
214
  - proto_docs/google/protobuf/struct.rb
216
215
  - proto_docs/google/protobuf/timestamp.rb
@@ -236,8 +235,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
235
  - !ruby/object:Gem::Version
237
236
  version: '0'
238
237
  requirements: []
239
- rubygems_version: 3.3.4
238
+ rubygems_version: 3.3.5
240
239
  signing_key:
241
240
  specification_version: 4
242
- summary: API Client library for the Service Management API V1 API
241
+ summary: API Client library for the Service Management V1 API
243
242
  test_files: []
@@ -1,229 +0,0 @@
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 Protobuf
22
- # `FieldMask` represents a set of symbolic field paths, for example:
23
- #
24
- # paths: "f.a"
25
- # paths: "f.b.d"
26
- #
27
- # Here `f` represents a field in some root message, `a` and `b`
28
- # fields in the message found in `f`, and `d` a field found in the
29
- # message in `f.b`.
30
- #
31
- # Field masks are used to specify a subset of fields that should be
32
- # returned by a get operation or modified by an update operation.
33
- # Field masks also have a custom JSON encoding (see below).
34
- #
35
- # # Field Masks in Projections
36
- #
37
- # When used in the context of a projection, a response message or
38
- # sub-message is filtered by the API to only contain those fields as
39
- # specified in the mask. For example, if the mask in the previous
40
- # example is applied to a response message as follows:
41
- #
42
- # f {
43
- # a : 22
44
- # b {
45
- # d : 1
46
- # x : 2
47
- # }
48
- # y : 13
49
- # }
50
- # z: 8
51
- #
52
- # The result will not contain specific values for fields x,y and z
53
- # (their value will be set to the default, and omitted in proto text
54
- # output):
55
- #
56
- #
57
- # f {
58
- # a : 22
59
- # b {
60
- # d : 1
61
- # }
62
- # }
63
- #
64
- # A repeated field is not allowed except at the last position of a
65
- # paths string.
66
- #
67
- # If a FieldMask object is not present in a get operation, the
68
- # operation applies to all fields (as if a FieldMask of all fields
69
- # had been specified).
70
- #
71
- # Note that a field mask does not necessarily apply to the
72
- # top-level response message. In case of a REST get operation, the
73
- # field mask applies directly to the response, but in case of a REST
74
- # list operation, the mask instead applies to each individual message
75
- # in the returned resource list. In case of a REST custom method,
76
- # other definitions may be used. Where the mask applies will be
77
- # clearly documented together with its declaration in the API. In
78
- # any case, the effect on the returned resource/resources is required
79
- # behavior for APIs.
80
- #
81
- # # Field Masks in Update Operations
82
- #
83
- # A field mask in update operations specifies which fields of the
84
- # targeted resource are going to be updated. The API is required
85
- # to only change the values of the fields as specified in the mask
86
- # and leave the others untouched. If a resource is passed in to
87
- # describe the updated values, the API ignores the values of all
88
- # fields not covered by the mask.
89
- #
90
- # If a repeated field is specified for an update operation, new values will
91
- # be appended to the existing repeated field in the target resource. Note that
92
- # a repeated field is only allowed in the last position of a `paths` string.
93
- #
94
- # If a sub-message is specified in the last position of the field mask for an
95
- # update operation, then new value will be merged into the existing sub-message
96
- # in the target resource.
97
- #
98
- # For example, given the target message:
99
- #
100
- # f {
101
- # b {
102
- # d: 1
103
- # x: 2
104
- # }
105
- # c: [1]
106
- # }
107
- #
108
- # And an update message:
109
- #
110
- # f {
111
- # b {
112
- # d: 10
113
- # }
114
- # c: [2]
115
- # }
116
- #
117
- # then if the field mask is:
118
- #
119
- # paths: ["f.b", "f.c"]
120
- #
121
- # then the result will be:
122
- #
123
- # f {
124
- # b {
125
- # d: 10
126
- # x: 2
127
- # }
128
- # c: [1, 2]
129
- # }
130
- #
131
- # An implementation may provide options to override this default behavior for
132
- # repeated and message fields.
133
- #
134
- # In order to reset a field's value to the default, the field must
135
- # be in the mask and set to the default value in the provided resource.
136
- # Hence, in order to reset all fields of a resource, provide a default
137
- # instance of the resource and set all fields in the mask, or do
138
- # not provide a mask as described below.
139
- #
140
- # If a field mask is not present on update, the operation applies to
141
- # all fields (as if a field mask of all fields has been specified).
142
- # Note that in the presence of schema evolution, this may mean that
143
- # fields the client does not know and has therefore not filled into
144
- # the request will be reset to their default. If this is unwanted
145
- # behavior, a specific service may require a client to always specify
146
- # a field mask, producing an error if not.
147
- #
148
- # As with get operations, the location of the resource which
149
- # describes the updated values in the request message depends on the
150
- # operation kind. In any case, the effect of the field mask is
151
- # required to be honored by the API.
152
- #
153
- # ## Considerations for HTTP REST
154
- #
155
- # The HTTP kind of an update operation which uses a field mask must
156
- # be set to PATCH instead of PUT in order to satisfy HTTP semantics
157
- # (PUT must only be used for full updates).
158
- #
159
- # # JSON Encoding of Field Masks
160
- #
161
- # In JSON, a field mask is encoded as a single string where paths are
162
- # separated by a comma. Fields name in each path are converted
163
- # to/from lower-camel naming conventions.
164
- #
165
- # As an example, consider the following message declarations:
166
- #
167
- # message Profile {
168
- # User user = 1;
169
- # Photo photo = 2;
170
- # }
171
- # message User {
172
- # string display_name = 1;
173
- # string address = 2;
174
- # }
175
- #
176
- # In proto a field mask for `Profile` may look as such:
177
- #
178
- # mask {
179
- # paths: "user.display_name"
180
- # paths: "photo"
181
- # }
182
- #
183
- # In JSON, the same mask is represented as below:
184
- #
185
- # {
186
- # mask: "user.displayName,photo"
187
- # }
188
- #
189
- # # Field Masks and Oneof Fields
190
- #
191
- # Field masks treat fields in oneofs just as regular fields. Consider the
192
- # following message:
193
- #
194
- # message SampleMessage {
195
- # oneof test_oneof {
196
- # string name = 4;
197
- # SubMessage sub_message = 9;
198
- # }
199
- # }
200
- #
201
- # The field mask can be:
202
- #
203
- # mask {
204
- # paths: "name"
205
- # }
206
- #
207
- # Or:
208
- #
209
- # mask {
210
- # paths: "sub_message"
211
- # }
212
- #
213
- # Note that oneof type names ("test_oneof" in this case) cannot be used in
214
- # paths.
215
- #
216
- # ## Field Mask Verification
217
- #
218
- # The implementation of any API method which has a FieldMask type field in the
219
- # request should verify the included field paths, and return an
220
- # `INVALID_ARGUMENT` error if any path is unmappable.
221
- # @!attribute [rw] paths
222
- # @return [::Array<::String>]
223
- # The set of field mask paths.
224
- class FieldMask
225
- include ::Google::Protobuf::MessageExts
226
- extend ::Google::Protobuf::MessageExts::ClassMethods
227
- end
228
- end
229
- end