google-cloud-compute-v1 3.8.0 → 3.9.0

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.
@@ -78,6 +78,8 @@ module Google
78
78
 
79
79
  default_config.rpcs.delete.timeout = 600.0
80
80
 
81
+ default_config.rpcs.delete_named_set.timeout = 600.0
82
+
81
83
  default_config.rpcs.delete_route_policy.timeout = 600.0
82
84
 
83
85
  default_config.rpcs.get.timeout = 600.0
@@ -85,6 +87,11 @@ module Google
85
87
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
88
  }
87
89
 
90
+ default_config.rpcs.get_named_set.timeout = 600.0
91
+ default_config.rpcs.get_named_set.retry_policy = {
92
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
93
+ }
94
+
88
95
  default_config.rpcs.get_nat_ip_info.timeout = 600.0
89
96
  default_config.rpcs.get_nat_ip_info.retry_policy = {
90
97
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
@@ -117,6 +124,11 @@ module Google
117
124
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
118
125
  }
119
126
 
127
+ default_config.rpcs.list_named_sets.timeout = 600.0
128
+ default_config.rpcs.list_named_sets.retry_policy = {
129
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
130
+ }
131
+
120
132
  default_config.rpcs.list_route_policies.timeout = 600.0
121
133
  default_config.rpcs.list_route_policies.retry_policy = {
122
134
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
@@ -124,12 +136,16 @@ module Google
124
136
 
125
137
  default_config.rpcs.patch.timeout = 600.0
126
138
 
139
+ default_config.rpcs.patch_named_set.timeout = 600.0
140
+
127
141
  default_config.rpcs.patch_route_policy.timeout = 600.0
128
142
 
129
143
  default_config.rpcs.preview.timeout = 600.0
130
144
 
131
145
  default_config.rpcs.update.timeout = 600.0
132
146
 
147
+ default_config.rpcs.update_named_set.timeout = 600.0
148
+
133
149
  default_config.rpcs.update_route_policy.timeout = 600.0
134
150
 
135
151
  default_config
@@ -538,6 +554,114 @@ module Google
538
554
  raise ::Google::Cloud::Error.from_error(e)
539
555
  end
540
556
 
557
+ ##
558
+ # Deletes Named Set
559
+ #
560
+ # @overload delete_named_set(request, options = nil)
561
+ # Pass arguments to `delete_named_set` via a request object, either of type
562
+ # {::Google::Cloud::Compute::V1::DeleteNamedSetRouterRequest} or an equivalent Hash.
563
+ #
564
+ # @param request [::Google::Cloud::Compute::V1::DeleteNamedSetRouterRequest, ::Hash]
565
+ # A request object representing the call parameters. Required. To specify no
566
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
567
+ # @param options [::Gapic::CallOptions, ::Hash]
568
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
569
+ #
570
+ # @overload delete_named_set(named_set: nil, project: nil, region: nil, request_id: nil, router: nil)
571
+ # Pass arguments to `delete_named_set` via keyword arguments. Note that at
572
+ # least one keyword argument is required. To specify no parameters, or to keep all
573
+ # the default parameter values, pass an empty Hash as a request object (see above).
574
+ #
575
+ # @param named_set [::String]
576
+ # The Named Set name for this request. Name must conform to RFC1035
577
+ # @param project [::String]
578
+ # Project ID for this request.
579
+ # @param region [::String]
580
+ # Name of the region for this request.
581
+ # @param request_id [::String]
582
+ # An optional request ID to identify requests. Specify a unique request ID so
583
+ # that if you must retry your request, the server will know to ignore the
584
+ # request if it has already been completed.
585
+ #
586
+ # For example, consider a situation where you make an initial request and
587
+ # the request times out. If you make the request again with the same
588
+ # request ID, the server can check if original operation with the same
589
+ # request ID was received, and if so, will ignore the second request. This
590
+ # prevents clients from accidentally creating duplicate commitments.
591
+ #
592
+ # The request ID must be
593
+ # a valid UUID with the exception that zero UUID is not supported
594
+ # (00000000-0000-0000-0000-000000000000).
595
+ # @param router [::String]
596
+ # Name of the Router resource where Named Set is defined.
597
+ # @yield [result, operation] Access the result along with the TransportOperation object
598
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
599
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
600
+ #
601
+ # @return [::Gapic::GenericLRO::Operation]
602
+ #
603
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
604
+ #
605
+ # @example Basic example
606
+ # require "google/cloud/compute/v1"
607
+ #
608
+ # # Create a client object. The client can be reused for multiple calls.
609
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
610
+ #
611
+ # # Create a request. To set request fields, pass in keyword arguments.
612
+ # request = Google::Cloud::Compute::V1::DeleteNamedSetRouterRequest.new
613
+ #
614
+ # # Call the delete_named_set method.
615
+ # result = client.delete_named_set request
616
+ #
617
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
618
+ # p result
619
+ #
620
+ def delete_named_set request, options = nil
621
+ raise ::ArgumentError, "request must be provided" if request.nil?
622
+
623
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteNamedSetRouterRequest
624
+
625
+ # Converts hash and nil to an options object
626
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
627
+
628
+ # Customize the options with defaults
629
+ call_metadata = @config.rpcs.delete_named_set.metadata.to_h
630
+
631
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
632
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
633
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
634
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
635
+ transports_version_send: [:rest]
636
+
637
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
638
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
639
+
640
+ options.apply_defaults timeout: @config.rpcs.delete_named_set.timeout,
641
+ metadata: call_metadata,
642
+ retry_policy: @config.rpcs.delete_named_set.retry_policy
643
+
644
+ options.apply_defaults timeout: @config.timeout,
645
+ metadata: @config.metadata,
646
+ retry_policy: @config.retry_policy
647
+
648
+ @routers_stub.delete_named_set request, options do |result, response|
649
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
650
+ operation: result,
651
+ client: region_operations,
652
+ request_values: {
653
+ "project" => request.project,
654
+ "region" => request.region
655
+ },
656
+ options: options
657
+ )
658
+ yield result, response if block_given?
659
+ throw :response, result
660
+ end
661
+ rescue ::Gapic::Rest::Error => e
662
+ raise ::Google::Cloud::Error.from_error(e)
663
+ end
664
+
541
665
  ##
542
666
  # Deletes Route Policy
543
667
  #
@@ -728,6 +852,91 @@ module Google
728
852
  raise ::Google::Cloud::Error.from_error(e)
729
853
  end
730
854
 
855
+ ##
856
+ # Returns specified Named Set
857
+ #
858
+ # @overload get_named_set(request, options = nil)
859
+ # Pass arguments to `get_named_set` via a request object, either of type
860
+ # {::Google::Cloud::Compute::V1::GetNamedSetRouterRequest} or an equivalent Hash.
861
+ #
862
+ # @param request [::Google::Cloud::Compute::V1::GetNamedSetRouterRequest, ::Hash]
863
+ # A request object representing the call parameters. Required. To specify no
864
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
865
+ # @param options [::Gapic::CallOptions, ::Hash]
866
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
867
+ #
868
+ # @overload get_named_set(named_set: nil, project: nil, region: nil, router: nil)
869
+ # Pass arguments to `get_named_set` via keyword arguments. Note that at
870
+ # least one keyword argument is required. To specify no parameters, or to keep all
871
+ # the default parameter values, pass an empty Hash as a request object (see above).
872
+ #
873
+ # @param named_set [::String]
874
+ # The Named Set name for this request. Name must conform to RFC1035
875
+ # @param project [::String]
876
+ # Project ID for this request.
877
+ # @param region [::String]
878
+ # Name of the region for this request.
879
+ # @param router [::String]
880
+ # Name of the Router resource to query for the named set. The name should
881
+ # conform to RFC1035.
882
+ # @yield [result, operation] Access the result along with the TransportOperation object
883
+ # @yieldparam result [::Google::Cloud::Compute::V1::RoutersGetNamedSetResponse]
884
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
885
+ #
886
+ # @return [::Google::Cloud::Compute::V1::RoutersGetNamedSetResponse]
887
+ #
888
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
889
+ #
890
+ # @example Basic example
891
+ # require "google/cloud/compute/v1"
892
+ #
893
+ # # Create a client object. The client can be reused for multiple calls.
894
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
895
+ #
896
+ # # Create a request. To set request fields, pass in keyword arguments.
897
+ # request = Google::Cloud::Compute::V1::GetNamedSetRouterRequest.new
898
+ #
899
+ # # Call the get_named_set method.
900
+ # result = client.get_named_set request
901
+ #
902
+ # # The returned object is of type Google::Cloud::Compute::V1::RoutersGetNamedSetResponse.
903
+ # p result
904
+ #
905
+ def get_named_set request, options = nil
906
+ raise ::ArgumentError, "request must be provided" if request.nil?
907
+
908
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetNamedSetRouterRequest
909
+
910
+ # Converts hash and nil to an options object
911
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
912
+
913
+ # Customize the options with defaults
914
+ call_metadata = @config.rpcs.get_named_set.metadata.to_h
915
+
916
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
917
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
918
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
919
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
920
+ transports_version_send: [:rest]
921
+
922
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
923
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
924
+
925
+ options.apply_defaults timeout: @config.rpcs.get_named_set.timeout,
926
+ metadata: call_metadata,
927
+ retry_policy: @config.rpcs.get_named_set.retry_policy
928
+
929
+ options.apply_defaults timeout: @config.timeout,
930
+ metadata: @config.metadata,
931
+ retry_policy: @config.retry_policy
932
+
933
+ @routers_stub.get_named_set request, options do |result, operation|
934
+ yield result, operation if block_given?
935
+ end
936
+ rescue ::Gapic::Rest::Error => e
937
+ raise ::Google::Cloud::Error.from_error(e)
938
+ end
939
+
731
940
  ##
732
941
  # Retrieves runtime NAT IP information.
733
942
  #
@@ -1624,6 +1833,180 @@ module Google
1624
1833
  raise ::Google::Cloud::Error.from_error(e)
1625
1834
  end
1626
1835
 
1836
+ ##
1837
+ # Retrieves a list of router named set subresources available to the
1838
+ # specified project.
1839
+ #
1840
+ # @overload list_named_sets(request, options = nil)
1841
+ # Pass arguments to `list_named_sets` via a request object, either of type
1842
+ # {::Google::Cloud::Compute::V1::ListNamedSetsRoutersRequest} or an equivalent Hash.
1843
+ #
1844
+ # @param request [::Google::Cloud::Compute::V1::ListNamedSetsRoutersRequest, ::Hash]
1845
+ # A request object representing the call parameters. Required. To specify no
1846
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1847
+ # @param options [::Gapic::CallOptions, ::Hash]
1848
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1849
+ #
1850
+ # @overload list_named_sets(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil, router: nil)
1851
+ # Pass arguments to `list_named_sets` via keyword arguments. Note that at
1852
+ # least one keyword argument is required. To specify no parameters, or to keep all
1853
+ # the default parameter values, pass an empty Hash as a request object (see above).
1854
+ #
1855
+ # @param filter [::String]
1856
+ # A filter expression that filters resources listed in the response. Most
1857
+ # Compute resources support two types of filter expressions:
1858
+ # expressions that support regular expressions and expressions that follow
1859
+ # API improvement proposal AIP-160.
1860
+ # These two types of filter expressions cannot be mixed in one request.
1861
+ #
1862
+ # If you want to use AIP-160, your expression must specify the field name, an
1863
+ # operator, and the value that you want to use for filtering. The value
1864
+ # must be a string, a number, or a boolean. The operator
1865
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
1866
+ #
1867
+ # For example, if you are filtering Compute Engine instances, you can
1868
+ # exclude instances named `example-instance` by specifying
1869
+ # `name != example-instance`.
1870
+ #
1871
+ # The `:*` comparison can be used to test whether a key has been defined.
1872
+ # For example, to find all objects with `owner` label use:
1873
+ # ```
1874
+ # labels.owner:*
1875
+ # ```
1876
+ #
1877
+ # You can also filter nested fields. For example, you could specify
1878
+ # `scheduling.automaticRestart = false` to include instances only
1879
+ # if they are not scheduled for automatic restarts. You can use filtering
1880
+ # on nested fields to filter based onresource labels.
1881
+ #
1882
+ # To filter on multiple expressions, provide each separate expression within
1883
+ # parentheses. For example:
1884
+ # ```
1885
+ # (scheduling.automaticRestart = true)
1886
+ # (cpuPlatform = "Intel Skylake")
1887
+ # ```
1888
+ # By default, each expression is an `AND` expression. However, you
1889
+ # can include `AND` and `OR` expressions explicitly.
1890
+ # For example:
1891
+ # ```
1892
+ # (cpuPlatform = "Intel Skylake") OR
1893
+ # (cpuPlatform = "Intel Broadwell") AND
1894
+ # (scheduling.automaticRestart = true)
1895
+ # ```
1896
+ #
1897
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
1898
+ # (not equal) operator against a single un-parenthesized expression with or
1899
+ # without quotes or against multiple parenthesized expressions. Examples:
1900
+ #
1901
+ # `fieldname eq unquoted literal`
1902
+ # `fieldname eq 'single quoted literal'`
1903
+ # `fieldname eq "double quoted literal"`
1904
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
1905
+ #
1906
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
1907
+ # The literal value must match the entire field.
1908
+ #
1909
+ # For example, to filter for instances that do not end with name "instance",
1910
+ # you would use `name ne .*instance`.
1911
+ #
1912
+ # You cannot combine constraints on multiple fields using regular
1913
+ # expressions.
1914
+ # @param max_results [::Integer]
1915
+ # The maximum number of results per page that should be returned.
1916
+ # If the number of available results is larger than `maxResults`,
1917
+ # Compute Engine returns a `nextPageToken` that can be used to get
1918
+ # the next page of results in subsequent list requests. Acceptable values are
1919
+ # `0` to `500`, inclusive. (Default: `500`)
1920
+ # @param order_by [::String]
1921
+ # Sorts list results by a certain order. By default, results
1922
+ # are returned in alphanumerical order based on the resource name.
1923
+ #
1924
+ # You can also sort results in descending order based on the creation
1925
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
1926
+ # results based on the `creationTimestamp` field in
1927
+ # reverse chronological order (newest result first). Use this to sort
1928
+ # resources like operations so that the newest operation is returned first.
1929
+ #
1930
+ # Currently, only sorting by `name` or
1931
+ # `creationTimestamp desc` is supported.
1932
+ # @param page_token [::String]
1933
+ # Specifies a page token to use. Set `pageToken` to the
1934
+ # `nextPageToken` returned by a previous list request to get
1935
+ # the next page of results.
1936
+ # @param project [::String]
1937
+ # Project ID for this request.
1938
+ # @param region [::String]
1939
+ # Name of the region for this request.
1940
+ # @param return_partial_success [::Boolean]
1941
+ # Opt-in for partial success behavior which provides partial results in case
1942
+ # of failure. The default value is false.
1943
+ #
1944
+ # For example, when partial success behavior is enabled, aggregatedList for a
1945
+ # single zone scope either returns all resources in the zone or no resources,
1946
+ # with an error code.
1947
+ # @param router [::String]
1948
+ # Name or id of the resource for this request.
1949
+ # Name should conform to RFC1035.
1950
+ # @yield [result, operation] Access the result along with the TransportOperation object
1951
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NamedSet>]
1952
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1953
+ #
1954
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::NamedSet>]
1955
+ #
1956
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1957
+ #
1958
+ # @example Basic example
1959
+ # require "google/cloud/compute/v1"
1960
+ #
1961
+ # # Create a client object. The client can be reused for multiple calls.
1962
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
1963
+ #
1964
+ # # Create a request. To set request fields, pass in keyword arguments.
1965
+ # request = Google::Cloud::Compute::V1::ListNamedSetsRoutersRequest.new
1966
+ #
1967
+ # # Call the list_named_sets method.
1968
+ # result = client.list_named_sets request
1969
+ #
1970
+ # # The returned object is of type Google::Cloud::Compute::V1::RoutersListNamedSets.
1971
+ # p result
1972
+ #
1973
+ def list_named_sets request, options = nil
1974
+ raise ::ArgumentError, "request must be provided" if request.nil?
1975
+
1976
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListNamedSetsRoutersRequest
1977
+
1978
+ # Converts hash and nil to an options object
1979
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1980
+
1981
+ # Customize the options with defaults
1982
+ call_metadata = @config.rpcs.list_named_sets.metadata.to_h
1983
+
1984
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1985
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1986
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1987
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1988
+ transports_version_send: [:rest]
1989
+
1990
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1991
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1992
+
1993
+ options.apply_defaults timeout: @config.rpcs.list_named_sets.timeout,
1994
+ metadata: call_metadata,
1995
+ retry_policy: @config.rpcs.list_named_sets.retry_policy
1996
+
1997
+ options.apply_defaults timeout: @config.timeout,
1998
+ metadata: @config.metadata,
1999
+ retry_policy: @config.retry_policy
2000
+
2001
+ @routers_stub.list_named_sets request, options do |result, operation|
2002
+ result = ::Gapic::Rest::PagedEnumerable.new @routers_stub, :list_named_sets, "result", request, result, options
2003
+ yield result, operation if block_given?
2004
+ throw :response, result
2005
+ end
2006
+ rescue ::Gapic::Rest::Error => e
2007
+ raise ::Google::Cloud::Error.from_error(e)
2008
+ end
2009
+
1627
2010
  ##
1628
2011
  # Retrieves a list of router route policy subresources available to the
1629
2012
  # specified project.
@@ -1909,6 +2292,114 @@ module Google
1909
2292
  raise ::Google::Cloud::Error.from_error(e)
1910
2293
  end
1911
2294
 
2295
+ ##
2296
+ # Patches Named Set
2297
+ #
2298
+ # @overload patch_named_set(request, options = nil)
2299
+ # Pass arguments to `patch_named_set` via a request object, either of type
2300
+ # {::Google::Cloud::Compute::V1::PatchNamedSetRouterRequest} or an equivalent Hash.
2301
+ #
2302
+ # @param request [::Google::Cloud::Compute::V1::PatchNamedSetRouterRequest, ::Hash]
2303
+ # A request object representing the call parameters. Required. To specify no
2304
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2305
+ # @param options [::Gapic::CallOptions, ::Hash]
2306
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2307
+ #
2308
+ # @overload patch_named_set(named_set_resource: nil, project: nil, region: nil, request_id: nil, router: nil)
2309
+ # Pass arguments to `patch_named_set` via keyword arguments. Note that at
2310
+ # least one keyword argument is required. To specify no parameters, or to keep all
2311
+ # the default parameter values, pass an empty Hash as a request object (see above).
2312
+ #
2313
+ # @param named_set_resource [::Google::Cloud::Compute::V1::NamedSet, ::Hash]
2314
+ # The body resource for this request
2315
+ # @param project [::String]
2316
+ # Project ID for this request.
2317
+ # @param region [::String]
2318
+ # Name of the region for this request.
2319
+ # @param request_id [::String]
2320
+ # An optional request ID to identify requests. Specify a unique request ID so
2321
+ # that if you must retry your request, the server will know to ignore the
2322
+ # request if it has already been completed.
2323
+ #
2324
+ # For example, consider a situation where you make an initial request and
2325
+ # the request times out. If you make the request again with the same
2326
+ # request ID, the server can check if original operation with the same
2327
+ # request ID was received, and if so, will ignore the second request. This
2328
+ # prevents clients from accidentally creating duplicate commitments.
2329
+ #
2330
+ # The request ID must be
2331
+ # a valid UUID with the exception that zero UUID is not supported
2332
+ # (00000000-0000-0000-0000-000000000000).
2333
+ # @param router [::String]
2334
+ # Name of the Router resource where Named Set is defined.
2335
+ # @yield [result, operation] Access the result along with the TransportOperation object
2336
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2337
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2338
+ #
2339
+ # @return [::Gapic::GenericLRO::Operation]
2340
+ #
2341
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2342
+ #
2343
+ # @example Basic example
2344
+ # require "google/cloud/compute/v1"
2345
+ #
2346
+ # # Create a client object. The client can be reused for multiple calls.
2347
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
2348
+ #
2349
+ # # Create a request. To set request fields, pass in keyword arguments.
2350
+ # request = Google::Cloud::Compute::V1::PatchNamedSetRouterRequest.new
2351
+ #
2352
+ # # Call the patch_named_set method.
2353
+ # result = client.patch_named_set request
2354
+ #
2355
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2356
+ # p result
2357
+ #
2358
+ def patch_named_set request, options = nil
2359
+ raise ::ArgumentError, "request must be provided" if request.nil?
2360
+
2361
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchNamedSetRouterRequest
2362
+
2363
+ # Converts hash and nil to an options object
2364
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2365
+
2366
+ # Customize the options with defaults
2367
+ call_metadata = @config.rpcs.patch_named_set.metadata.to_h
2368
+
2369
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2370
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2371
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2372
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2373
+ transports_version_send: [:rest]
2374
+
2375
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2376
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2377
+
2378
+ options.apply_defaults timeout: @config.rpcs.patch_named_set.timeout,
2379
+ metadata: call_metadata,
2380
+ retry_policy: @config.rpcs.patch_named_set.retry_policy
2381
+
2382
+ options.apply_defaults timeout: @config.timeout,
2383
+ metadata: @config.metadata,
2384
+ retry_policy: @config.retry_policy
2385
+
2386
+ @routers_stub.patch_named_set request, options do |result, response|
2387
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
2388
+ operation: result,
2389
+ client: region_operations,
2390
+ request_values: {
2391
+ "project" => request.project,
2392
+ "region" => request.region
2393
+ },
2394
+ options: options
2395
+ )
2396
+ yield result, response if block_given?
2397
+ throw :response, result
2398
+ end
2399
+ rescue ::Gapic::Rest::Error => e
2400
+ raise ::Google::Cloud::Error.from_error(e)
2401
+ end
2402
+
1912
2403
  ##
1913
2404
  # Patches Route Policy
1914
2405
  #
@@ -2213,6 +2704,114 @@ module Google
2213
2704
  raise ::Google::Cloud::Error.from_error(e)
2214
2705
  end
2215
2706
 
2707
+ ##
2708
+ # Updates or creates new Named Set
2709
+ #
2710
+ # @overload update_named_set(request, options = nil)
2711
+ # Pass arguments to `update_named_set` via a request object, either of type
2712
+ # {::Google::Cloud::Compute::V1::UpdateNamedSetRouterRequest} or an equivalent Hash.
2713
+ #
2714
+ # @param request [::Google::Cloud::Compute::V1::UpdateNamedSetRouterRequest, ::Hash]
2715
+ # A request object representing the call parameters. Required. To specify no
2716
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2717
+ # @param options [::Gapic::CallOptions, ::Hash]
2718
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2719
+ #
2720
+ # @overload update_named_set(named_set_resource: nil, project: nil, region: nil, request_id: nil, router: nil)
2721
+ # Pass arguments to `update_named_set` via keyword arguments. Note that at
2722
+ # least one keyword argument is required. To specify no parameters, or to keep all
2723
+ # the default parameter values, pass an empty Hash as a request object (see above).
2724
+ #
2725
+ # @param named_set_resource [::Google::Cloud::Compute::V1::NamedSet, ::Hash]
2726
+ # The body resource for this request
2727
+ # @param project [::String]
2728
+ # Project ID for this request.
2729
+ # @param region [::String]
2730
+ # Name of the region for this request.
2731
+ # @param request_id [::String]
2732
+ # An optional request ID to identify requests. Specify a unique request ID so
2733
+ # that if you must retry your request, the server will know to ignore the
2734
+ # request if it has already been completed.
2735
+ #
2736
+ # For example, consider a situation where you make an initial request and
2737
+ # the request times out. If you make the request again with the same
2738
+ # request ID, the server can check if original operation with the same
2739
+ # request ID was received, and if so, will ignore the second request. This
2740
+ # prevents clients from accidentally creating duplicate commitments.
2741
+ #
2742
+ # The request ID must be
2743
+ # a valid UUID with the exception that zero UUID is not supported
2744
+ # (00000000-0000-0000-0000-000000000000).
2745
+ # @param router [::String]
2746
+ # Name of the Router resource where Named Set is defined.
2747
+ # @yield [result, operation] Access the result along with the TransportOperation object
2748
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2749
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2750
+ #
2751
+ # @return [::Gapic::GenericLRO::Operation]
2752
+ #
2753
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2754
+ #
2755
+ # @example Basic example
2756
+ # require "google/cloud/compute/v1"
2757
+ #
2758
+ # # Create a client object. The client can be reused for multiple calls.
2759
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
2760
+ #
2761
+ # # Create a request. To set request fields, pass in keyword arguments.
2762
+ # request = Google::Cloud::Compute::V1::UpdateNamedSetRouterRequest.new
2763
+ #
2764
+ # # Call the update_named_set method.
2765
+ # result = client.update_named_set request
2766
+ #
2767
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2768
+ # p result
2769
+ #
2770
+ def update_named_set request, options = nil
2771
+ raise ::ArgumentError, "request must be provided" if request.nil?
2772
+
2773
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateNamedSetRouterRequest
2774
+
2775
+ # Converts hash and nil to an options object
2776
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2777
+
2778
+ # Customize the options with defaults
2779
+ call_metadata = @config.rpcs.update_named_set.metadata.to_h
2780
+
2781
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2782
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2783
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2784
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2785
+ transports_version_send: [:rest]
2786
+
2787
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2788
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2789
+
2790
+ options.apply_defaults timeout: @config.rpcs.update_named_set.timeout,
2791
+ metadata: call_metadata,
2792
+ retry_policy: @config.rpcs.update_named_set.retry_policy
2793
+
2794
+ options.apply_defaults timeout: @config.timeout,
2795
+ metadata: @config.metadata,
2796
+ retry_policy: @config.retry_policy
2797
+
2798
+ @routers_stub.update_named_set request, options do |result, response|
2799
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
2800
+ operation: result,
2801
+ client: region_operations,
2802
+ request_values: {
2803
+ "project" => request.project,
2804
+ "region" => request.region
2805
+ },
2806
+ options: options
2807
+ )
2808
+ yield result, response if block_given?
2809
+ throw :response, result
2810
+ end
2811
+ rescue ::Gapic::Rest::Error => e
2812
+ raise ::Google::Cloud::Error.from_error(e)
2813
+ end
2814
+
2216
2815
  ##
2217
2816
  # Updates or creates new Route Policy
2218
2817
  #
@@ -2480,6 +3079,11 @@ module Google
2480
3079
  #
2481
3080
  attr_reader :delete
2482
3081
  ##
3082
+ # RPC-specific configuration for `delete_named_set`
3083
+ # @return [::Gapic::Config::Method]
3084
+ #
3085
+ attr_reader :delete_named_set
3086
+ ##
2483
3087
  # RPC-specific configuration for `delete_route_policy`
2484
3088
  # @return [::Gapic::Config::Method]
2485
3089
  #
@@ -2490,6 +3094,11 @@ module Google
2490
3094
  #
2491
3095
  attr_reader :get
2492
3096
  ##
3097
+ # RPC-specific configuration for `get_named_set`
3098
+ # @return [::Gapic::Config::Method]
3099
+ #
3100
+ attr_reader :get_named_set
3101
+ ##
2493
3102
  # RPC-specific configuration for `get_nat_ip_info`
2494
3103
  # @return [::Gapic::Config::Method]
2495
3104
  #
@@ -2525,6 +3134,11 @@ module Google
2525
3134
  #
2526
3135
  attr_reader :list_bgp_routes
2527
3136
  ##
3137
+ # RPC-specific configuration for `list_named_sets`
3138
+ # @return [::Gapic::Config::Method]
3139
+ #
3140
+ attr_reader :list_named_sets
3141
+ ##
2528
3142
  # RPC-specific configuration for `list_route_policies`
2529
3143
  # @return [::Gapic::Config::Method]
2530
3144
  #
@@ -2535,6 +3149,11 @@ module Google
2535
3149
  #
2536
3150
  attr_reader :patch
2537
3151
  ##
3152
+ # RPC-specific configuration for `patch_named_set`
3153
+ # @return [::Gapic::Config::Method]
3154
+ #
3155
+ attr_reader :patch_named_set
3156
+ ##
2538
3157
  # RPC-specific configuration for `patch_route_policy`
2539
3158
  # @return [::Gapic::Config::Method]
2540
3159
  #
@@ -2550,6 +3169,11 @@ module Google
2550
3169
  #
2551
3170
  attr_reader :update
2552
3171
  ##
3172
+ # RPC-specific configuration for `update_named_set`
3173
+ # @return [::Gapic::Config::Method]
3174
+ #
3175
+ attr_reader :update_named_set
3176
+ ##
2553
3177
  # RPC-specific configuration for `update_route_policy`
2554
3178
  # @return [::Gapic::Config::Method]
2555
3179
  #
@@ -2561,10 +3185,14 @@ module Google
2561
3185
  @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
2562
3186
  delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
2563
3187
  @delete = ::Gapic::Config::Method.new delete_config
3188
+ delete_named_set_config = parent_rpcs.delete_named_set if parent_rpcs.respond_to? :delete_named_set
3189
+ @delete_named_set = ::Gapic::Config::Method.new delete_named_set_config
2564
3190
  delete_route_policy_config = parent_rpcs.delete_route_policy if parent_rpcs.respond_to? :delete_route_policy
2565
3191
  @delete_route_policy = ::Gapic::Config::Method.new delete_route_policy_config
2566
3192
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
2567
3193
  @get = ::Gapic::Config::Method.new get_config
3194
+ get_named_set_config = parent_rpcs.get_named_set if parent_rpcs.respond_to? :get_named_set
3195
+ @get_named_set = ::Gapic::Config::Method.new get_named_set_config
2568
3196
  get_nat_ip_info_config = parent_rpcs.get_nat_ip_info if parent_rpcs.respond_to? :get_nat_ip_info
2569
3197
  @get_nat_ip_info = ::Gapic::Config::Method.new get_nat_ip_info_config
2570
3198
  get_nat_mapping_info_config = parent_rpcs.get_nat_mapping_info if parent_rpcs.respond_to? :get_nat_mapping_info
@@ -2579,16 +3207,22 @@ module Google
2579
3207
  @list = ::Gapic::Config::Method.new list_config
2580
3208
  list_bgp_routes_config = parent_rpcs.list_bgp_routes if parent_rpcs.respond_to? :list_bgp_routes
2581
3209
  @list_bgp_routes = ::Gapic::Config::Method.new list_bgp_routes_config
3210
+ list_named_sets_config = parent_rpcs.list_named_sets if parent_rpcs.respond_to? :list_named_sets
3211
+ @list_named_sets = ::Gapic::Config::Method.new list_named_sets_config
2582
3212
  list_route_policies_config = parent_rpcs.list_route_policies if parent_rpcs.respond_to? :list_route_policies
2583
3213
  @list_route_policies = ::Gapic::Config::Method.new list_route_policies_config
2584
3214
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
2585
3215
  @patch = ::Gapic::Config::Method.new patch_config
3216
+ patch_named_set_config = parent_rpcs.patch_named_set if parent_rpcs.respond_to? :patch_named_set
3217
+ @patch_named_set = ::Gapic::Config::Method.new patch_named_set_config
2586
3218
  patch_route_policy_config = parent_rpcs.patch_route_policy if parent_rpcs.respond_to? :patch_route_policy
2587
3219
  @patch_route_policy = ::Gapic::Config::Method.new patch_route_policy_config
2588
3220
  preview_config = parent_rpcs.preview if parent_rpcs.respond_to? :preview
2589
3221
  @preview = ::Gapic::Config::Method.new preview_config
2590
3222
  update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
2591
3223
  @update = ::Gapic::Config::Method.new update_config
3224
+ update_named_set_config = parent_rpcs.update_named_set if parent_rpcs.respond_to? :update_named_set
3225
+ @update_named_set = ::Gapic::Config::Method.new update_named_set_config
2592
3226
  update_route_policy_config = parent_rpcs.update_route_policy if parent_rpcs.respond_to? :update_route_policy
2593
3227
  @update_route_policy = ::Gapic::Config::Method.new update_route_policy_config
2594
3228