google-cloud-video-live_stream-v1 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -179,7 +179,7 @@ module Google
179
179
  credentials = @config.credentials
180
180
  # Use self-signed JWT if the endpoint is unchanged from default,
181
181
  # but only if the default endpoint does not have a region prefix.
182
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
182
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
183
183
  !@config.endpoint.split(".").first.include?("-")
184
184
  credentials ||= Credentials.default scope: @config.scope,
185
185
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -1918,6 +1918,616 @@ module Google
1918
1918
  raise ::Google::Cloud::Error.from_error(e)
1919
1919
  end
1920
1920
 
1921
+ ##
1922
+ # Creates a Asset with the provided unique ID in the specified
1923
+ # region.
1924
+ #
1925
+ # @overload create_asset(request, options = nil)
1926
+ # Pass arguments to `create_asset` via a request object, either of type
1927
+ # {::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest} or an equivalent Hash.
1928
+ #
1929
+ # @param request [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, ::Hash]
1930
+ # A request object representing the call parameters. Required. To specify no
1931
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1932
+ # @param options [::Gapic::CallOptions, ::Hash]
1933
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1934
+ #
1935
+ # @overload create_asset(parent: nil, asset: nil, asset_id: nil, request_id: nil)
1936
+ # Pass arguments to `create_asset` via keyword arguments. Note that at
1937
+ # least one keyword argument is required. To specify no parameters, or to keep all
1938
+ # the default parameter values, pass an empty Hash as a request object (see above).
1939
+ #
1940
+ # @param parent [::String]
1941
+ # Required. The parent location for the resource, in the form of:
1942
+ # `projects/{project}/locations/{location}`.
1943
+ # @param asset [::Google::Cloud::Video::LiveStream::V1::Asset, ::Hash]
1944
+ # Required. The asset resource to be created.
1945
+ # @param asset_id [::String]
1946
+ # Required. The ID of the asset resource to be created.
1947
+ # This value must be 1-63 characters, begin and end with `[a-z0-9]`,
1948
+ # could contain dashes (-) in between.
1949
+ # @param request_id [::String]
1950
+ # A request ID to identify requests. Specify a unique request ID
1951
+ # so that if you must retry your request, the server will know to ignore
1952
+ # the request if it has already been completed. The server will guarantee
1953
+ # that for at least 60 minutes since the first request.
1954
+ #
1955
+ # For example, consider a situation where you make an initial request and the
1956
+ # request times out. If you make the request again with the same request ID,
1957
+ # the server can check if original operation with the same request ID was
1958
+ # received, and if so, will ignore the second request. This prevents clients
1959
+ # from accidentally creating duplicate commitments.
1960
+ #
1961
+ # The request ID must be a valid UUID with the exception that zero UUID is
1962
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
1963
+ #
1964
+ # @yield [response, operation] Access the result along with the RPC operation
1965
+ # @yieldparam response [::Gapic::Operation]
1966
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1967
+ #
1968
+ # @return [::Gapic::Operation]
1969
+ #
1970
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1971
+ #
1972
+ # @example Basic example
1973
+ # require "google/cloud/video/live_stream/v1"
1974
+ #
1975
+ # # Create a client object. The client can be reused for multiple calls.
1976
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new
1977
+ #
1978
+ # # Create a request. To set request fields, pass in keyword arguments.
1979
+ # request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new
1980
+ #
1981
+ # # Call the create_asset method.
1982
+ # result = client.create_asset request
1983
+ #
1984
+ # # The returned object is of type Gapic::Operation. You can use it to
1985
+ # # check the status of an operation, cancel it, or wait for results.
1986
+ # # Here is how to wait for a response.
1987
+ # result.wait_until_done! timeout: 60
1988
+ # if result.response?
1989
+ # p result.response
1990
+ # else
1991
+ # puts "No response received."
1992
+ # end
1993
+ #
1994
+ def create_asset request, options = nil
1995
+ raise ::ArgumentError, "request must be provided" if request.nil?
1996
+
1997
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest
1998
+
1999
+ # Converts hash and nil to an options object
2000
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2001
+
2002
+ # Customize the options with defaults
2003
+ metadata = @config.rpcs.create_asset.metadata.to_h
2004
+
2005
+ # Set x-goog-api-client and x-goog-user-project headers
2006
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2007
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2008
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION
2009
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2010
+
2011
+ header_params = {}
2012
+ if request.parent
2013
+ header_params["parent"] = request.parent
2014
+ end
2015
+
2016
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2017
+ metadata[:"x-goog-request-params"] ||= request_params_header
2018
+
2019
+ options.apply_defaults timeout: @config.rpcs.create_asset.timeout,
2020
+ metadata: metadata,
2021
+ retry_policy: @config.rpcs.create_asset.retry_policy
2022
+
2023
+ options.apply_defaults timeout: @config.timeout,
2024
+ metadata: @config.metadata,
2025
+ retry_policy: @config.retry_policy
2026
+
2027
+ @livestream_service_stub.call_rpc :create_asset, request, options: options do |response, operation|
2028
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2029
+ yield response, operation if block_given?
2030
+ return response
2031
+ end
2032
+ rescue ::GRPC::BadStatus => e
2033
+ raise ::Google::Cloud::Error.from_error(e)
2034
+ end
2035
+
2036
+ ##
2037
+ # Deletes the specified asset if it is not used.
2038
+ #
2039
+ # @overload delete_asset(request, options = nil)
2040
+ # Pass arguments to `delete_asset` via a request object, either of type
2041
+ # {::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest} or an equivalent Hash.
2042
+ #
2043
+ # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, ::Hash]
2044
+ # A request object representing the call parameters. Required. To specify no
2045
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2046
+ # @param options [::Gapic::CallOptions, ::Hash]
2047
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2048
+ #
2049
+ # @overload delete_asset(name: nil, request_id: nil)
2050
+ # Pass arguments to `delete_asset` via keyword arguments. Note that at
2051
+ # least one keyword argument is required. To specify no parameters, or to keep all
2052
+ # the default parameter values, pass an empty Hash as a request object (see above).
2053
+ #
2054
+ # @param name [::String]
2055
+ # Required. The name of the asset resource, in the form of:
2056
+ # `projects/{project}/locations/{location}/assets/{assetId}`.
2057
+ # @param request_id [::String]
2058
+ # A request ID to identify requests. Specify a unique request ID
2059
+ # so that if you must retry your request, the server will know to ignore
2060
+ # the request if it has already been completed. The server will guarantee
2061
+ # that for at least 60 minutes after the first request.
2062
+ #
2063
+ # For example, consider a situation where you make an initial request and the
2064
+ # request times out. If you make the request again with the same request ID,
2065
+ # the server can check if original operation with the same request ID was
2066
+ # received, and if so, will ignore the second request. This prevents clients
2067
+ # from accidentally creating duplicate commitments.
2068
+ #
2069
+ # The request ID must be a valid UUID with the exception that zero UUID is
2070
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
2071
+ #
2072
+ # @yield [response, operation] Access the result along with the RPC operation
2073
+ # @yieldparam response [::Gapic::Operation]
2074
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2075
+ #
2076
+ # @return [::Gapic::Operation]
2077
+ #
2078
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2079
+ #
2080
+ # @example Basic example
2081
+ # require "google/cloud/video/live_stream/v1"
2082
+ #
2083
+ # # Create a client object. The client can be reused for multiple calls.
2084
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new
2085
+ #
2086
+ # # Create a request. To set request fields, pass in keyword arguments.
2087
+ # request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new
2088
+ #
2089
+ # # Call the delete_asset method.
2090
+ # result = client.delete_asset request
2091
+ #
2092
+ # # The returned object is of type Gapic::Operation. You can use it to
2093
+ # # check the status of an operation, cancel it, or wait for results.
2094
+ # # Here is how to wait for a response.
2095
+ # result.wait_until_done! timeout: 60
2096
+ # if result.response?
2097
+ # p result.response
2098
+ # else
2099
+ # puts "No response received."
2100
+ # end
2101
+ #
2102
+ def delete_asset request, options = nil
2103
+ raise ::ArgumentError, "request must be provided" if request.nil?
2104
+
2105
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest
2106
+
2107
+ # Converts hash and nil to an options object
2108
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2109
+
2110
+ # Customize the options with defaults
2111
+ metadata = @config.rpcs.delete_asset.metadata.to_h
2112
+
2113
+ # Set x-goog-api-client and x-goog-user-project headers
2114
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2115
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2116
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION
2117
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2118
+
2119
+ header_params = {}
2120
+ if request.name
2121
+ header_params["name"] = request.name
2122
+ end
2123
+
2124
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2125
+ metadata[:"x-goog-request-params"] ||= request_params_header
2126
+
2127
+ options.apply_defaults timeout: @config.rpcs.delete_asset.timeout,
2128
+ metadata: metadata,
2129
+ retry_policy: @config.rpcs.delete_asset.retry_policy
2130
+
2131
+ options.apply_defaults timeout: @config.timeout,
2132
+ metadata: @config.metadata,
2133
+ retry_policy: @config.retry_policy
2134
+
2135
+ @livestream_service_stub.call_rpc :delete_asset, request, options: options do |response, operation|
2136
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2137
+ yield response, operation if block_given?
2138
+ return response
2139
+ end
2140
+ rescue ::GRPC::BadStatus => e
2141
+ raise ::Google::Cloud::Error.from_error(e)
2142
+ end
2143
+
2144
+ ##
2145
+ # Returns the specified asset.
2146
+ #
2147
+ # @overload get_asset(request, options = nil)
2148
+ # Pass arguments to `get_asset` via a request object, either of type
2149
+ # {::Google::Cloud::Video::LiveStream::V1::GetAssetRequest} or an equivalent Hash.
2150
+ #
2151
+ # @param request [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, ::Hash]
2152
+ # A request object representing the call parameters. Required. To specify no
2153
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2154
+ # @param options [::Gapic::CallOptions, ::Hash]
2155
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2156
+ #
2157
+ # @overload get_asset(name: nil)
2158
+ # Pass arguments to `get_asset` via keyword arguments. Note that at
2159
+ # least one keyword argument is required. To specify no parameters, or to keep all
2160
+ # the default parameter values, pass an empty Hash as a request object (see above).
2161
+ #
2162
+ # @param name [::String]
2163
+ # Required. Name of the resource, in the following form:
2164
+ # `projects/{project}/locations/{location}/assets/{asset}`.
2165
+ #
2166
+ # @yield [response, operation] Access the result along with the RPC operation
2167
+ # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Asset]
2168
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2169
+ #
2170
+ # @return [::Google::Cloud::Video::LiveStream::V1::Asset]
2171
+ #
2172
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2173
+ #
2174
+ # @example Basic example
2175
+ # require "google/cloud/video/live_stream/v1"
2176
+ #
2177
+ # # Create a client object. The client can be reused for multiple calls.
2178
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new
2179
+ #
2180
+ # # Create a request. To set request fields, pass in keyword arguments.
2181
+ # request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new
2182
+ #
2183
+ # # Call the get_asset method.
2184
+ # result = client.get_asset request
2185
+ #
2186
+ # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset.
2187
+ # p result
2188
+ #
2189
+ def get_asset request, options = nil
2190
+ raise ::ArgumentError, "request must be provided" if request.nil?
2191
+
2192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest
2193
+
2194
+ # Converts hash and nil to an options object
2195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2196
+
2197
+ # Customize the options with defaults
2198
+ metadata = @config.rpcs.get_asset.metadata.to_h
2199
+
2200
+ # Set x-goog-api-client and x-goog-user-project headers
2201
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2203
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION
2204
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2205
+
2206
+ header_params = {}
2207
+ if request.name
2208
+ header_params["name"] = request.name
2209
+ end
2210
+
2211
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2212
+ metadata[:"x-goog-request-params"] ||= request_params_header
2213
+
2214
+ options.apply_defaults timeout: @config.rpcs.get_asset.timeout,
2215
+ metadata: metadata,
2216
+ retry_policy: @config.rpcs.get_asset.retry_policy
2217
+
2218
+ options.apply_defaults timeout: @config.timeout,
2219
+ metadata: @config.metadata,
2220
+ retry_policy: @config.retry_policy
2221
+
2222
+ @livestream_service_stub.call_rpc :get_asset, request, options: options do |response, operation|
2223
+ yield response, operation if block_given?
2224
+ return response
2225
+ end
2226
+ rescue ::GRPC::BadStatus => e
2227
+ raise ::Google::Cloud::Error.from_error(e)
2228
+ end
2229
+
2230
+ ##
2231
+ # Returns a list of all assets in the specified region.
2232
+ #
2233
+ # @overload list_assets(request, options = nil)
2234
+ # Pass arguments to `list_assets` via a request object, either of type
2235
+ # {::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest} or an equivalent Hash.
2236
+ #
2237
+ # @param request [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, ::Hash]
2238
+ # A request object representing the call parameters. Required. To specify no
2239
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2240
+ # @param options [::Gapic::CallOptions, ::Hash]
2241
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2242
+ #
2243
+ # @overload list_assets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2244
+ # Pass arguments to `list_assets` via keyword arguments. Note that at
2245
+ # least one keyword argument is required. To specify no parameters, or to keep all
2246
+ # the default parameter values, pass an empty Hash as a request object (see above).
2247
+ #
2248
+ # @param parent [::String]
2249
+ # Required. The parent location for the resource, in the form of:
2250
+ # `projects/{project}/locations/{location}`.
2251
+ # @param page_size [::Integer]
2252
+ # Requested page size. Server may return fewer items than requested.
2253
+ # If unspecified, server will pick an appropriate default.
2254
+ # @param page_token [::String]
2255
+ # A token identifying a page of results the server should return.
2256
+ # @param filter [::String]
2257
+ # Filtering results
2258
+ # @param order_by [::String]
2259
+ # Hint for how to order the results
2260
+ #
2261
+ # @yield [response, operation] Access the result along with the RPC operation
2262
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>]
2263
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2264
+ #
2265
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>]
2266
+ #
2267
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2268
+ #
2269
+ # @example Basic example
2270
+ # require "google/cloud/video/live_stream/v1"
2271
+ #
2272
+ # # Create a client object. The client can be reused for multiple calls.
2273
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new
2274
+ #
2275
+ # # Create a request. To set request fields, pass in keyword arguments.
2276
+ # request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new
2277
+ #
2278
+ # # Call the list_assets method.
2279
+ # result = client.list_assets request
2280
+ #
2281
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2282
+ # # over elements, and API calls will be issued to fetch pages as needed.
2283
+ # result.each do |item|
2284
+ # # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Asset.
2285
+ # p item
2286
+ # end
2287
+ #
2288
+ def list_assets request, options = nil
2289
+ raise ::ArgumentError, "request must be provided" if request.nil?
2290
+
2291
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest
2292
+
2293
+ # Converts hash and nil to an options object
2294
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2295
+
2296
+ # Customize the options with defaults
2297
+ metadata = @config.rpcs.list_assets.metadata.to_h
2298
+
2299
+ # Set x-goog-api-client and x-goog-user-project headers
2300
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2301
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2302
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION
2303
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2304
+
2305
+ header_params = {}
2306
+ if request.parent
2307
+ header_params["parent"] = request.parent
2308
+ end
2309
+
2310
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2311
+ metadata[:"x-goog-request-params"] ||= request_params_header
2312
+
2313
+ options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
2314
+ metadata: metadata,
2315
+ retry_policy: @config.rpcs.list_assets.retry_policy
2316
+
2317
+ options.apply_defaults timeout: @config.timeout,
2318
+ metadata: @config.metadata,
2319
+ retry_policy: @config.retry_policy
2320
+
2321
+ @livestream_service_stub.call_rpc :list_assets, request, options: options do |response, operation|
2322
+ response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_assets, request, response, operation, options
2323
+ yield response, operation if block_given?
2324
+ return response
2325
+ end
2326
+ rescue ::GRPC::BadStatus => e
2327
+ raise ::Google::Cloud::Error.from_error(e)
2328
+ end
2329
+
2330
+ ##
2331
+ # Returns the specified pool.
2332
+ #
2333
+ # @overload get_pool(request, options = nil)
2334
+ # Pass arguments to `get_pool` via a request object, either of type
2335
+ # {::Google::Cloud::Video::LiveStream::V1::GetPoolRequest} or an equivalent Hash.
2336
+ #
2337
+ # @param request [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, ::Hash]
2338
+ # A request object representing the call parameters. Required. To specify no
2339
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2340
+ # @param options [::Gapic::CallOptions, ::Hash]
2341
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2342
+ #
2343
+ # @overload get_pool(name: nil)
2344
+ # Pass arguments to `get_pool` via keyword arguments. Note that at
2345
+ # least one keyword argument is required. To specify no parameters, or to keep all
2346
+ # the default parameter values, pass an empty Hash as a request object (see above).
2347
+ #
2348
+ # @param name [::String]
2349
+ # Required. The name of the pool resource, in the form of:
2350
+ # `projects/{project}/locations/{location}/pools/{poolId}`.
2351
+ #
2352
+ # @yield [response, operation] Access the result along with the RPC operation
2353
+ # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Pool]
2354
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2355
+ #
2356
+ # @return [::Google::Cloud::Video::LiveStream::V1::Pool]
2357
+ #
2358
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2359
+ #
2360
+ # @example Basic example
2361
+ # require "google/cloud/video/live_stream/v1"
2362
+ #
2363
+ # # Create a client object. The client can be reused for multiple calls.
2364
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new
2365
+ #
2366
+ # # Create a request. To set request fields, pass in keyword arguments.
2367
+ # request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new
2368
+ #
2369
+ # # Call the get_pool method.
2370
+ # result = client.get_pool request
2371
+ #
2372
+ # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool.
2373
+ # p result
2374
+ #
2375
+ def get_pool request, options = nil
2376
+ raise ::ArgumentError, "request must be provided" if request.nil?
2377
+
2378
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest
2379
+
2380
+ # Converts hash and nil to an options object
2381
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2382
+
2383
+ # Customize the options with defaults
2384
+ metadata = @config.rpcs.get_pool.metadata.to_h
2385
+
2386
+ # Set x-goog-api-client and x-goog-user-project headers
2387
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2388
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2389
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION
2390
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2391
+
2392
+ header_params = {}
2393
+ if request.name
2394
+ header_params["name"] = request.name
2395
+ end
2396
+
2397
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2398
+ metadata[:"x-goog-request-params"] ||= request_params_header
2399
+
2400
+ options.apply_defaults timeout: @config.rpcs.get_pool.timeout,
2401
+ metadata: metadata,
2402
+ retry_policy: @config.rpcs.get_pool.retry_policy
2403
+
2404
+ options.apply_defaults timeout: @config.timeout,
2405
+ metadata: @config.metadata,
2406
+ retry_policy: @config.retry_policy
2407
+
2408
+ @livestream_service_stub.call_rpc :get_pool, request, options: options do |response, operation|
2409
+ yield response, operation if block_given?
2410
+ return response
2411
+ end
2412
+ rescue ::GRPC::BadStatus => e
2413
+ raise ::Google::Cloud::Error.from_error(e)
2414
+ end
2415
+
2416
+ ##
2417
+ # Updates the specified pool.
2418
+ #
2419
+ # @overload update_pool(request, options = nil)
2420
+ # Pass arguments to `update_pool` via a request object, either of type
2421
+ # {::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest} or an equivalent Hash.
2422
+ #
2423
+ # @param request [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, ::Hash]
2424
+ # A request object representing the call parameters. Required. To specify no
2425
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2426
+ # @param options [::Gapic::CallOptions, ::Hash]
2427
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2428
+ #
2429
+ # @overload update_pool(update_mask: nil, pool: nil, request_id: nil)
2430
+ # Pass arguments to `update_pool` via keyword arguments. Note that at
2431
+ # least one keyword argument is required. To specify no parameters, or to keep all
2432
+ # the default parameter values, pass an empty Hash as a request object (see above).
2433
+ #
2434
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2435
+ # Field mask is used to specify the fields to be overwritten in the Pool
2436
+ # resource by the update. You can only update the following fields:
2437
+ #
2438
+ # * `networkConfig`
2439
+ #
2440
+ # The fields specified in the update_mask are relative to the resource, not
2441
+ # the full request. A field will be overwritten if it is in the mask.
2442
+ # @param pool [::Google::Cloud::Video::LiveStream::V1::Pool, ::Hash]
2443
+ # Required. The pool resource to be updated.
2444
+ # @param request_id [::String]
2445
+ # A request ID to identify requests. Specify a unique request ID
2446
+ # so that if you must retry your request, the server will know to ignore
2447
+ # the request if it has already been completed. The server will guarantee
2448
+ # that for at least 60 minutes since the first request.
2449
+ #
2450
+ # For example, consider a situation where you make an initial request and the
2451
+ # request times out. If you make the request again with the same request ID,
2452
+ # the server can check if original operation with the same request ID was
2453
+ # received, and if so, will ignore the second request. This prevents clients
2454
+ # from accidentally creating duplicate commitments.
2455
+ #
2456
+ # The request ID must be a valid UUID with the exception that zero UUID is
2457
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
2458
+ #
2459
+ # @yield [response, operation] Access the result along with the RPC operation
2460
+ # @yieldparam response [::Gapic::Operation]
2461
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2462
+ #
2463
+ # @return [::Gapic::Operation]
2464
+ #
2465
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2466
+ #
2467
+ # @example Basic example
2468
+ # require "google/cloud/video/live_stream/v1"
2469
+ #
2470
+ # # Create a client object. The client can be reused for multiple calls.
2471
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new
2472
+ #
2473
+ # # Create a request. To set request fields, pass in keyword arguments.
2474
+ # request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new
2475
+ #
2476
+ # # Call the update_pool method.
2477
+ # result = client.update_pool request
2478
+ #
2479
+ # # The returned object is of type Gapic::Operation. You can use it to
2480
+ # # check the status of an operation, cancel it, or wait for results.
2481
+ # # Here is how to wait for a response.
2482
+ # result.wait_until_done! timeout: 60
2483
+ # if result.response?
2484
+ # p result.response
2485
+ # else
2486
+ # puts "No response received."
2487
+ # end
2488
+ #
2489
+ def update_pool request, options = nil
2490
+ raise ::ArgumentError, "request must be provided" if request.nil?
2491
+
2492
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest
2493
+
2494
+ # Converts hash and nil to an options object
2495
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2496
+
2497
+ # Customize the options with defaults
2498
+ metadata = @config.rpcs.update_pool.metadata.to_h
2499
+
2500
+ # Set x-goog-api-client and x-goog-user-project headers
2501
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2502
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2503
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION
2504
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2505
+
2506
+ header_params = {}
2507
+ if request.pool&.name
2508
+ header_params["pool.name"] = request.pool.name
2509
+ end
2510
+
2511
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2512
+ metadata[:"x-goog-request-params"] ||= request_params_header
2513
+
2514
+ options.apply_defaults timeout: @config.rpcs.update_pool.timeout,
2515
+ metadata: metadata,
2516
+ retry_policy: @config.rpcs.update_pool.retry_policy
2517
+
2518
+ options.apply_defaults timeout: @config.timeout,
2519
+ metadata: @config.metadata,
2520
+ retry_policy: @config.retry_policy
2521
+
2522
+ @livestream_service_stub.call_rpc :update_pool, request, options: options do |response, operation|
2523
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2524
+ yield response, operation if block_given?
2525
+ return response
2526
+ end
2527
+ rescue ::GRPC::BadStatus => e
2528
+ raise ::Google::Cloud::Error.from_error(e)
2529
+ end
2530
+
1921
2531
  ##
1922
2532
  # Configuration class for the LivestreamService API.
1923
2533
  #
@@ -2000,7 +2610,9 @@ module Google
2000
2610
  class Configuration
2001
2611
  extend ::Gapic::Config
2002
2612
 
2003
- config_attr :endpoint, "livestream.googleapis.com", ::String
2613
+ DEFAULT_ENDPOINT = "livestream.googleapis.com"
2614
+
2615
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2004
2616
  config_attr :credentials, nil do |value|
2005
2617
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2006
2618
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -2133,6 +2745,36 @@ module Google
2133
2745
  # @return [::Gapic::Config::Method]
2134
2746
  #
2135
2747
  attr_reader :delete_event
2748
+ ##
2749
+ # RPC-specific configuration for `create_asset`
2750
+ # @return [::Gapic::Config::Method]
2751
+ #
2752
+ attr_reader :create_asset
2753
+ ##
2754
+ # RPC-specific configuration for `delete_asset`
2755
+ # @return [::Gapic::Config::Method]
2756
+ #
2757
+ attr_reader :delete_asset
2758
+ ##
2759
+ # RPC-specific configuration for `get_asset`
2760
+ # @return [::Gapic::Config::Method]
2761
+ #
2762
+ attr_reader :get_asset
2763
+ ##
2764
+ # RPC-specific configuration for `list_assets`
2765
+ # @return [::Gapic::Config::Method]
2766
+ #
2767
+ attr_reader :list_assets
2768
+ ##
2769
+ # RPC-specific configuration for `get_pool`
2770
+ # @return [::Gapic::Config::Method]
2771
+ #
2772
+ attr_reader :get_pool
2773
+ ##
2774
+ # RPC-specific configuration for `update_pool`
2775
+ # @return [::Gapic::Config::Method]
2776
+ #
2777
+ attr_reader :update_pool
2136
2778
 
2137
2779
  # @private
2138
2780
  def initialize parent_rpcs = nil
@@ -2168,6 +2810,18 @@ module Google
2168
2810
  @get_event = ::Gapic::Config::Method.new get_event_config
2169
2811
  delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event
2170
2812
  @delete_event = ::Gapic::Config::Method.new delete_event_config
2813
+ create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset
2814
+ @create_asset = ::Gapic::Config::Method.new create_asset_config
2815
+ delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset
2816
+ @delete_asset = ::Gapic::Config::Method.new delete_asset_config
2817
+ get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset
2818
+ @get_asset = ::Gapic::Config::Method.new get_asset_config
2819
+ list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets
2820
+ @list_assets = ::Gapic::Config::Method.new list_assets_config
2821
+ get_pool_config = parent_rpcs.get_pool if parent_rpcs.respond_to? :get_pool
2822
+ @get_pool = ::Gapic::Config::Method.new get_pool_config
2823
+ update_pool_config = parent_rpcs.update_pool if parent_rpcs.respond_to? :update_pool
2824
+ @update_pool = ::Gapic::Config::Method.new update_pool_config
2171
2825
 
2172
2826
  yield self if block_given?
2173
2827
  end